1*837d542aSEvan Quan /* 2*837d542aSEvan Quan * Copyright 2014 Advanced Micro Devices, Inc. 3*837d542aSEvan Quan * 4*837d542aSEvan Quan * Permission is hereby granted, free of charge, to any person obtaining a 5*837d542aSEvan Quan * copy of this software and associated documentation files (the "Software"), 6*837d542aSEvan Quan * to deal in the Software without restriction, including without limitation 7*837d542aSEvan Quan * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8*837d542aSEvan Quan * and/or sell copies of the Software, and to permit persons to whom the 9*837d542aSEvan Quan * Software is furnished to do so, subject to the following conditions: 10*837d542aSEvan Quan * 11*837d542aSEvan Quan * The above copyright notice and this permission notice shall be included in 12*837d542aSEvan Quan * all copies or substantial portions of the Software. 13*837d542aSEvan Quan * 14*837d542aSEvan Quan * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15*837d542aSEvan Quan * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16*837d542aSEvan Quan * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17*837d542aSEvan Quan * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18*837d542aSEvan Quan * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19*837d542aSEvan Quan * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20*837d542aSEvan Quan * OTHER DEALINGS IN THE SOFTWARE. 21*837d542aSEvan Quan * 22*837d542aSEvan Quan */ 23*837d542aSEvan Quan 24*837d542aSEvan Quan #ifndef SMU74_DISCRETE_H 25*837d542aSEvan Quan #define SMU74_DISCRETE_H 26*837d542aSEvan Quan 27*837d542aSEvan Quan #include "smu74.h" 28*837d542aSEvan Quan 29*837d542aSEvan Quan #pragma pack(push, 1) 30*837d542aSEvan Quan 31*837d542aSEvan Quan 32*837d542aSEvan Quan #define NUM_SCLK_RANGE 8 33*837d542aSEvan Quan 34*837d542aSEvan Quan #define VCO_3_6 1 35*837d542aSEvan Quan #define VCO_2_4 3 36*837d542aSEvan Quan 37*837d542aSEvan Quan #define POSTDIV_DIV_BY_1 0 38*837d542aSEvan Quan #define POSTDIV_DIV_BY_2 1 39*837d542aSEvan Quan #define POSTDIV_DIV_BY_4 2 40*837d542aSEvan Quan #define POSTDIV_DIV_BY_8 3 41*837d542aSEvan Quan #define POSTDIV_DIV_BY_16 4 42*837d542aSEvan Quan 43*837d542aSEvan Quan struct sclkFcwRange_t { 44*837d542aSEvan Quan uint8_t vco_setting; 45*837d542aSEvan Quan uint8_t postdiv; 46*837d542aSEvan Quan uint16_t fcw_pcc; 47*837d542aSEvan Quan 48*837d542aSEvan Quan uint16_t fcw_trans_upper; 49*837d542aSEvan Quan uint16_t fcw_trans_lower; 50*837d542aSEvan Quan }; 51*837d542aSEvan Quan typedef struct sclkFcwRange_t sclkFcwRange_t; 52*837d542aSEvan Quan 53*837d542aSEvan Quan struct SMIO_Pattern { 54*837d542aSEvan Quan uint16_t Voltage; 55*837d542aSEvan Quan uint8_t Smio; 56*837d542aSEvan Quan uint8_t padding; 57*837d542aSEvan Quan }; 58*837d542aSEvan Quan 59*837d542aSEvan Quan typedef struct SMIO_Pattern SMIO_Pattern; 60*837d542aSEvan Quan 61*837d542aSEvan Quan struct SMIO_Table { 62*837d542aSEvan Quan SMIO_Pattern Pattern[SMU_MAX_SMIO_LEVELS]; 63*837d542aSEvan Quan }; 64*837d542aSEvan Quan 65*837d542aSEvan Quan typedef struct SMIO_Table SMIO_Table; 66*837d542aSEvan Quan 67*837d542aSEvan Quan struct SMU_SclkSetting { 68*837d542aSEvan Quan uint32_t SclkFrequency; 69*837d542aSEvan Quan uint16_t Fcw_int; 70*837d542aSEvan Quan uint16_t Fcw_frac; 71*837d542aSEvan Quan uint16_t Pcc_fcw_int; 72*837d542aSEvan Quan uint8_t PllRange; 73*837d542aSEvan Quan uint8_t SSc_En; 74*837d542aSEvan Quan uint16_t Sclk_slew_rate; 75*837d542aSEvan Quan uint16_t Pcc_up_slew_rate; 76*837d542aSEvan Quan uint16_t Pcc_down_slew_rate; 77*837d542aSEvan Quan uint16_t Fcw1_int; 78*837d542aSEvan Quan uint16_t Fcw1_frac; 79*837d542aSEvan Quan uint16_t Sclk_ss_slew_rate; 80*837d542aSEvan Quan }; 81*837d542aSEvan Quan typedef struct SMU_SclkSetting SMU_SclkSetting; 82*837d542aSEvan Quan 83*837d542aSEvan Quan struct SMU74_Discrete_GraphicsLevel { 84*837d542aSEvan Quan SMU_VoltageLevel MinVoltage; 85*837d542aSEvan Quan uint8_t pcieDpmLevel; 86*837d542aSEvan Quan uint8_t DeepSleepDivId; 87*837d542aSEvan Quan uint16_t ActivityLevel; 88*837d542aSEvan Quan uint32_t CgSpllFuncCntl3; 89*837d542aSEvan Quan uint32_t CgSpllFuncCntl4; 90*837d542aSEvan Quan uint32_t CcPwrDynRm; 91*837d542aSEvan Quan uint32_t CcPwrDynRm1; 92*837d542aSEvan Quan uint8_t SclkDid; 93*837d542aSEvan Quan uint8_t padding; 94*837d542aSEvan Quan uint8_t EnabledForActivity; 95*837d542aSEvan Quan uint8_t EnabledForThrottle; 96*837d542aSEvan Quan uint8_t UpHyst; 97*837d542aSEvan Quan uint8_t DownHyst; 98*837d542aSEvan Quan uint8_t VoltageDownHyst; 99*837d542aSEvan Quan uint8_t PowerThrottle; 100*837d542aSEvan Quan SMU_SclkSetting SclkSetting; 101*837d542aSEvan Quan }; 102*837d542aSEvan Quan 103*837d542aSEvan Quan typedef struct SMU74_Discrete_GraphicsLevel SMU74_Discrete_GraphicsLevel; 104*837d542aSEvan Quan 105*837d542aSEvan Quan struct SMU74_Discrete_ACPILevel { 106*837d542aSEvan Quan uint32_t Flags; 107*837d542aSEvan Quan SMU_VoltageLevel MinVoltage; 108*837d542aSEvan Quan uint32_t SclkFrequency; 109*837d542aSEvan Quan uint8_t SclkDid; 110*837d542aSEvan Quan uint8_t DisplayWatermark; 111*837d542aSEvan Quan uint8_t DeepSleepDivId; 112*837d542aSEvan Quan uint8_t padding; 113*837d542aSEvan Quan uint32_t CcPwrDynRm; 114*837d542aSEvan Quan uint32_t CcPwrDynRm1; 115*837d542aSEvan Quan 116*837d542aSEvan Quan SMU_SclkSetting SclkSetting; 117*837d542aSEvan Quan }; 118*837d542aSEvan Quan 119*837d542aSEvan Quan typedef struct SMU74_Discrete_ACPILevel SMU74_Discrete_ACPILevel; 120*837d542aSEvan Quan 121*837d542aSEvan Quan struct SMU74_Discrete_Ulv { 122*837d542aSEvan Quan uint32_t CcPwrDynRm; 123*837d542aSEvan Quan uint32_t CcPwrDynRm1; 124*837d542aSEvan Quan uint16_t VddcOffset; 125*837d542aSEvan Quan uint8_t VddcOffsetVid; 126*837d542aSEvan Quan uint8_t VddcPhase; 127*837d542aSEvan Quan uint16_t BifSclkDfs; 128*837d542aSEvan Quan uint16_t Reserved; 129*837d542aSEvan Quan }; 130*837d542aSEvan Quan 131*837d542aSEvan Quan typedef struct SMU74_Discrete_Ulv SMU74_Discrete_Ulv; 132*837d542aSEvan Quan 133*837d542aSEvan Quan struct SMU74_Discrete_MemoryLevel { 134*837d542aSEvan Quan SMU_VoltageLevel MinVoltage; 135*837d542aSEvan Quan uint32_t MinMvdd; 136*837d542aSEvan Quan 137*837d542aSEvan Quan uint32_t MclkFrequency; 138*837d542aSEvan Quan 139*837d542aSEvan Quan uint8_t StutterEnable; 140*837d542aSEvan Quan uint8_t EnabledForThrottle; 141*837d542aSEvan Quan uint8_t EnabledForActivity; 142*837d542aSEvan Quan uint8_t padding_0; 143*837d542aSEvan Quan 144*837d542aSEvan Quan uint8_t UpHyst; 145*837d542aSEvan Quan uint8_t DownHyst; 146*837d542aSEvan Quan uint8_t VoltageDownHyst; 147*837d542aSEvan Quan uint8_t padding_1; 148*837d542aSEvan Quan 149*837d542aSEvan Quan uint16_t ActivityLevel; 150*837d542aSEvan Quan uint8_t DisplayWatermark; 151*837d542aSEvan Quan uint8_t Reserved; 152*837d542aSEvan Quan }; 153*837d542aSEvan Quan 154*837d542aSEvan Quan typedef struct SMU74_Discrete_MemoryLevel SMU74_Discrete_MemoryLevel; 155*837d542aSEvan Quan 156*837d542aSEvan Quan struct SMU74_Discrete_LinkLevel { 157*837d542aSEvan Quan uint8_t PcieGenSpeed; 158*837d542aSEvan Quan uint8_t PcieLaneCount; 159*837d542aSEvan Quan uint8_t EnabledForActivity; 160*837d542aSEvan Quan uint8_t SPC; 161*837d542aSEvan Quan uint32_t DownThreshold; 162*837d542aSEvan Quan uint32_t UpThreshold; 163*837d542aSEvan Quan uint16_t BifSclkDfs; 164*837d542aSEvan Quan uint16_t Reserved; 165*837d542aSEvan Quan }; 166*837d542aSEvan Quan 167*837d542aSEvan Quan typedef struct SMU74_Discrete_LinkLevel SMU74_Discrete_LinkLevel; 168*837d542aSEvan Quan 169*837d542aSEvan Quan struct SMU74_Discrete_MCArbDramTimingTableEntry { 170*837d542aSEvan Quan uint32_t McArbDramTiming; 171*837d542aSEvan Quan uint32_t McArbDramTiming2; 172*837d542aSEvan Quan uint8_t McArbBurstTime; 173*837d542aSEvan Quan uint8_t padding[3]; 174*837d542aSEvan Quan }; 175*837d542aSEvan Quan 176*837d542aSEvan Quan typedef struct SMU74_Discrete_MCArbDramTimingTableEntry SMU74_Discrete_MCArbDramTimingTableEntry; 177*837d542aSEvan Quan 178*837d542aSEvan Quan struct SMU74_Discrete_MCArbDramTimingTable { 179*837d542aSEvan Quan SMU74_Discrete_MCArbDramTimingTableEntry entries[SMU__NUM_SCLK_DPM_STATE][SMU__NUM_MCLK_DPM_LEVELS]; 180*837d542aSEvan Quan }; 181*837d542aSEvan Quan 182*837d542aSEvan Quan typedef struct SMU74_Discrete_MCArbDramTimingTable SMU74_Discrete_MCArbDramTimingTable; 183*837d542aSEvan Quan 184*837d542aSEvan Quan struct SMU74_Discrete_UvdLevel { 185*837d542aSEvan Quan uint32_t VclkFrequency; 186*837d542aSEvan Quan uint32_t DclkFrequency; 187*837d542aSEvan Quan SMU_VoltageLevel MinVoltage; 188*837d542aSEvan Quan uint8_t VclkDivider; 189*837d542aSEvan Quan uint8_t DclkDivider; 190*837d542aSEvan Quan uint8_t padding[2]; 191*837d542aSEvan Quan }; 192*837d542aSEvan Quan 193*837d542aSEvan Quan typedef struct SMU74_Discrete_UvdLevel SMU74_Discrete_UvdLevel; 194*837d542aSEvan Quan 195*837d542aSEvan Quan struct SMU74_Discrete_ExtClkLevel { 196*837d542aSEvan Quan uint32_t Frequency; 197*837d542aSEvan Quan SMU_VoltageLevel MinVoltage; 198*837d542aSEvan Quan uint8_t Divider; 199*837d542aSEvan Quan uint8_t padding[3]; 200*837d542aSEvan Quan }; 201*837d542aSEvan Quan 202*837d542aSEvan Quan typedef struct SMU74_Discrete_ExtClkLevel SMU74_Discrete_ExtClkLevel; 203*837d542aSEvan Quan 204*837d542aSEvan Quan struct SMU74_Discrete_StateInfo { 205*837d542aSEvan Quan uint32_t SclkFrequency; 206*837d542aSEvan Quan uint32_t MclkFrequency; 207*837d542aSEvan Quan uint32_t VclkFrequency; 208*837d542aSEvan Quan uint32_t DclkFrequency; 209*837d542aSEvan Quan uint32_t SamclkFrequency; 210*837d542aSEvan Quan uint32_t AclkFrequency; 211*837d542aSEvan Quan uint32_t EclkFrequency; 212*837d542aSEvan Quan uint16_t MvddVoltage; 213*837d542aSEvan Quan uint16_t padding16; 214*837d542aSEvan Quan uint8_t DisplayWatermark; 215*837d542aSEvan Quan uint8_t McArbIndex; 216*837d542aSEvan Quan uint8_t McRegIndex; 217*837d542aSEvan Quan uint8_t SeqIndex; 218*837d542aSEvan Quan uint8_t SclkDid; 219*837d542aSEvan Quan int8_t SclkIndex; 220*837d542aSEvan Quan int8_t MclkIndex; 221*837d542aSEvan Quan uint8_t PCIeGen; 222*837d542aSEvan Quan }; 223*837d542aSEvan Quan 224*837d542aSEvan Quan typedef struct SMU74_Discrete_StateInfo SMU74_Discrete_StateInfo; 225*837d542aSEvan Quan 226*837d542aSEvan Quan struct SMU_QuadraticCoeffs { 227*837d542aSEvan Quan int32_t m1; 228*837d542aSEvan Quan uint32_t b; 229*837d542aSEvan Quan 230*837d542aSEvan Quan int16_t m2; 231*837d542aSEvan Quan uint8_t m1_shift; 232*837d542aSEvan Quan uint8_t m2_shift; 233*837d542aSEvan Quan }; 234*837d542aSEvan Quan typedef struct SMU_QuadraticCoeffs SMU_QuadraticCoeffs; 235*837d542aSEvan Quan 236*837d542aSEvan Quan struct SMU74_Discrete_DpmTable { 237*837d542aSEvan Quan 238*837d542aSEvan Quan SMU74_PIDController GraphicsPIDController; 239*837d542aSEvan Quan SMU74_PIDController MemoryPIDController; 240*837d542aSEvan Quan SMU74_PIDController LinkPIDController; 241*837d542aSEvan Quan 242*837d542aSEvan Quan uint32_t SystemFlags; 243*837d542aSEvan Quan 244*837d542aSEvan Quan uint32_t VRConfig; 245*837d542aSEvan Quan uint32_t SmioMask1; 246*837d542aSEvan Quan uint32_t SmioMask2; 247*837d542aSEvan Quan SMIO_Table SmioTable1; 248*837d542aSEvan Quan SMIO_Table SmioTable2; 249*837d542aSEvan Quan 250*837d542aSEvan Quan uint32_t MvddLevelCount; 251*837d542aSEvan Quan 252*837d542aSEvan Quan 253*837d542aSEvan Quan uint8_t BapmVddcVidHiSidd[SMU74_MAX_LEVELS_VDDC]; 254*837d542aSEvan Quan uint8_t BapmVddcVidLoSidd[SMU74_MAX_LEVELS_VDDC]; 255*837d542aSEvan Quan uint8_t BapmVddcVidHiSidd2[SMU74_MAX_LEVELS_VDDC]; 256*837d542aSEvan Quan 257*837d542aSEvan Quan uint8_t GraphicsDpmLevelCount; 258*837d542aSEvan Quan uint8_t MemoryDpmLevelCount; 259*837d542aSEvan Quan uint8_t LinkLevelCount; 260*837d542aSEvan Quan uint8_t MasterDeepSleepControl; 261*837d542aSEvan Quan 262*837d542aSEvan Quan uint8_t UvdLevelCount; 263*837d542aSEvan Quan uint8_t VceLevelCount; 264*837d542aSEvan Quan uint8_t AcpLevelCount; 265*837d542aSEvan Quan uint8_t SamuLevelCount; 266*837d542aSEvan Quan 267*837d542aSEvan Quan uint8_t ThermOutGpio; 268*837d542aSEvan Quan uint8_t ThermOutPolarity; 269*837d542aSEvan Quan uint8_t ThermOutMode; 270*837d542aSEvan Quan uint8_t BootPhases; 271*837d542aSEvan Quan 272*837d542aSEvan Quan uint8_t VRHotLevel; 273*837d542aSEvan Quan uint8_t LdoRefSel; 274*837d542aSEvan Quan uint8_t SharedRails; 275*837d542aSEvan Quan uint8_t Reserved1; 276*837d542aSEvan Quan uint16_t FanStartTemperature; 277*837d542aSEvan Quan uint16_t FanStopTemperature; 278*837d542aSEvan Quan uint16_t MaxVoltage; 279*837d542aSEvan Quan uint16_t Reserved2; 280*837d542aSEvan Quan uint32_t Reserved[1]; 281*837d542aSEvan Quan 282*837d542aSEvan Quan SMU74_Discrete_GraphicsLevel GraphicsLevel[SMU74_MAX_LEVELS_GRAPHICS]; 283*837d542aSEvan Quan SMU74_Discrete_MemoryLevel MemoryACPILevel; 284*837d542aSEvan Quan SMU74_Discrete_MemoryLevel MemoryLevel[SMU74_MAX_LEVELS_MEMORY]; 285*837d542aSEvan Quan SMU74_Discrete_LinkLevel LinkLevel[SMU74_MAX_LEVELS_LINK]; 286*837d542aSEvan Quan SMU74_Discrete_ACPILevel ACPILevel; 287*837d542aSEvan Quan SMU74_Discrete_UvdLevel UvdLevel[SMU74_MAX_LEVELS_UVD]; 288*837d542aSEvan Quan SMU74_Discrete_ExtClkLevel VceLevel[SMU74_MAX_LEVELS_VCE]; 289*837d542aSEvan Quan SMU74_Discrete_ExtClkLevel AcpLevel[SMU74_MAX_LEVELS_ACP]; 290*837d542aSEvan Quan SMU74_Discrete_ExtClkLevel SamuLevel[SMU74_MAX_LEVELS_SAMU]; 291*837d542aSEvan Quan SMU74_Discrete_Ulv Ulv; 292*837d542aSEvan Quan 293*837d542aSEvan Quan uint8_t DisplayWatermark[SMU74_MAX_LEVELS_MEMORY][SMU74_MAX_LEVELS_GRAPHICS]; 294*837d542aSEvan Quan 295*837d542aSEvan Quan uint32_t SclkStepSize; 296*837d542aSEvan Quan uint32_t Smio[SMU74_MAX_ENTRIES_SMIO]; 297*837d542aSEvan Quan 298*837d542aSEvan Quan uint8_t UvdBootLevel; 299*837d542aSEvan Quan uint8_t VceBootLevel; 300*837d542aSEvan Quan uint8_t AcpBootLevel; 301*837d542aSEvan Quan uint8_t SamuBootLevel; 302*837d542aSEvan Quan 303*837d542aSEvan Quan uint8_t GraphicsBootLevel; 304*837d542aSEvan Quan uint8_t GraphicsVoltageChangeEnable; 305*837d542aSEvan Quan uint8_t GraphicsThermThrottleEnable; 306*837d542aSEvan Quan uint8_t GraphicsInterval; 307*837d542aSEvan Quan 308*837d542aSEvan Quan uint8_t VoltageInterval; 309*837d542aSEvan Quan uint8_t ThermalInterval; 310*837d542aSEvan Quan uint16_t TemperatureLimitHigh; 311*837d542aSEvan Quan 312*837d542aSEvan Quan uint16_t TemperatureLimitLow; 313*837d542aSEvan Quan uint8_t MemoryBootLevel; 314*837d542aSEvan Quan uint8_t MemoryVoltageChangeEnable; 315*837d542aSEvan Quan 316*837d542aSEvan Quan uint16_t BootMVdd; 317*837d542aSEvan Quan uint8_t MemoryInterval; 318*837d542aSEvan Quan uint8_t MemoryThermThrottleEnable; 319*837d542aSEvan Quan 320*837d542aSEvan Quan uint16_t VoltageResponseTime; 321*837d542aSEvan Quan uint16_t PhaseResponseTime; 322*837d542aSEvan Quan 323*837d542aSEvan Quan uint8_t PCIeBootLinkLevel; 324*837d542aSEvan Quan uint8_t PCIeGenInterval; 325*837d542aSEvan Quan uint8_t DTEInterval; 326*837d542aSEvan Quan uint8_t DTEMode; 327*837d542aSEvan Quan 328*837d542aSEvan Quan uint8_t SVI2Enable; 329*837d542aSEvan Quan uint8_t VRHotGpio; 330*837d542aSEvan Quan uint8_t AcDcGpio; 331*837d542aSEvan Quan uint8_t ThermGpio; 332*837d542aSEvan Quan 333*837d542aSEvan Quan uint16_t PPM_PkgPwrLimit; 334*837d542aSEvan Quan uint16_t PPM_TemperatureLimit; 335*837d542aSEvan Quan 336*837d542aSEvan Quan uint16_t DefaultTdp; 337*837d542aSEvan Quan uint16_t TargetTdp; 338*837d542aSEvan Quan 339*837d542aSEvan Quan uint16_t FpsHighThreshold; 340*837d542aSEvan Quan uint16_t FpsLowThreshold; 341*837d542aSEvan Quan 342*837d542aSEvan Quan uint16_t BAPMTI_R[SMU74_DTE_ITERATIONS][SMU74_DTE_SOURCES][SMU74_DTE_SINKS]; 343*837d542aSEvan Quan uint16_t BAPMTI_RC[SMU74_DTE_ITERATIONS][SMU74_DTE_SOURCES][SMU74_DTE_SINKS]; 344*837d542aSEvan Quan 345*837d542aSEvan Quan uint16_t TemperatureLimitEdge; 346*837d542aSEvan Quan uint16_t TemperatureLimitHotspot; 347*837d542aSEvan Quan 348*837d542aSEvan Quan uint16_t BootVddc; 349*837d542aSEvan Quan uint16_t BootVddci; 350*837d542aSEvan Quan 351*837d542aSEvan Quan uint16_t FanGainEdge; 352*837d542aSEvan Quan uint16_t FanGainHotspot; 353*837d542aSEvan Quan 354*837d542aSEvan Quan uint32_t LowSclkInterruptThreshold; 355*837d542aSEvan Quan uint32_t VddGfxReChkWait; 356*837d542aSEvan Quan 357*837d542aSEvan Quan uint8_t ClockStretcherAmount; 358*837d542aSEvan Quan uint8_t Sclk_CKS_masterEn0_7; 359*837d542aSEvan Quan uint8_t Sclk_CKS_masterEn8_15; 360*837d542aSEvan Quan uint8_t DPMFreezeAndForced; 361*837d542aSEvan Quan 362*837d542aSEvan Quan uint8_t Sclk_voltageOffset[8]; 363*837d542aSEvan Quan 364*837d542aSEvan Quan SMU_ClockStretcherDataTable ClockStretcherDataTable; 365*837d542aSEvan Quan SMU_CKS_LOOKUPTable CKS_LOOKUPTable; 366*837d542aSEvan Quan 367*837d542aSEvan Quan uint32_t CurrSclkPllRange; 368*837d542aSEvan Quan sclkFcwRange_t SclkFcwRangeTable[NUM_SCLK_RANGE]; 369*837d542aSEvan Quan GB_VDROOP_TABLE_t BTCGB_VDROOP_TABLE[BTCGB_VDROOP_TABLE_MAX_ENTRIES]; 370*837d542aSEvan Quan SMU_QuadraticCoeffs AVFSGB_VDROOP_TABLE[AVFSGB_VDROOP_TABLE_MAX_ENTRIES]; 371*837d542aSEvan Quan }; 372*837d542aSEvan Quan 373*837d542aSEvan Quan typedef struct SMU74_Discrete_DpmTable SMU74_Discrete_DpmTable; 374*837d542aSEvan Quan 375*837d542aSEvan Quan 376*837d542aSEvan Quan struct SMU74_Discrete_FanTable { 377*837d542aSEvan Quan uint16_t FdoMode; 378*837d542aSEvan Quan int16_t TempMin; 379*837d542aSEvan Quan int16_t TempMed; 380*837d542aSEvan Quan int16_t TempMax; 381*837d542aSEvan Quan int16_t Slope1; 382*837d542aSEvan Quan int16_t Slope2; 383*837d542aSEvan Quan int16_t FdoMin; 384*837d542aSEvan Quan int16_t HystUp; 385*837d542aSEvan Quan int16_t HystDown; 386*837d542aSEvan Quan int16_t HystSlope; 387*837d542aSEvan Quan int16_t TempRespLim; 388*837d542aSEvan Quan int16_t TempCurr; 389*837d542aSEvan Quan int16_t SlopeCurr; 390*837d542aSEvan Quan int16_t PwmCurr; 391*837d542aSEvan Quan uint32_t RefreshPeriod; 392*837d542aSEvan Quan int16_t FdoMax; 393*837d542aSEvan Quan uint8_t TempSrc; 394*837d542aSEvan Quan int8_t Padding; 395*837d542aSEvan Quan }; 396*837d542aSEvan Quan 397*837d542aSEvan Quan typedef struct SMU74_Discrete_FanTable SMU74_Discrete_FanTable; 398*837d542aSEvan Quan 399*837d542aSEvan Quan #define SMU7_DISCRETE_GPIO_SCLK_DEBUG 4 400*837d542aSEvan Quan #define SMU7_DISCRETE_GPIO_SCLK_DEBUG_BIT (0x1 << SMU7_DISCRETE_GPIO_SCLK_DEBUG) 401*837d542aSEvan Quan 402*837d542aSEvan Quan 403*837d542aSEvan Quan struct SMU7_MclkDpmScoreboard { 404*837d542aSEvan Quan uint32_t PercentageBusy; 405*837d542aSEvan Quan 406*837d542aSEvan Quan int32_t PIDError; 407*837d542aSEvan Quan int32_t PIDIntegral; 408*837d542aSEvan Quan int32_t PIDOutput; 409*837d542aSEvan Quan 410*837d542aSEvan Quan uint32_t SigmaDeltaAccum; 411*837d542aSEvan Quan uint32_t SigmaDeltaOutput; 412*837d542aSEvan Quan uint32_t SigmaDeltaLevel; 413*837d542aSEvan Quan 414*837d542aSEvan Quan uint32_t UtilizationSetpoint; 415*837d542aSEvan Quan 416*837d542aSEvan Quan uint8_t TdpClampMode; 417*837d542aSEvan Quan uint8_t TdcClampMode; 418*837d542aSEvan Quan uint8_t ThermClampMode; 419*837d542aSEvan Quan uint8_t VoltageBusy; 420*837d542aSEvan Quan 421*837d542aSEvan Quan int8_t CurrLevel; 422*837d542aSEvan Quan int8_t TargLevel; 423*837d542aSEvan Quan uint8_t LevelChangeInProgress; 424*837d542aSEvan Quan uint8_t UpHyst; 425*837d542aSEvan Quan 426*837d542aSEvan Quan uint8_t DownHyst; 427*837d542aSEvan Quan uint8_t VoltageDownHyst; 428*837d542aSEvan Quan uint8_t DpmEnable; 429*837d542aSEvan Quan uint8_t DpmRunning; 430*837d542aSEvan Quan 431*837d542aSEvan Quan uint8_t DpmForce; 432*837d542aSEvan Quan uint8_t DpmForceLevel; 433*837d542aSEvan Quan uint8_t padding2; 434*837d542aSEvan Quan uint8_t McArbIndex; 435*837d542aSEvan Quan 436*837d542aSEvan Quan uint32_t MinimumPerfMclk; 437*837d542aSEvan Quan 438*837d542aSEvan Quan uint8_t AcpiReq; 439*837d542aSEvan Quan uint8_t AcpiAck; 440*837d542aSEvan Quan uint8_t MclkSwitchInProgress; 441*837d542aSEvan Quan uint8_t MclkSwitchCritical; 442*837d542aSEvan Quan 443*837d542aSEvan Quan uint8_t IgnoreVBlank; 444*837d542aSEvan Quan uint8_t TargetMclkIndex; 445*837d542aSEvan Quan uint16_t VbiFailureCount; 446*837d542aSEvan Quan uint8_t VbiWaitCounter; 447*837d542aSEvan Quan uint8_t EnabledLevelsChange; 448*837d542aSEvan Quan 449*837d542aSEvan Quan uint16_t LevelResidencyCounters[SMU74_MAX_LEVELS_MEMORY]; 450*837d542aSEvan Quan uint16_t LevelSwitchCounters[SMU74_MAX_LEVELS_MEMORY]; 451*837d542aSEvan Quan 452*837d542aSEvan Quan void (*TargetStateCalculator)(uint8_t); 453*837d542aSEvan Quan void (*SavedTargetStateCalculator)(uint8_t); 454*837d542aSEvan Quan 455*837d542aSEvan Quan uint16_t AutoDpmInterval; 456*837d542aSEvan Quan uint16_t AutoDpmRange; 457*837d542aSEvan Quan 458*837d542aSEvan Quan uint16_t VbiTimeoutCount; 459*837d542aSEvan Quan uint16_t MclkSwitchingTime; 460*837d542aSEvan Quan 461*837d542aSEvan Quan uint8_t fastSwitch; 462*837d542aSEvan Quan uint8_t Save_PIC_VDDGFX_EXIT; 463*837d542aSEvan Quan uint8_t Save_PIC_VDDGFX_ENTER; 464*837d542aSEvan Quan uint8_t padding; 465*837d542aSEvan Quan }; 466*837d542aSEvan Quan 467*837d542aSEvan Quan typedef struct SMU7_MclkDpmScoreboard SMU7_MclkDpmScoreboard; 468*837d542aSEvan Quan 469*837d542aSEvan Quan struct SMU7_UlvScoreboard { 470*837d542aSEvan Quan uint8_t EnterUlv; 471*837d542aSEvan Quan uint8_t ExitUlv; 472*837d542aSEvan Quan uint8_t UlvActive; 473*837d542aSEvan Quan uint8_t WaitingForUlv; 474*837d542aSEvan Quan uint8_t UlvEnable; 475*837d542aSEvan Quan uint8_t UlvRunning; 476*837d542aSEvan Quan uint8_t UlvMasterEnable; 477*837d542aSEvan Quan uint8_t padding; 478*837d542aSEvan Quan uint32_t UlvAbortedCount; 479*837d542aSEvan Quan uint32_t UlvTimeStamp; 480*837d542aSEvan Quan }; 481*837d542aSEvan Quan 482*837d542aSEvan Quan typedef struct SMU7_UlvScoreboard SMU7_UlvScoreboard; 483*837d542aSEvan Quan 484*837d542aSEvan Quan struct VddgfxSavedRegisters { 485*837d542aSEvan Quan uint32_t GPU_DBG[3]; 486*837d542aSEvan Quan uint32_t MEC_BaseAddress_Hi; 487*837d542aSEvan Quan uint32_t MEC_BaseAddress_Lo; 488*837d542aSEvan Quan uint32_t THM_TMON0_CTRL2__RDIR_PRESENT; 489*837d542aSEvan Quan uint32_t THM_TMON1_CTRL2__RDIR_PRESENT; 490*837d542aSEvan Quan uint32_t CP_INT_CNTL; 491*837d542aSEvan Quan }; 492*837d542aSEvan Quan 493*837d542aSEvan Quan typedef struct VddgfxSavedRegisters VddgfxSavedRegisters; 494*837d542aSEvan Quan 495*837d542aSEvan Quan struct SMU7_VddGfxScoreboard { 496*837d542aSEvan Quan uint8_t VddGfxEnable; 497*837d542aSEvan Quan uint8_t VddGfxActive; 498*837d542aSEvan Quan uint8_t VPUResetOccured; 499*837d542aSEvan Quan uint8_t padding; 500*837d542aSEvan Quan 501*837d542aSEvan Quan uint32_t VddGfxEnteredCount; 502*837d542aSEvan Quan uint32_t VddGfxAbortedCount; 503*837d542aSEvan Quan 504*837d542aSEvan Quan uint32_t VddGfxVid; 505*837d542aSEvan Quan 506*837d542aSEvan Quan VddgfxSavedRegisters SavedRegisters; 507*837d542aSEvan Quan }; 508*837d542aSEvan Quan 509*837d542aSEvan Quan typedef struct SMU7_VddGfxScoreboard SMU7_VddGfxScoreboard; 510*837d542aSEvan Quan 511*837d542aSEvan Quan struct SMU7_TdcLimitScoreboard { 512*837d542aSEvan Quan uint8_t Enable; 513*837d542aSEvan Quan uint8_t Running; 514*837d542aSEvan Quan uint16_t Alpha; 515*837d542aSEvan Quan uint32_t FilteredIddc; 516*837d542aSEvan Quan uint32_t IddcLimit; 517*837d542aSEvan Quan uint32_t IddcHyst; 518*837d542aSEvan Quan SMU7_HystController_Data HystControllerData; 519*837d542aSEvan Quan }; 520*837d542aSEvan Quan 521*837d542aSEvan Quan typedef struct SMU7_TdcLimitScoreboard SMU7_TdcLimitScoreboard; 522*837d542aSEvan Quan 523*837d542aSEvan Quan struct SMU7_PkgPwrLimitScoreboard { 524*837d542aSEvan Quan uint8_t Enable; 525*837d542aSEvan Quan uint8_t Running; 526*837d542aSEvan Quan uint16_t Alpha; 527*837d542aSEvan Quan uint32_t FilteredPkgPwr; 528*837d542aSEvan Quan uint32_t Limit; 529*837d542aSEvan Quan uint32_t Hyst; 530*837d542aSEvan Quan uint32_t LimitFromDriver; 531*837d542aSEvan Quan SMU7_HystController_Data HystControllerData; 532*837d542aSEvan Quan }; 533*837d542aSEvan Quan 534*837d542aSEvan Quan typedef struct SMU7_PkgPwrLimitScoreboard SMU7_PkgPwrLimitScoreboard; 535*837d542aSEvan Quan 536*837d542aSEvan Quan struct SMU7_BapmScoreboard { 537*837d542aSEvan Quan uint32_t source_powers[SMU74_DTE_SOURCES]; 538*837d542aSEvan Quan uint32_t source_powers_last[SMU74_DTE_SOURCES]; 539*837d542aSEvan Quan int32_t entity_temperatures[SMU74_NUM_GPU_TES]; 540*837d542aSEvan Quan int32_t initial_entity_temperatures[SMU74_NUM_GPU_TES]; 541*837d542aSEvan Quan int32_t Limit; 542*837d542aSEvan Quan int32_t Hyst; 543*837d542aSEvan Quan int32_t therm_influence_coeff_table[SMU74_DTE_ITERATIONS * SMU74_DTE_SOURCES * SMU74_DTE_SINKS * 2]; 544*837d542aSEvan Quan int32_t therm_node_table[SMU74_DTE_ITERATIONS * SMU74_DTE_SOURCES * SMU74_DTE_SINKS]; 545*837d542aSEvan Quan uint16_t ConfigTDPPowerScalar; 546*837d542aSEvan Quan uint16_t FanSpeedPowerScalar; 547*837d542aSEvan Quan uint16_t OverDrivePowerScalar; 548*837d542aSEvan Quan uint16_t OverDriveLimitScalar; 549*837d542aSEvan Quan uint16_t FinalPowerScalar; 550*837d542aSEvan Quan uint8_t VariantID; 551*837d542aSEvan Quan uint8_t spare997; 552*837d542aSEvan Quan 553*837d542aSEvan Quan SMU7_HystController_Data HystControllerData; 554*837d542aSEvan Quan 555*837d542aSEvan Quan int32_t temperature_gradient_slope; 556*837d542aSEvan Quan int32_t temperature_gradient; 557*837d542aSEvan Quan uint32_t measured_temperature; 558*837d542aSEvan Quan }; 559*837d542aSEvan Quan 560*837d542aSEvan Quan 561*837d542aSEvan Quan typedef struct SMU7_BapmScoreboard SMU7_BapmScoreboard; 562*837d542aSEvan Quan 563*837d542aSEvan Quan struct SMU7_AcpiScoreboard { 564*837d542aSEvan Quan uint32_t SavedInterruptMask[2]; 565*837d542aSEvan Quan uint8_t LastACPIRequest; 566*837d542aSEvan Quan uint8_t CgBifResp; 567*837d542aSEvan Quan uint8_t RequestType; 568*837d542aSEvan Quan uint8_t Padding; 569*837d542aSEvan Quan SMU74_Discrete_ACPILevel D0Level; 570*837d542aSEvan Quan }; 571*837d542aSEvan Quan 572*837d542aSEvan Quan typedef struct SMU7_AcpiScoreboard SMU7_AcpiScoreboard; 573*837d542aSEvan Quan 574*837d542aSEvan Quan struct SMU74_Discrete_PmFuses { 575*837d542aSEvan Quan uint8_t BapmVddCVidHiSidd[8]; 576*837d542aSEvan Quan uint8_t BapmVddCVidLoSidd[8]; 577*837d542aSEvan Quan uint8_t VddCVid[8]; 578*837d542aSEvan Quan uint8_t SviLoadLineEn; 579*837d542aSEvan Quan uint8_t SviLoadLineVddC; 580*837d542aSEvan Quan uint8_t SviLoadLineTrimVddC; 581*837d542aSEvan Quan uint8_t SviLoadLineOffsetVddC; 582*837d542aSEvan Quan uint16_t TDC_VDDC_PkgLimit; 583*837d542aSEvan Quan uint8_t TDC_VDDC_ThrottleReleaseLimitPerc; 584*837d542aSEvan Quan uint8_t TDC_MAWt; 585*837d542aSEvan Quan uint8_t TdcWaterfallCtl; 586*837d542aSEvan Quan uint8_t LPMLTemperatureMin; 587*837d542aSEvan Quan uint8_t LPMLTemperatureMax; 588*837d542aSEvan Quan uint8_t Reserved; 589*837d542aSEvan Quan 590*837d542aSEvan Quan uint8_t LPMLTemperatureScaler[16]; 591*837d542aSEvan Quan 592*837d542aSEvan Quan int16_t FuzzyFan_ErrorSetDelta; 593*837d542aSEvan Quan int16_t FuzzyFan_ErrorRateSetDelta; 594*837d542aSEvan Quan int16_t FuzzyFan_PwmSetDelta; 595*837d542aSEvan Quan uint16_t Reserved6; 596*837d542aSEvan Quan 597*837d542aSEvan Quan uint8_t GnbLPML[16]; 598*837d542aSEvan Quan 599*837d542aSEvan Quan uint8_t GnbLPMLMaxVid; 600*837d542aSEvan Quan uint8_t GnbLPMLMinVid; 601*837d542aSEvan Quan uint8_t Reserved1[2]; 602*837d542aSEvan Quan 603*837d542aSEvan Quan uint16_t BapmVddCBaseLeakageHiSidd; 604*837d542aSEvan Quan uint16_t BapmVddCBaseLeakageLoSidd; 605*837d542aSEvan Quan 606*837d542aSEvan Quan uint16_t VFT_Temp[3]; 607*837d542aSEvan Quan uint16_t padding; 608*837d542aSEvan Quan 609*837d542aSEvan Quan SMU_QuadraticCoeffs VFT_ATE[3]; 610*837d542aSEvan Quan 611*837d542aSEvan Quan SMU_QuadraticCoeffs AVFS_GB; 612*837d542aSEvan Quan SMU_QuadraticCoeffs ATE_ACBTC_GB; 613*837d542aSEvan Quan 614*837d542aSEvan Quan SMU_QuadraticCoeffs P2V; 615*837d542aSEvan Quan 616*837d542aSEvan Quan uint32_t PsmCharzFreq; 617*837d542aSEvan Quan 618*837d542aSEvan Quan uint16_t InversionVoltage; 619*837d542aSEvan Quan uint16_t PsmCharzTemp; 620*837d542aSEvan Quan 621*837d542aSEvan Quan uint32_t EnabledAvfsModules; 622*837d542aSEvan Quan }; 623*837d542aSEvan Quan 624*837d542aSEvan Quan typedef struct SMU74_Discrete_PmFuses SMU74_Discrete_PmFuses; 625*837d542aSEvan Quan 626*837d542aSEvan Quan struct SMU7_Discrete_Log_Header_Table { 627*837d542aSEvan Quan uint32_t version; 628*837d542aSEvan Quan uint32_t asic_id; 629*837d542aSEvan Quan uint16_t flags; 630*837d542aSEvan Quan uint16_t entry_size; 631*837d542aSEvan Quan uint32_t total_size; 632*837d542aSEvan Quan uint32_t num_of_entries; 633*837d542aSEvan Quan uint8_t type; 634*837d542aSEvan Quan uint8_t mode; 635*837d542aSEvan Quan uint8_t filler_0[2]; 636*837d542aSEvan Quan uint32_t filler_1[2]; 637*837d542aSEvan Quan }; 638*837d542aSEvan Quan 639*837d542aSEvan Quan typedef struct SMU7_Discrete_Log_Header_Table SMU7_Discrete_Log_Header_Table; 640*837d542aSEvan Quan 641*837d542aSEvan Quan struct SMU7_Discrete_Log_Cntl { 642*837d542aSEvan Quan uint8_t Enabled; 643*837d542aSEvan Quan uint8_t Type; 644*837d542aSEvan Quan uint8_t padding[2]; 645*837d542aSEvan Quan uint32_t BufferSize; 646*837d542aSEvan Quan uint32_t SamplesLogged; 647*837d542aSEvan Quan uint32_t SampleSize; 648*837d542aSEvan Quan uint32_t AddrL; 649*837d542aSEvan Quan uint32_t AddrH; 650*837d542aSEvan Quan }; 651*837d542aSEvan Quan 652*837d542aSEvan Quan typedef struct SMU7_Discrete_Log_Cntl SMU7_Discrete_Log_Cntl; 653*837d542aSEvan Quan 654*837d542aSEvan Quan #if defined SMU__DGPU_ONLY 655*837d542aSEvan Quan #define CAC_ACC_NW_NUM_OF_SIGNALS 87 656*837d542aSEvan Quan #endif 657*837d542aSEvan Quan 658*837d542aSEvan Quan 659*837d542aSEvan Quan struct SMU7_Discrete_Cac_Collection_Table { 660*837d542aSEvan Quan uint32_t temperature; 661*837d542aSEvan Quan uint32_t cac_acc_nw[CAC_ACC_NW_NUM_OF_SIGNALS]; 662*837d542aSEvan Quan }; 663*837d542aSEvan Quan 664*837d542aSEvan Quan typedef struct SMU7_Discrete_Cac_Collection_Table SMU7_Discrete_Cac_Collection_Table; 665*837d542aSEvan Quan 666*837d542aSEvan Quan struct SMU7_Discrete_Cac_Verification_Table { 667*837d542aSEvan Quan uint32_t VddcTotalPower; 668*837d542aSEvan Quan uint32_t VddcLeakagePower; 669*837d542aSEvan Quan uint32_t VddcConstantPower; 670*837d542aSEvan Quan uint32_t VddcGfxDynamicPower; 671*837d542aSEvan Quan uint32_t VddcUvdDynamicPower; 672*837d542aSEvan Quan uint32_t VddcVceDynamicPower; 673*837d542aSEvan Quan uint32_t VddcAcpDynamicPower; 674*837d542aSEvan Quan uint32_t VddcPcieDynamicPower; 675*837d542aSEvan Quan uint32_t VddcDceDynamicPower; 676*837d542aSEvan Quan uint32_t VddcCurrent; 677*837d542aSEvan Quan uint32_t VddcVoltage; 678*837d542aSEvan Quan uint32_t VddciTotalPower; 679*837d542aSEvan Quan uint32_t VddciLeakagePower; 680*837d542aSEvan Quan uint32_t VddciConstantPower; 681*837d542aSEvan Quan uint32_t VddciDynamicPower; 682*837d542aSEvan Quan uint32_t Vddr1TotalPower; 683*837d542aSEvan Quan uint32_t Vddr1LeakagePower; 684*837d542aSEvan Quan uint32_t Vddr1ConstantPower; 685*837d542aSEvan Quan uint32_t Vddr1DynamicPower; 686*837d542aSEvan Quan uint32_t spare[4]; 687*837d542aSEvan Quan uint32_t temperature; 688*837d542aSEvan Quan }; 689*837d542aSEvan Quan 690*837d542aSEvan Quan typedef struct SMU7_Discrete_Cac_Verification_Table SMU7_Discrete_Cac_Verification_Table; 691*837d542aSEvan Quan 692*837d542aSEvan Quan struct SMU7_Discrete_Pm_Status_Table { 693*837d542aSEvan Quan int32_t T_meas_max; 694*837d542aSEvan Quan int32_t T_meas_acc; 695*837d542aSEvan Quan int32_t T_calc_max; 696*837d542aSEvan Quan int32_t T_calc_acc; 697*837d542aSEvan Quan uint32_t P_scalar_acc; 698*837d542aSEvan Quan uint32_t P_calc_max; 699*837d542aSEvan Quan uint32_t P_calc_acc; 700*837d542aSEvan Quan 701*837d542aSEvan Quan uint32_t I_calc_max; 702*837d542aSEvan Quan uint32_t I_calc_acc; 703*837d542aSEvan Quan uint32_t I_calc_acc_vddci; 704*837d542aSEvan Quan uint32_t V_calc_noload_acc; 705*837d542aSEvan Quan uint32_t V_calc_load_acc; 706*837d542aSEvan Quan uint32_t V_calc_noload_acc_vddci; 707*837d542aSEvan Quan uint32_t P_meas_acc; 708*837d542aSEvan Quan uint32_t V_meas_noload_acc; 709*837d542aSEvan Quan uint32_t V_meas_load_acc; 710*837d542aSEvan Quan uint32_t I_meas_acc; 711*837d542aSEvan Quan uint32_t P_meas_acc_vddci; 712*837d542aSEvan Quan uint32_t V_meas_noload_acc_vddci; 713*837d542aSEvan Quan uint32_t V_meas_load_acc_vddci; 714*837d542aSEvan Quan uint32_t I_meas_acc_vddci; 715*837d542aSEvan Quan 716*837d542aSEvan Quan uint16_t Sclk_dpm_residency[8]; 717*837d542aSEvan Quan uint16_t Uvd_dpm_residency[8]; 718*837d542aSEvan Quan uint16_t Vce_dpm_residency[8]; 719*837d542aSEvan Quan uint16_t Mclk_dpm_residency[4]; 720*837d542aSEvan Quan 721*837d542aSEvan Quan uint32_t P_vddci_acc; 722*837d542aSEvan Quan uint32_t P_vddr1_acc; 723*837d542aSEvan Quan uint32_t P_nte1_acc; 724*837d542aSEvan Quan uint32_t PkgPwr_max; 725*837d542aSEvan Quan uint32_t PkgPwr_acc; 726*837d542aSEvan Quan uint32_t MclkSwitchingTime_max; 727*837d542aSEvan Quan uint32_t MclkSwitchingTime_acc; 728*837d542aSEvan Quan uint32_t FanPwm_acc; 729*837d542aSEvan Quan uint32_t FanRpm_acc; 730*837d542aSEvan Quan 731*837d542aSEvan Quan uint32_t AccCnt; 732*837d542aSEvan Quan }; 733*837d542aSEvan Quan 734*837d542aSEvan Quan typedef struct SMU7_Discrete_Pm_Status_Table SMU7_Discrete_Pm_Status_Table; 735*837d542aSEvan Quan 736*837d542aSEvan Quan #define SMU7_MAX_GFX_CU_COUNT 16 737*837d542aSEvan Quan 738*837d542aSEvan Quan struct SMU7_GfxCuPgScoreboard { 739*837d542aSEvan Quan uint8_t Enabled; 740*837d542aSEvan Quan uint8_t WaterfallUp; 741*837d542aSEvan Quan uint8_t WaterfallDown; 742*837d542aSEvan Quan uint8_t WaterfallLimit; 743*837d542aSEvan Quan uint8_t CurrMaxCu; 744*837d542aSEvan Quan uint8_t TargMaxCu; 745*837d542aSEvan Quan uint8_t ClampMode; 746*837d542aSEvan Quan uint8_t Active; 747*837d542aSEvan Quan uint8_t MaxSupportedCu; 748*837d542aSEvan Quan uint8_t MinSupportedCu; 749*837d542aSEvan Quan uint8_t PendingGfxCuHostInterrupt; 750*837d542aSEvan Quan uint8_t LastFilteredMaxCuInteger; 751*837d542aSEvan Quan uint16_t FilteredMaxCu; 752*837d542aSEvan Quan uint16_t FilteredMaxCuAlpha; 753*837d542aSEvan Quan uint16_t FilterResetCount; 754*837d542aSEvan Quan uint16_t FilterResetCountLimit; 755*837d542aSEvan Quan uint8_t ForceCu; 756*837d542aSEvan Quan uint8_t ForceCuCount; 757*837d542aSEvan Quan uint8_t spare[2]; 758*837d542aSEvan Quan }; 759*837d542aSEvan Quan 760*837d542aSEvan Quan typedef struct SMU7_GfxCuPgScoreboard SMU7_GfxCuPgScoreboard; 761*837d542aSEvan Quan 762*837d542aSEvan Quan #define SMU7_SCLK_CAC 0x561 763*837d542aSEvan Quan #define SMU7_MCLK_CAC 0xF9 764*837d542aSEvan Quan #define SMU7_VCLK_CAC 0x2DE 765*837d542aSEvan Quan #define SMU7_DCLK_CAC 0x2DE 766*837d542aSEvan Quan #define SMU7_ECLK_CAC 0x25E 767*837d542aSEvan Quan #define SMU7_ACLK_CAC 0x25E 768*837d542aSEvan Quan #define SMU7_SAMCLK_CAC 0x25E 769*837d542aSEvan Quan #define SMU7_DISPCLK_CAC 0x100 770*837d542aSEvan Quan #define SMU7_CAC_CONSTANT 0x2EE3430 771*837d542aSEvan Quan #define SMU7_CAC_CONSTANT_SHIFT 18 772*837d542aSEvan Quan 773*837d542aSEvan Quan #define SMU7_VDDCI_MCLK_CONST 1765 774*837d542aSEvan Quan #define SMU7_VDDCI_MCLK_CONST_SHIFT 16 775*837d542aSEvan Quan #define SMU7_VDDCI_VDDCI_CONST 50958 776*837d542aSEvan Quan #define SMU7_VDDCI_VDDCI_CONST_SHIFT 14 777*837d542aSEvan Quan #define SMU7_VDDCI_CONST 11781 778*837d542aSEvan Quan #define SMU7_VDDCI_STROBE_PWR 1331 779*837d542aSEvan Quan 780*837d542aSEvan Quan #define SMU7_VDDR1_CONST 693 781*837d542aSEvan Quan #define SMU7_VDDR1_CAC_WEIGHT 20 782*837d542aSEvan Quan #define SMU7_VDDR1_CAC_WEIGHT_SHIFT 19 783*837d542aSEvan Quan #define SMU7_VDDR1_STROBE_PWR 512 784*837d542aSEvan Quan 785*837d542aSEvan Quan #define SMU7_AREA_COEFF_UVD 0xA78 786*837d542aSEvan Quan #define SMU7_AREA_COEFF_VCE 0x190A 787*837d542aSEvan Quan #define SMU7_AREA_COEFF_ACP 0x22D1 788*837d542aSEvan Quan #define SMU7_AREA_COEFF_SAMU 0x534 789*837d542aSEvan Quan 790*837d542aSEvan Quan #define SMU7_THERM_OUT_MODE_DISABLE 0x0 791*837d542aSEvan Quan #define SMU7_THERM_OUT_MODE_THERM_ONLY 0x1 792*837d542aSEvan Quan #define SMU7_THERM_OUT_MODE_THERM_VRHOT 0x2 793*837d542aSEvan Quan 794*837d542aSEvan Quan // DIDT Defines 795*837d542aSEvan Quan #define SQ_Enable_MASK 0x1 796*837d542aSEvan Quan #define SQ_IR_MASK 0x2 797*837d542aSEvan Quan #define SQ_PCC_MASK 0x4 798*837d542aSEvan Quan #define SQ_EDC_MASK 0x8 799*837d542aSEvan Quan 800*837d542aSEvan Quan #define TCP_Enable_MASK 0x100 801*837d542aSEvan Quan #define TCP_IR_MASK 0x200 802*837d542aSEvan Quan #define TCP_PCC_MASK 0x400 803*837d542aSEvan Quan #define TCP_EDC_MASK 0x800 804*837d542aSEvan Quan 805*837d542aSEvan Quan #define TD_Enable_MASK 0x10000 806*837d542aSEvan Quan #define TD_IR_MASK 0x20000 807*837d542aSEvan Quan #define TD_PCC_MASK 0x40000 808*837d542aSEvan Quan #define TD_EDC_MASK 0x80000 809*837d542aSEvan Quan 810*837d542aSEvan Quan #define DB_Enable_MASK 0x1000000 811*837d542aSEvan Quan #define DB_IR_MASK 0x2000000 812*837d542aSEvan Quan #define DB_PCC_MASK 0x4000000 813*837d542aSEvan Quan #define DB_EDC_MASK 0x8000000 814*837d542aSEvan Quan 815*837d542aSEvan Quan #define SQ_Enable_SHIFT 0 816*837d542aSEvan Quan #define SQ_IR_SHIFT 1 817*837d542aSEvan Quan #define SQ_PCC_SHIFT 2 818*837d542aSEvan Quan #define SQ_EDC_SHIFT 3 819*837d542aSEvan Quan 820*837d542aSEvan Quan #define TCP_Enable_SHIFT 8 821*837d542aSEvan Quan #define TCP_IR_SHIFT 9 822*837d542aSEvan Quan #define TCP_PCC_SHIFT 10 823*837d542aSEvan Quan #define TCP_EDC_SHIFT 11 824*837d542aSEvan Quan 825*837d542aSEvan Quan #define TD_Enable_SHIFT 16 826*837d542aSEvan Quan #define TD_IR_SHIFT 17 827*837d542aSEvan Quan #define TD_PCC_SHIFT 18 828*837d542aSEvan Quan #define TD_EDC_SHIFT 19 829*837d542aSEvan Quan 830*837d542aSEvan Quan #define DB_Enable_SHIFT 24 831*837d542aSEvan Quan #define DB_IR_SHIFT 25 832*837d542aSEvan Quan #define DB_PCC_SHIFT 26 833*837d542aSEvan Quan #define DB_EDC_SHIFT 27 834*837d542aSEvan Quan 835*837d542aSEvan Quan #define BTCGB0_Vdroop_Enable_MASK 0x1 836*837d542aSEvan Quan #define BTCGB1_Vdroop_Enable_MASK 0x2 837*837d542aSEvan Quan #define AVFSGB0_Vdroop_Enable_MASK 0x4 838*837d542aSEvan Quan #define AVFSGB1_Vdroop_Enable_MASK 0x8 839*837d542aSEvan Quan 840*837d542aSEvan Quan #define BTCGB0_Vdroop_Enable_SHIFT 0 841*837d542aSEvan Quan #define BTCGB1_Vdroop_Enable_SHIFT 1 842*837d542aSEvan Quan #define AVFSGB0_Vdroop_Enable_SHIFT 2 843*837d542aSEvan Quan #define AVFSGB1_Vdroop_Enable_SHIFT 3 844*837d542aSEvan Quan 845*837d542aSEvan Quan 846*837d542aSEvan Quan #pragma pack(pop) 847*837d542aSEvan Quan 848*837d542aSEvan Quan 849*837d542aSEvan Quan #endif 850*837d542aSEvan Quan 851