fiji_ppsmc.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /*
  2. * Copyright 2014 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. */
  23. #ifndef FIJI_PP_SMC_H
  24. #define FIJI_PP_SMC_H
  25. #pragma pack(push, 1)
  26. #define PPSMC_SWSTATE_FLAG_DC 0x01
  27. #define PPSMC_SWSTATE_FLAG_UVD 0x02
  28. #define PPSMC_SWSTATE_FLAG_VCE 0x04
  29. #define PPSMC_THERMAL_PROTECT_TYPE_INTERNAL 0x00
  30. #define PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL 0x01
  31. #define PPSMC_THERMAL_PROTECT_TYPE_NONE 0xff
  32. #define PPSMC_SYSTEMFLAG_GPIO_DC 0x01
  33. #define PPSMC_SYSTEMFLAG_STEPVDDC 0x02
  34. #define PPSMC_SYSTEMFLAG_GDDR5 0x04
  35. #define PPSMC_SYSTEMFLAG_DISABLE_BABYSTEP 0x08
  36. #define PPSMC_SYSTEMFLAG_REGULATOR_HOT 0x10
  37. #define PPSMC_SYSTEMFLAG_REGULATOR_HOT_ANALOG 0x20
  38. #define PPSMC_EXTRAFLAGS_AC2DC_ACTION_MASK 0x07
  39. #define PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK 0x08
  40. #define PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTODPMLOWSTATE 0x00
  41. #define PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE 0x01
  42. #define PPSMC_DPM2FLAGS_TDPCLMP 0x01
  43. #define PPSMC_DPM2FLAGS_PWRSHFT 0x02
  44. #define PPSMC_DPM2FLAGS_OCP 0x04
  45. #define PPSMC_DISPLAY_WATERMARK_LOW 0
  46. #define PPSMC_DISPLAY_WATERMARK_HIGH 1
  47. #define PPSMC_STATEFLAG_AUTO_PULSE_SKIP 0x01
  48. #define PPSMC_STATEFLAG_POWERBOOST 0x02
  49. #define PPSMC_STATEFLAG_PSKIP_ON_TDP_FAULT 0x04
  50. #define PPSMC_STATEFLAG_POWERSHIFT 0x08
  51. #define PPSMC_STATEFLAG_SLOW_READ_MARGIN 0x10
  52. #define PPSMC_STATEFLAG_DEEPSLEEP_THROTTLE 0x20
  53. #define PPSMC_STATEFLAG_DEEPSLEEP_BYPASS 0x40
  54. #define FDO_MODE_HARDWARE 0
  55. #define FDO_MODE_PIECE_WISE_LINEAR 1
  56. enum FAN_CONTROL {
  57. FAN_CONTROL_FUZZY,
  58. FAN_CONTROL_TABLE
  59. };
  60. //Gemini Modes
  61. #define PPSMC_GeminiModeNone 0 //Single GPU board
  62. #define PPSMC_GeminiModeMaster 1 //Master GPU on a Gemini board
  63. #define PPSMC_GeminiModeSlave 2 //Slave GPU on a Gemini board
  64. #define PPSMC_Result_OK ((uint16_t)0x01)
  65. #define PPSMC_Result_NoMore ((uint16_t)0x02)
  66. #define PPSMC_Result_NotNow ((uint16_t)0x03)
  67. #define PPSMC_Result_Failed ((uint16_t)0xFF)
  68. #define PPSMC_Result_UnknownCmd ((uint16_t)0xFE)
  69. #define PPSMC_Result_UnknownVT ((uint16_t)0xFD)
  70. typedef uint16_t PPSMC_Result;
  71. #define PPSMC_isERROR(x) ((uint16_t)0x80 & (x))
  72. #define PPSMC_MSG_Halt ((uint16_t)0x10)
  73. #define PPSMC_MSG_Resume ((uint16_t)0x11)
  74. #define PPSMC_MSG_EnableDPMLevel ((uint16_t)0x12)
  75. #define PPSMC_MSG_ZeroLevelsDisabled ((uint16_t)0x13)
  76. #define PPSMC_MSG_OneLevelsDisabled ((uint16_t)0x14)
  77. #define PPSMC_MSG_TwoLevelsDisabled ((uint16_t)0x15)
  78. #define PPSMC_MSG_EnableThermalInterrupt ((uint16_t)0x16)
  79. #define PPSMC_MSG_RunningOnAC ((uint16_t)0x17)
  80. #define PPSMC_MSG_LevelUp ((uint16_t)0x18)
  81. #define PPSMC_MSG_LevelDown ((uint16_t)0x19)
  82. #define PPSMC_MSG_ResetDPMCounters ((uint16_t)0x1a)
  83. #define PPSMC_MSG_SwitchToSwState ((uint16_t)0x20)
  84. #define PPSMC_MSG_SwitchToSwStateLast ((uint16_t)0x3f)
  85. #define PPSMC_MSG_SwitchToInitialState ((uint16_t)0x40)
  86. #define PPSMC_MSG_NoForcedLevel ((uint16_t)0x41)
  87. #define PPSMC_MSG_ForceHigh ((uint16_t)0x42)
  88. #define PPSMC_MSG_ForceMediumOrHigh ((uint16_t)0x43)
  89. #define PPSMC_MSG_SwitchToMinimumPower ((uint16_t)0x51)
  90. #define PPSMC_MSG_ResumeFromMinimumPower ((uint16_t)0x52)
  91. #define PPSMC_MSG_EnableCac ((uint16_t)0x53)
  92. #define PPSMC_MSG_DisableCac ((uint16_t)0x54)
  93. #define PPSMC_DPMStateHistoryStart ((uint16_t)0x55)
  94. #define PPSMC_DPMStateHistoryStop ((uint16_t)0x56)
  95. #define PPSMC_CACHistoryStart ((uint16_t)0x57)
  96. #define PPSMC_CACHistoryStop ((uint16_t)0x58)
  97. #define PPSMC_TDPClampingActive ((uint16_t)0x59)
  98. #define PPSMC_TDPClampingInactive ((uint16_t)0x5A)
  99. #define PPSMC_StartFanControl ((uint16_t)0x5B)
  100. #define PPSMC_StopFanControl ((uint16_t)0x5C)
  101. #define PPSMC_NoDisplay ((uint16_t)0x5D)
  102. #define PPSMC_HasDisplay ((uint16_t)0x5E)
  103. #define PPSMC_MSG_UVDPowerOFF ((uint16_t)0x60)
  104. #define PPSMC_MSG_UVDPowerON ((uint16_t)0x61)
  105. #define PPSMC_MSG_EnableULV ((uint16_t)0x62)
  106. #define PPSMC_MSG_DisableULV ((uint16_t)0x63)
  107. #define PPSMC_MSG_EnterULV ((uint16_t)0x64)
  108. #define PPSMC_MSG_ExitULV ((uint16_t)0x65)
  109. #define PPSMC_PowerShiftActive ((uint16_t)0x6A)
  110. #define PPSMC_PowerShiftInactive ((uint16_t)0x6B)
  111. #define PPSMC_OCPActive ((uint16_t)0x6C)
  112. #define PPSMC_OCPInactive ((uint16_t)0x6D)
  113. #define PPSMC_CACLongTermAvgEnable ((uint16_t)0x6E)
  114. #define PPSMC_CACLongTermAvgDisable ((uint16_t)0x6F)
  115. #define PPSMC_MSG_InferredStateSweep_Start ((uint16_t)0x70)
  116. #define PPSMC_MSG_InferredStateSweep_Stop ((uint16_t)0x71)
  117. #define PPSMC_MSG_SwitchToLowestInfState ((uint16_t)0x72)
  118. #define PPSMC_MSG_SwitchToNonInfState ((uint16_t)0x73)
  119. #define PPSMC_MSG_AllStateSweep_Start ((uint16_t)0x74)
  120. #define PPSMC_MSG_AllStateSweep_Stop ((uint16_t)0x75)
  121. #define PPSMC_MSG_SwitchNextLowerInfState ((uint16_t)0x76)
  122. #define PPSMC_MSG_SwitchNextHigherInfState ((uint16_t)0x77)
  123. #define PPSMC_MSG_MclkRetrainingTest ((uint16_t)0x78)
  124. #define PPSMC_MSG_ForceTDPClamping ((uint16_t)0x79)
  125. #define PPSMC_MSG_CollectCAC_PowerCorreln ((uint16_t)0x7A)
  126. #define PPSMC_MSG_CollectCAC_WeightCalib ((uint16_t)0x7B)
  127. #define PPSMC_MSG_CollectCAC_SQonly ((uint16_t)0x7C)
  128. #define PPSMC_MSG_CollectCAC_TemperaturePwr ((uint16_t)0x7D)
  129. #define PPSMC_MSG_ExtremitiesTest_Start ((uint16_t)0x7E)
  130. #define PPSMC_MSG_ExtremitiesTest_Stop ((uint16_t)0x7F)
  131. #define PPSMC_FlushDataCache ((uint16_t)0x80)
  132. #define PPSMC_FlushInstrCache ((uint16_t)0x81)
  133. #define PPSMC_MSG_SetEnabledLevels ((uint16_t)0x82)
  134. #define PPSMC_MSG_SetForcedLevels ((uint16_t)0x83)
  135. #define PPSMC_MSG_ResetToDefaults ((uint16_t)0x84)
  136. #define PPSMC_MSG_SetForcedLevelsAndJump ((uint16_t)0x85)
  137. #define PPSMC_MSG_SetCACHistoryMode ((uint16_t)0x86)
  138. #define PPSMC_MSG_EnableDTE ((uint16_t)0x87)
  139. #define PPSMC_MSG_DisableDTE ((uint16_t)0x88)
  140. #define PPSMC_MSG_SmcSpaceSetAddress ((uint16_t)0x89)
  141. #define PPSMC_MSG_SmcSpaceWriteDWordInc ((uint16_t)0x8A)
  142. #define PPSMC_MSG_SmcSpaceWriteWordInc ((uint16_t)0x8B)
  143. #define PPSMC_MSG_SmcSpaceWriteByteInc ((uint16_t)0x8C)
  144. #define PPSMC_MSG_BREAK ((uint16_t)0xF8)
  145. #define PPSMC_MSG_Test ((uint16_t)0x100)
  146. #define PPSMC_MSG_DRV_DRAM_ADDR_HI ((uint16_t)0x250)
  147. #define PPSMC_MSG_DRV_DRAM_ADDR_LO ((uint16_t)0x251)
  148. #define PPSMC_MSG_SMU_DRAM_ADDR_HI ((uint16_t)0x252)
  149. #define PPSMC_MSG_SMU_DRAM_ADDR_LO ((uint16_t)0x253)
  150. #define PPSMC_MSG_LoadUcodes ((uint16_t)0x254)
  151. typedef uint16_t PPSMC_Msg;
  152. #define PPSMC_EVENT_STATUS_THERMAL 0x00000001
  153. #define PPSMC_EVENT_STATUS_REGULATORHOT 0x00000002
  154. #define PPSMC_EVENT_STATUS_DC 0x00000004
  155. #define PPSMC_EVENT_STATUS_GPIO17 0x00000008
  156. #pragma pack(pop)
  157. #endif