162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright 2011 Advanced Micro Devices, Inc. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 562306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 662306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation 762306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 862306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 962306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 1062306a36Sopenharmony_ci * 1162306a36Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 1262306a36Sopenharmony_ci * all copies or substantial portions of the Software. 1362306a36Sopenharmony_ci * 1462306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1562306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1662306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1762306a36Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 1862306a36Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1962306a36Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2062306a36Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 2162306a36Sopenharmony_ci * 2262306a36Sopenharmony_ci */ 2362306a36Sopenharmony_ci#ifndef PP_SMC_H 2462306a36Sopenharmony_ci#define PP_SMC_H 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci#pragma pack(push, 1) 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci#define PPSMC_SWSTATE_FLAG_DC 0x01 2962306a36Sopenharmony_ci#define PPSMC_SWSTATE_FLAG_UVD 0x02 3062306a36Sopenharmony_ci#define PPSMC_SWSTATE_FLAG_VCE 0x04 3162306a36Sopenharmony_ci#define PPSMC_SWSTATE_FLAG_PCIE_X1 0x08 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci#define PPSMC_THERMAL_PROTECT_TYPE_INTERNAL 0x00 3462306a36Sopenharmony_ci#define PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL 0x01 3562306a36Sopenharmony_ci#define PPSMC_THERMAL_PROTECT_TYPE_NONE 0xff 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci#define PPSMC_SYSTEMFLAG_GPIO_DC 0x01 3862306a36Sopenharmony_ci#define PPSMC_SYSTEMFLAG_STEPVDDC 0x02 3962306a36Sopenharmony_ci#define PPSMC_SYSTEMFLAG_GDDR5 0x04 4062306a36Sopenharmony_ci#define PPSMC_SYSTEMFLAG_DISABLE_BABYSTEP 0x08 4162306a36Sopenharmony_ci#define PPSMC_SYSTEMFLAG_REGULATOR_HOT 0x10 4262306a36Sopenharmony_ci#define PPSMC_SYSTEMFLAG_REGULATOR_HOT_ANALOG 0x20 4362306a36Sopenharmony_ci#define PPSMC_SYSTEMFLAG_REGULATOR_HOT_PROG_GPIO 0x40 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_ACTION_MASK 0x07 4662306a36Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK 0x08 4762306a36Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTODPMLOWSTATE 0x00 4862306a36Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE 0x01 4962306a36Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_GPIO5_POLARITY_HIGH 0x02 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ci#define PPSMC_DISPLAY_WATERMARK_LOW 0 5262306a36Sopenharmony_ci#define PPSMC_DISPLAY_WATERMARK_HIGH 1 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci#define PPSMC_STATEFLAG_AUTO_PULSE_SKIP 0x01 5562306a36Sopenharmony_ci#define PPSMC_STATEFLAG_POWERBOOST 0x02 5662306a36Sopenharmony_ci#define PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE 0x20 5762306a36Sopenharmony_ci#define PPSMC_STATEFLAG_DEEPSLEEP_BYPASS 0x40 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ci#define FDO_MODE_HARDWARE 0 6062306a36Sopenharmony_ci#define FDO_MODE_PIECE_WISE_LINEAR 1 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_cienum FAN_CONTROL { 6362306a36Sopenharmony_ci FAN_CONTROL_FUZZY, 6462306a36Sopenharmony_ci FAN_CONTROL_TABLE 6562306a36Sopenharmony_ci}; 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci#define PPSMC_Result_OK ((uint8_t)0x01) 6862306a36Sopenharmony_ci#define PPSMC_Result_Failed ((uint8_t)0xFF) 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_citypedef uint8_t PPSMC_Result; 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ci#define PPSMC_MSG_Halt ((uint8_t)0x10) 7362306a36Sopenharmony_ci#define PPSMC_MSG_Resume ((uint8_t)0x11) 7462306a36Sopenharmony_ci#define PPSMC_MSG_ZeroLevelsDisabled ((uint8_t)0x13) 7562306a36Sopenharmony_ci#define PPSMC_MSG_OneLevelsDisabled ((uint8_t)0x14) 7662306a36Sopenharmony_ci#define PPSMC_MSG_TwoLevelsDisabled ((uint8_t)0x15) 7762306a36Sopenharmony_ci#define PPSMC_MSG_EnableThermalInterrupt ((uint8_t)0x16) 7862306a36Sopenharmony_ci#define PPSMC_MSG_RunningOnAC ((uint8_t)0x17) 7962306a36Sopenharmony_ci#define PPSMC_MSG_SwitchToSwState ((uint8_t)0x20) 8062306a36Sopenharmony_ci#define PPSMC_MSG_SwitchToInitialState ((uint8_t)0x40) 8162306a36Sopenharmony_ci#define PPSMC_MSG_NoForcedLevel ((uint8_t)0x41) 8262306a36Sopenharmony_ci#define PPSMC_MSG_ForceHigh ((uint8_t)0x42) 8362306a36Sopenharmony_ci#define PPSMC_MSG_ForceMediumOrHigh ((uint8_t)0x43) 8462306a36Sopenharmony_ci#define PPSMC_MSG_SwitchToMinimumPower ((uint8_t)0x51) 8562306a36Sopenharmony_ci#define PPSMC_MSG_ResumeFromMinimumPower ((uint8_t)0x52) 8662306a36Sopenharmony_ci#define PPSMC_MSG_EnableCac ((uint8_t)0x53) 8762306a36Sopenharmony_ci#define PPSMC_MSG_DisableCac ((uint8_t)0x54) 8862306a36Sopenharmony_ci#define PPSMC_TDPClampingActive ((uint8_t)0x59) 8962306a36Sopenharmony_ci#define PPSMC_TDPClampingInactive ((uint8_t)0x5A) 9062306a36Sopenharmony_ci#define PPSMC_StartFanControl ((uint8_t)0x5B) 9162306a36Sopenharmony_ci#define PPSMC_StopFanControl ((uint8_t)0x5C) 9262306a36Sopenharmony_ci#define PPSMC_MSG_NoDisplay ((uint8_t)0x5D) 9362306a36Sopenharmony_ci#define PPSMC_MSG_HasDisplay ((uint8_t)0x5E) 9462306a36Sopenharmony_ci#define PPSMC_MSG_UVDPowerOFF ((uint8_t)0x60) 9562306a36Sopenharmony_ci#define PPSMC_MSG_UVDPowerON ((uint8_t)0x61) 9662306a36Sopenharmony_ci#define PPSMC_MSG_EnableULV ((uint8_t)0x62) 9762306a36Sopenharmony_ci#define PPSMC_MSG_DisableULV ((uint8_t)0x63) 9862306a36Sopenharmony_ci#define PPSMC_MSG_EnterULV ((uint8_t)0x64) 9962306a36Sopenharmony_ci#define PPSMC_MSG_ExitULV ((uint8_t)0x65) 10062306a36Sopenharmony_ci#define PPSMC_CACLongTermAvgEnable ((uint8_t)0x6E) 10162306a36Sopenharmony_ci#define PPSMC_CACLongTermAvgDisable ((uint8_t)0x6F) 10262306a36Sopenharmony_ci#define PPSMC_MSG_CollectCAC_PowerCorreln ((uint8_t)0x7A) 10362306a36Sopenharmony_ci#define PPSMC_FlushDataCache ((uint8_t)0x80) 10462306a36Sopenharmony_ci#define PPSMC_MSG_SetEnabledLevels ((uint8_t)0x82) 10562306a36Sopenharmony_ci#define PPSMC_MSG_SetForcedLevels ((uint8_t)0x83) 10662306a36Sopenharmony_ci#define PPSMC_MSG_ResetToDefaults ((uint8_t)0x84) 10762306a36Sopenharmony_ci#define PPSMC_MSG_EnableDTE ((uint8_t)0x87) 10862306a36Sopenharmony_ci#define PPSMC_MSG_DisableDTE ((uint8_t)0x88) 10962306a36Sopenharmony_ci#define PPSMC_MSG_ThrottleOVRDSCLKDS ((uint8_t)0x96) 11062306a36Sopenharmony_ci#define PPSMC_MSG_CancelThrottleOVRDSCLKDS ((uint8_t)0x97) 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci/* CI/KV/KB */ 11362306a36Sopenharmony_ci#define PPSMC_MSG_UVDDPM_SetEnabledMask ((uint16_t) 0x12D) 11462306a36Sopenharmony_ci#define PPSMC_MSG_VCEDPM_SetEnabledMask ((uint16_t) 0x12E) 11562306a36Sopenharmony_ci#define PPSMC_MSG_ACPDPM_SetEnabledMask ((uint16_t) 0x12F) 11662306a36Sopenharmony_ci#define PPSMC_MSG_SAMUDPM_SetEnabledMask ((uint16_t) 0x130) 11762306a36Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_ForceState ((uint16_t) 0x131) 11862306a36Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_NoForcedLevel ((uint16_t) 0x132) 11962306a36Sopenharmony_ci#define PPSMC_MSG_Thermal_Cntl_Disable ((uint16_t) 0x133) 12062306a36Sopenharmony_ci#define PPSMC_MSG_Voltage_Cntl_Disable ((uint16_t) 0x135) 12162306a36Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_Enable ((uint16_t) 0x136) 12262306a36Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_Disable ((uint16_t) 0x13d) 12362306a36Sopenharmony_ci#define PPSMC_MSG_ACPPowerOFF ((uint16_t) 0x137) 12462306a36Sopenharmony_ci#define PPSMC_MSG_ACPPowerON ((uint16_t) 0x138) 12562306a36Sopenharmony_ci#define PPSMC_MSG_SAMPowerOFF ((uint16_t) 0x139) 12662306a36Sopenharmony_ci#define PPSMC_MSG_SAMPowerON ((uint16_t) 0x13a) 12762306a36Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_Disable ((uint16_t) 0x13d) 12862306a36Sopenharmony_ci#define PPSMC_MSG_NBDPM_Enable ((uint16_t) 0x140) 12962306a36Sopenharmony_ci#define PPSMC_MSG_NBDPM_Disable ((uint16_t) 0x141) 13062306a36Sopenharmony_ci#define PPSMC_MSG_SCLKDPM_SetEnabledMask ((uint16_t) 0x145) 13162306a36Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_SetEnabledMask ((uint16_t) 0x146) 13262306a36Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_ForceLevel ((uint16_t) 0x147) 13362306a36Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_UnForceLevel ((uint16_t) 0x148) 13462306a36Sopenharmony_ci#define PPSMC_MSG_EnableVRHotGPIOInterrupt ((uint16_t) 0x14a) 13562306a36Sopenharmony_ci#define PPSMC_MSG_DPM_Enable ((uint16_t) 0x14e) 13662306a36Sopenharmony_ci#define PPSMC_MSG_DPM_Disable ((uint16_t) 0x14f) 13762306a36Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_Enable ((uint16_t) 0x150) 13862306a36Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_Disable ((uint16_t) 0x151) 13962306a36Sopenharmony_ci#define PPSMC_MSG_UVDDPM_Enable ((uint16_t) 0x154) 14062306a36Sopenharmony_ci#define PPSMC_MSG_UVDDPM_Disable ((uint16_t) 0x155) 14162306a36Sopenharmony_ci#define PPSMC_MSG_SAMUDPM_Enable ((uint16_t) 0x156) 14262306a36Sopenharmony_ci#define PPSMC_MSG_SAMUDPM_Disable ((uint16_t) 0x157) 14362306a36Sopenharmony_ci#define PPSMC_MSG_ACPDPM_Enable ((uint16_t) 0x158) 14462306a36Sopenharmony_ci#define PPSMC_MSG_ACPDPM_Disable ((uint16_t) 0x159) 14562306a36Sopenharmony_ci#define PPSMC_MSG_VCEDPM_Enable ((uint16_t) 0x15a) 14662306a36Sopenharmony_ci#define PPSMC_MSG_VCEDPM_Disable ((uint16_t) 0x15b) 14762306a36Sopenharmony_ci#define PPSMC_MSG_VddC_Request ((uint16_t) 0x15f) 14862306a36Sopenharmony_ci#define PPSMC_MSG_SCLKDPM_GetEnabledMask ((uint16_t) 0x162) 14962306a36Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_SetEnabledMask ((uint16_t) 0x167) 15062306a36Sopenharmony_ci#define PPSMC_MSG_TDCLimitEnable ((uint16_t) 0x169) 15162306a36Sopenharmony_ci#define PPSMC_MSG_TDCLimitDisable ((uint16_t) 0x16a) 15262306a36Sopenharmony_ci#define PPSMC_MSG_PkgPwrLimitEnable ((uint16_t) 0x185) 15362306a36Sopenharmony_ci#define PPSMC_MSG_PkgPwrLimitDisable ((uint16_t) 0x186) 15462306a36Sopenharmony_ci#define PPSMC_MSG_PkgPwrSetLimit ((uint16_t) 0x187) 15562306a36Sopenharmony_ci#define PPSMC_MSG_OverDriveSetTargetTdp ((uint16_t) 0x188) 15662306a36Sopenharmony_ci#define PPSMC_MSG_SCLKDPM_FreezeLevel ((uint16_t) 0x189) 15762306a36Sopenharmony_ci#define PPSMC_MSG_SCLKDPM_UnfreezeLevel ((uint16_t) 0x18A) 15862306a36Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_FreezeLevel ((uint16_t) 0x18B) 15962306a36Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_UnfreezeLevel ((uint16_t) 0x18C) 16062306a36Sopenharmony_ci#define PPSMC_MSG_MASTER_DeepSleep_ON ((uint16_t) 0x18F) 16162306a36Sopenharmony_ci#define PPSMC_MSG_MASTER_DeepSleep_OFF ((uint16_t) 0x190) 16262306a36Sopenharmony_ci#define PPSMC_MSG_Remove_DC_Clamp ((uint16_t) 0x191) 16362306a36Sopenharmony_ci#define PPSMC_MSG_SetFanPwmMax ((uint16_t) 0x19A) 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ci#define PPSMC_MSG_ENABLE_THERMAL_DPM ((uint16_t) 0x19C) 16662306a36Sopenharmony_ci#define PPSMC_MSG_DISABLE_THERMAL_DPM ((uint16_t) 0x19D) 16762306a36Sopenharmony_ci 16862306a36Sopenharmony_ci#define PPSMC_MSG_API_GetSclkFrequency ((uint16_t) 0x200) 16962306a36Sopenharmony_ci#define PPSMC_MSG_API_GetMclkFrequency ((uint16_t) 0x201) 17062306a36Sopenharmony_ci 17162306a36Sopenharmony_ci/* TN */ 17262306a36Sopenharmony_ci#define PPSMC_MSG_DPM_Config ((uint32_t) 0x102) 17362306a36Sopenharmony_ci#define PPSMC_MSG_DPM_ForceState ((uint32_t) 0x104) 17462306a36Sopenharmony_ci#define PPSMC_MSG_PG_SIMD_Config ((uint32_t) 0x108) 17562306a36Sopenharmony_ci#define PPSMC_MSG_Thermal_Cntl_Enable ((uint32_t) 0x10a) 17662306a36Sopenharmony_ci#define PPSMC_MSG_Voltage_Cntl_Enable ((uint32_t) 0x109) 17762306a36Sopenharmony_ci#define PPSMC_MSG_VCEPowerOFF ((uint32_t) 0x10e) 17862306a36Sopenharmony_ci#define PPSMC_MSG_VCEPowerON ((uint32_t) 0x10f) 17962306a36Sopenharmony_ci#define PPSMC_MSG_DPM_N_LevelsDisabled ((uint32_t) 0x112) 18062306a36Sopenharmony_ci#define PPSMC_MSG_DCE_RemoveVoltageAdjustment ((uint32_t) 0x11d) 18162306a36Sopenharmony_ci#define PPSMC_MSG_DCE_AllowVoltageAdjustment ((uint32_t) 0x11e) 18262306a36Sopenharmony_ci#define PPSMC_MSG_EnableBAPM ((uint32_t) 0x120) 18362306a36Sopenharmony_ci#define PPSMC_MSG_DisableBAPM ((uint32_t) 0x121) 18462306a36Sopenharmony_ci#define PPSMC_MSG_UVD_DPM_Config ((uint32_t) 0x124) 18562306a36Sopenharmony_ci 18662306a36Sopenharmony_ci 18762306a36Sopenharmony_citypedef uint16_t PPSMC_Msg; 18862306a36Sopenharmony_ci 18962306a36Sopenharmony_ci#pragma pack(pop) 19062306a36Sopenharmony_ci 19162306a36Sopenharmony_ci#endif 192