18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright 2011 Advanced Micro Devices, Inc. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 58c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 68c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation 78c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 88c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 98c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 108c2ecf20Sopenharmony_ci * 118c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 128c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software. 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 158c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 168c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 178c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 188c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 198c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 208c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 218c2ecf20Sopenharmony_ci * 228c2ecf20Sopenharmony_ci */ 238c2ecf20Sopenharmony_ci#ifndef PP_SMC_H 248c2ecf20Sopenharmony_ci#define PP_SMC_H 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci#pragma pack(push, 1) 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci#define PPSMC_SWSTATE_FLAG_DC 0x01 298c2ecf20Sopenharmony_ci#define PPSMC_SWSTATE_FLAG_UVD 0x02 308c2ecf20Sopenharmony_ci#define PPSMC_SWSTATE_FLAG_VCE 0x04 318c2ecf20Sopenharmony_ci#define PPSMC_SWSTATE_FLAG_PCIE_X1 0x08 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define PPSMC_THERMAL_PROTECT_TYPE_INTERNAL 0x00 348c2ecf20Sopenharmony_ci#define PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL 0x01 358c2ecf20Sopenharmony_ci#define PPSMC_THERMAL_PROTECT_TYPE_NONE 0xff 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci#define PPSMC_SYSTEMFLAG_GPIO_DC 0x01 388c2ecf20Sopenharmony_ci#define PPSMC_SYSTEMFLAG_STEPVDDC 0x02 398c2ecf20Sopenharmony_ci#define PPSMC_SYSTEMFLAG_GDDR5 0x04 408c2ecf20Sopenharmony_ci#define PPSMC_SYSTEMFLAG_DISABLE_BABYSTEP 0x08 418c2ecf20Sopenharmony_ci#define PPSMC_SYSTEMFLAG_REGULATOR_HOT 0x10 428c2ecf20Sopenharmony_ci#define PPSMC_SYSTEMFLAG_REGULATOR_HOT_ANALOG 0x20 438c2ecf20Sopenharmony_ci#define PPSMC_SYSTEMFLAG_REGULATOR_HOT_PROG_GPIO 0x40 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_ACTION_MASK 0x07 468c2ecf20Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK 0x08 478c2ecf20Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTODPMLOWSTATE 0x00 488c2ecf20Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE 0x01 498c2ecf20Sopenharmony_ci#define PPSMC_EXTRAFLAGS_AC2DC_GPIO5_POLARITY_HIGH 0x02 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci#define PPSMC_DISPLAY_WATERMARK_LOW 0 528c2ecf20Sopenharmony_ci#define PPSMC_DISPLAY_WATERMARK_HIGH 1 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci#define PPSMC_STATEFLAG_AUTO_PULSE_SKIP 0x01 558c2ecf20Sopenharmony_ci#define PPSMC_STATEFLAG_POWERBOOST 0x02 568c2ecf20Sopenharmony_ci#define PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE 0x20 578c2ecf20Sopenharmony_ci#define PPSMC_STATEFLAG_DEEPSLEEP_BYPASS 0x40 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci#define FDO_MODE_HARDWARE 0 608c2ecf20Sopenharmony_ci#define FDO_MODE_PIECE_WISE_LINEAR 1 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_cienum FAN_CONTROL { 638c2ecf20Sopenharmony_ci FAN_CONTROL_FUZZY, 648c2ecf20Sopenharmony_ci FAN_CONTROL_TABLE 658c2ecf20Sopenharmony_ci}; 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#define PPSMC_Result_OK ((uint8_t)0x01) 688c2ecf20Sopenharmony_ci#define PPSMC_Result_Failed ((uint8_t)0xFF) 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_citypedef uint8_t PPSMC_Result; 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci#define PPSMC_MSG_Halt ((uint8_t)0x10) 738c2ecf20Sopenharmony_ci#define PPSMC_MSG_Resume ((uint8_t)0x11) 748c2ecf20Sopenharmony_ci#define PPSMC_MSG_ZeroLevelsDisabled ((uint8_t)0x13) 758c2ecf20Sopenharmony_ci#define PPSMC_MSG_OneLevelsDisabled ((uint8_t)0x14) 768c2ecf20Sopenharmony_ci#define PPSMC_MSG_TwoLevelsDisabled ((uint8_t)0x15) 778c2ecf20Sopenharmony_ci#define PPSMC_MSG_EnableThermalInterrupt ((uint8_t)0x16) 788c2ecf20Sopenharmony_ci#define PPSMC_MSG_RunningOnAC ((uint8_t)0x17) 798c2ecf20Sopenharmony_ci#define PPSMC_MSG_SwitchToSwState ((uint8_t)0x20) 808c2ecf20Sopenharmony_ci#define PPSMC_MSG_SwitchToInitialState ((uint8_t)0x40) 818c2ecf20Sopenharmony_ci#define PPSMC_MSG_NoForcedLevel ((uint8_t)0x41) 828c2ecf20Sopenharmony_ci#define PPSMC_MSG_ForceHigh ((uint8_t)0x42) 838c2ecf20Sopenharmony_ci#define PPSMC_MSG_ForceMediumOrHigh ((uint8_t)0x43) 848c2ecf20Sopenharmony_ci#define PPSMC_MSG_SwitchToMinimumPower ((uint8_t)0x51) 858c2ecf20Sopenharmony_ci#define PPSMC_MSG_ResumeFromMinimumPower ((uint8_t)0x52) 868c2ecf20Sopenharmony_ci#define PPSMC_MSG_EnableCac ((uint8_t)0x53) 878c2ecf20Sopenharmony_ci#define PPSMC_MSG_DisableCac ((uint8_t)0x54) 888c2ecf20Sopenharmony_ci#define PPSMC_TDPClampingActive ((uint8_t)0x59) 898c2ecf20Sopenharmony_ci#define PPSMC_TDPClampingInactive ((uint8_t)0x5A) 908c2ecf20Sopenharmony_ci#define PPSMC_StartFanControl ((uint8_t)0x5B) 918c2ecf20Sopenharmony_ci#define PPSMC_StopFanControl ((uint8_t)0x5C) 928c2ecf20Sopenharmony_ci#define PPSMC_MSG_NoDisplay ((uint8_t)0x5D) 938c2ecf20Sopenharmony_ci#define PPSMC_NoDisplay ((uint8_t)0x5D) 948c2ecf20Sopenharmony_ci#define PPSMC_MSG_HasDisplay ((uint8_t)0x5E) 958c2ecf20Sopenharmony_ci#define PPSMC_HasDisplay ((uint8_t)0x5E) 968c2ecf20Sopenharmony_ci#define PPSMC_MSG_UVDPowerOFF ((uint8_t)0x60) 978c2ecf20Sopenharmony_ci#define PPSMC_MSG_UVDPowerON ((uint8_t)0x61) 988c2ecf20Sopenharmony_ci#define PPSMC_MSG_EnableULV ((uint8_t)0x62) 998c2ecf20Sopenharmony_ci#define PPSMC_MSG_DisableULV ((uint8_t)0x63) 1008c2ecf20Sopenharmony_ci#define PPSMC_MSG_EnterULV ((uint8_t)0x64) 1018c2ecf20Sopenharmony_ci#define PPSMC_MSG_ExitULV ((uint8_t)0x65) 1028c2ecf20Sopenharmony_ci#define PPSMC_CACLongTermAvgEnable ((uint8_t)0x6E) 1038c2ecf20Sopenharmony_ci#define PPSMC_CACLongTermAvgDisable ((uint8_t)0x6F) 1048c2ecf20Sopenharmony_ci#define PPSMC_MSG_CollectCAC_PowerCorreln ((uint8_t)0x7A) 1058c2ecf20Sopenharmony_ci#define PPSMC_FlushDataCache ((uint8_t)0x80) 1068c2ecf20Sopenharmony_ci#define PPSMC_MSG_SetEnabledLevels ((uint8_t)0x82) 1078c2ecf20Sopenharmony_ci#define PPSMC_MSG_SetForcedLevels ((uint8_t)0x83) 1088c2ecf20Sopenharmony_ci#define PPSMC_MSG_ResetToDefaults ((uint8_t)0x84) 1098c2ecf20Sopenharmony_ci#define PPSMC_MSG_EnableDTE ((uint8_t)0x87) 1108c2ecf20Sopenharmony_ci#define PPSMC_MSG_DisableDTE ((uint8_t)0x88) 1118c2ecf20Sopenharmony_ci#define PPSMC_MSG_ThrottleOVRDSCLKDS ((uint8_t)0x96) 1128c2ecf20Sopenharmony_ci#define PPSMC_MSG_CancelThrottleOVRDSCLKDS ((uint8_t)0x97) 1138c2ecf20Sopenharmony_ci#define PPSMC_MSG_EnableACDCGPIOInterrupt ((uint16_t) 0x149) 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ci/* CI/KV/KB */ 1168c2ecf20Sopenharmony_ci#define PPSMC_MSG_UVDDPM_SetEnabledMask ((uint16_t) 0x12D) 1178c2ecf20Sopenharmony_ci#define PPSMC_MSG_VCEDPM_SetEnabledMask ((uint16_t) 0x12E) 1188c2ecf20Sopenharmony_ci#define PPSMC_MSG_ACPDPM_SetEnabledMask ((uint16_t) 0x12F) 1198c2ecf20Sopenharmony_ci#define PPSMC_MSG_SAMUDPM_SetEnabledMask ((uint16_t) 0x130) 1208c2ecf20Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_ForceState ((uint16_t) 0x131) 1218c2ecf20Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_NoForcedLevel ((uint16_t) 0x132) 1228c2ecf20Sopenharmony_ci#define PPSMC_MSG_Thermal_Cntl_Disable ((uint16_t) 0x133) 1238c2ecf20Sopenharmony_ci#define PPSMC_MSG_Voltage_Cntl_Disable ((uint16_t) 0x135) 1248c2ecf20Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_Enable ((uint16_t) 0x136) 1258c2ecf20Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_Disable ((uint16_t) 0x13d) 1268c2ecf20Sopenharmony_ci#define PPSMC_MSG_ACPPowerOFF ((uint16_t) 0x137) 1278c2ecf20Sopenharmony_ci#define PPSMC_MSG_ACPPowerON ((uint16_t) 0x138) 1288c2ecf20Sopenharmony_ci#define PPSMC_MSG_SAMPowerOFF ((uint16_t) 0x139) 1298c2ecf20Sopenharmony_ci#define PPSMC_MSG_SAMPowerON ((uint16_t) 0x13a) 1308c2ecf20Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_Disable ((uint16_t) 0x13d) 1318c2ecf20Sopenharmony_ci#define PPSMC_MSG_NBDPM_Enable ((uint16_t) 0x140) 1328c2ecf20Sopenharmony_ci#define PPSMC_MSG_NBDPM_Disable ((uint16_t) 0x141) 1338c2ecf20Sopenharmony_ci#define PPSMC_MSG_SCLKDPM_SetEnabledMask ((uint16_t) 0x145) 1348c2ecf20Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_SetEnabledMask ((uint16_t) 0x146) 1358c2ecf20Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_ForceLevel ((uint16_t) 0x147) 1368c2ecf20Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_UnForceLevel ((uint16_t) 0x148) 1378c2ecf20Sopenharmony_ci#define PPSMC_MSG_EnableVRHotGPIOInterrupt ((uint16_t) 0x14a) 1388c2ecf20Sopenharmony_ci#define PPSMC_MSG_DPM_Enable ((uint16_t) 0x14e) 1398c2ecf20Sopenharmony_ci#define PPSMC_MSG_DPM_Disable ((uint16_t) 0x14f) 1408c2ecf20Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_Enable ((uint16_t) 0x150) 1418c2ecf20Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_Disable ((uint16_t) 0x151) 1428c2ecf20Sopenharmony_ci#define PPSMC_MSG_UVDDPM_Enable ((uint16_t) 0x154) 1438c2ecf20Sopenharmony_ci#define PPSMC_MSG_UVDDPM_Disable ((uint16_t) 0x155) 1448c2ecf20Sopenharmony_ci#define PPSMC_MSG_SAMUDPM_Enable ((uint16_t) 0x156) 1458c2ecf20Sopenharmony_ci#define PPSMC_MSG_SAMUDPM_Disable ((uint16_t) 0x157) 1468c2ecf20Sopenharmony_ci#define PPSMC_MSG_ACPDPM_Enable ((uint16_t) 0x158) 1478c2ecf20Sopenharmony_ci#define PPSMC_MSG_ACPDPM_Disable ((uint16_t) 0x159) 1488c2ecf20Sopenharmony_ci#define PPSMC_MSG_VCEDPM_Enable ((uint16_t) 0x15a) 1498c2ecf20Sopenharmony_ci#define PPSMC_MSG_VCEDPM_Disable ((uint16_t) 0x15b) 1508c2ecf20Sopenharmony_ci#define PPSMC_MSG_VddC_Request ((uint16_t) 0x15f) 1518c2ecf20Sopenharmony_ci#define PPSMC_MSG_SCLKDPM_GetEnabledMask ((uint16_t) 0x162) 1528c2ecf20Sopenharmony_ci#define PPSMC_MSG_PCIeDPM_SetEnabledMask ((uint16_t) 0x167) 1538c2ecf20Sopenharmony_ci#define PPSMC_MSG_TDCLimitEnable ((uint16_t) 0x169) 1548c2ecf20Sopenharmony_ci#define PPSMC_MSG_TDCLimitDisable ((uint16_t) 0x16a) 1558c2ecf20Sopenharmony_ci#define PPSMC_MSG_PkgPwrLimitEnable ((uint16_t) 0x185) 1568c2ecf20Sopenharmony_ci#define PPSMC_MSG_PkgPwrLimitDisable ((uint16_t) 0x186) 1578c2ecf20Sopenharmony_ci#define PPSMC_MSG_PkgPwrSetLimit ((uint16_t) 0x187) 1588c2ecf20Sopenharmony_ci#define PPSMC_MSG_OverDriveSetTargetTdp ((uint16_t) 0x188) 1598c2ecf20Sopenharmony_ci#define PPSMC_MSG_SCLKDPM_FreezeLevel ((uint16_t) 0x189) 1608c2ecf20Sopenharmony_ci#define PPSMC_MSG_SCLKDPM_UnfreezeLevel ((uint16_t) 0x18A) 1618c2ecf20Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_FreezeLevel ((uint16_t) 0x18B) 1628c2ecf20Sopenharmony_ci#define PPSMC_MSG_MCLKDPM_UnfreezeLevel ((uint16_t) 0x18C) 1638c2ecf20Sopenharmony_ci#define PPSMC_MSG_MASTER_DeepSleep_ON ((uint16_t) 0x18F) 1648c2ecf20Sopenharmony_ci#define PPSMC_MSG_MASTER_DeepSleep_OFF ((uint16_t) 0x190) 1658c2ecf20Sopenharmony_ci#define PPSMC_MSG_Remove_DC_Clamp ((uint16_t) 0x191) 1668c2ecf20Sopenharmony_ci#define PPSMC_MSG_SetFanPwmMax ((uint16_t) 0x19A) 1678c2ecf20Sopenharmony_ci#define PPSMC_MSG_SetFanRpmMax ((uint16_t) 0x205) 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci#define PPSMC_MSG_ENABLE_THERMAL_DPM ((uint16_t) 0x19C) 1708c2ecf20Sopenharmony_ci#define PPSMC_MSG_DISABLE_THERMAL_DPM ((uint16_t) 0x19D) 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_ci#define PPSMC_MSG_API_GetSclkFrequency ((uint16_t) 0x200) 1738c2ecf20Sopenharmony_ci#define PPSMC_MSG_API_GetMclkFrequency ((uint16_t) 0x201) 1748c2ecf20Sopenharmony_ci 1758c2ecf20Sopenharmony_ci/* TN */ 1768c2ecf20Sopenharmony_ci#define PPSMC_MSG_DPM_Config ((uint32_t) 0x102) 1778c2ecf20Sopenharmony_ci#define PPSMC_MSG_DPM_ForceState ((uint32_t) 0x104) 1788c2ecf20Sopenharmony_ci#define PPSMC_MSG_PG_SIMD_Config ((uint32_t) 0x108) 1798c2ecf20Sopenharmony_ci#define PPSMC_MSG_Voltage_Cntl_Enable ((uint32_t) 0x109) 1808c2ecf20Sopenharmony_ci#define PPSMC_MSG_Thermal_Cntl_Enable ((uint32_t) 0x10a) 1818c2ecf20Sopenharmony_ci#define PPSMC_MSG_VCEPowerOFF ((uint32_t) 0x10e) 1828c2ecf20Sopenharmony_ci#define PPSMC_MSG_VCEPowerON ((uint32_t) 0x10f) 1838c2ecf20Sopenharmony_ci#define PPSMC_MSG_DPM_N_LevelsDisabled ((uint32_t) 0x112) 1848c2ecf20Sopenharmony_ci#define PPSMC_MSG_DCE_RemoveVoltageAdjustment ((uint32_t) 0x11d) 1858c2ecf20Sopenharmony_ci#define PPSMC_MSG_DCE_AllowVoltageAdjustment ((uint32_t) 0x11e) 1868c2ecf20Sopenharmony_ci#define PPSMC_MSG_EnableBAPM ((uint32_t) 0x120) 1878c2ecf20Sopenharmony_ci#define PPSMC_MSG_DisableBAPM ((uint32_t) 0x121) 1888c2ecf20Sopenharmony_ci#define PPSMC_MSG_UVD_DPM_Config ((uint32_t) 0x124) 1898c2ecf20Sopenharmony_ci 1908c2ecf20Sopenharmony_ci#define PPSMC_MSG_DRV_DRAM_ADDR_HI ((uint16_t) 0x250) 1918c2ecf20Sopenharmony_ci#define PPSMC_MSG_DRV_DRAM_ADDR_LO ((uint16_t) 0x251) 1928c2ecf20Sopenharmony_ci#define PPSMC_MSG_SMU_DRAM_ADDR_HI ((uint16_t) 0x252) 1938c2ecf20Sopenharmony_ci#define PPSMC_MSG_SMU_DRAM_ADDR_LO ((uint16_t) 0x253) 1948c2ecf20Sopenharmony_ci#define PPSMC_MSG_LoadUcodes ((uint16_t) 0x254) 1958c2ecf20Sopenharmony_ci 1968c2ecf20Sopenharmony_citypedef uint16_t PPSMC_Msg; 1978c2ecf20Sopenharmony_ci 1988c2ecf20Sopenharmony_ci#pragma pack(pop) 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci#endif 201