smu7_fusion.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. /*
  2. * Copyright 2013 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 SMU7_FUSION_H
  24. #define SMU7_FUSION_H
  25. #include "smu7.h"
  26. #pragma pack(push, 1)
  27. #define SMU7_DTE_ITERATIONS 5
  28. #define SMU7_DTE_SOURCES 5
  29. #define SMU7_DTE_SINKS 3
  30. #define SMU7_NUM_CPU_TES 2
  31. #define SMU7_NUM_GPU_TES 1
  32. #define SMU7_NUM_NON_TES 2
  33. // All 'soft registers' should be uint32_t.
  34. struct SMU7_SoftRegisters {
  35. uint32_t RefClockFrequency;
  36. uint32_t PmTimerP;
  37. uint32_t FeatureEnables;
  38. uint32_t HandshakeDisables;
  39. uint8_t DisplayPhy1Config;
  40. uint8_t DisplayPhy2Config;
  41. uint8_t DisplayPhy3Config;
  42. uint8_t DisplayPhy4Config;
  43. uint8_t DisplayPhy5Config;
  44. uint8_t DisplayPhy6Config;
  45. uint8_t DisplayPhy7Config;
  46. uint8_t DisplayPhy8Config;
  47. uint32_t AverageGraphicsA;
  48. uint32_t AverageMemoryA;
  49. uint32_t AverageGioA;
  50. uint8_t SClkDpmEnabledLevels;
  51. uint8_t MClkDpmEnabledLevels;
  52. uint8_t LClkDpmEnabledLevels;
  53. uint8_t PCIeDpmEnabledLevels;
  54. uint8_t UVDDpmEnabledLevels;
  55. uint8_t SAMUDpmEnabledLevels;
  56. uint8_t ACPDpmEnabledLevels;
  57. uint8_t VCEDpmEnabledLevels;
  58. uint32_t DRAM_LOG_ADDR_H;
  59. uint32_t DRAM_LOG_ADDR_L;
  60. uint32_t DRAM_LOG_PHY_ADDR_H;
  61. uint32_t DRAM_LOG_PHY_ADDR_L;
  62. uint32_t DRAM_LOG_BUFF_SIZE;
  63. uint32_t UlvEnterC;
  64. uint32_t UlvTime;
  65. uint32_t Reserved[3];
  66. };
  67. typedef struct SMU7_SoftRegisters SMU7_SoftRegisters;
  68. struct SMU7_Fusion_GraphicsLevel {
  69. uint32_t MinVddNb;
  70. uint32_t SclkFrequency;
  71. uint8_t Vid;
  72. uint8_t VidOffset;
  73. uint16_t AT;
  74. uint8_t PowerThrottle;
  75. uint8_t GnbSlow;
  76. uint8_t ForceNbPs1;
  77. uint8_t SclkDid;
  78. uint8_t DisplayWatermark;
  79. uint8_t EnabledForActivity;
  80. uint8_t EnabledForThrottle;
  81. uint8_t UpH;
  82. uint8_t DownH;
  83. uint8_t VoltageDownH;
  84. uint8_t DeepSleepDivId;
  85. uint8_t ClkBypassCntl;
  86. uint32_t reserved;
  87. };
  88. typedef struct SMU7_Fusion_GraphicsLevel SMU7_Fusion_GraphicsLevel;
  89. struct SMU7_Fusion_GIOLevel {
  90. uint8_t EnabledForActivity;
  91. uint8_t LclkDid;
  92. uint8_t Vid;
  93. uint8_t VoltageDownH;
  94. uint32_t MinVddNb;
  95. uint16_t ResidencyCounter;
  96. uint8_t UpH;
  97. uint8_t DownH;
  98. uint32_t LclkFrequency;
  99. uint8_t ActivityLevel;
  100. uint8_t EnabledForThrottle;
  101. uint8_t ClkBypassCntl;
  102. uint8_t padding;
  103. };
  104. typedef struct SMU7_Fusion_GIOLevel SMU7_Fusion_GIOLevel;
  105. // UVD VCLK/DCLK state (level) definition.
  106. struct SMU7_Fusion_UvdLevel {
  107. uint32_t VclkFrequency;
  108. uint32_t DclkFrequency;
  109. uint16_t MinVddNb;
  110. uint8_t VclkDivider;
  111. uint8_t DclkDivider;
  112. uint8_t VClkBypassCntl;
  113. uint8_t DClkBypassCntl;
  114. uint8_t padding[2];
  115. };
  116. typedef struct SMU7_Fusion_UvdLevel SMU7_Fusion_UvdLevel;
  117. // Clocks for other external blocks (VCE, ACP, SAMU).
  118. struct SMU7_Fusion_ExtClkLevel {
  119. uint32_t Frequency;
  120. uint16_t MinVoltage;
  121. uint8_t Divider;
  122. uint8_t ClkBypassCntl;
  123. uint32_t Reserved;
  124. };
  125. typedef struct SMU7_Fusion_ExtClkLevel SMU7_Fusion_ExtClkLevel;
  126. struct SMU7_Fusion_ACPILevel {
  127. uint32_t Flags;
  128. uint32_t MinVddNb;
  129. uint32_t SclkFrequency;
  130. uint8_t SclkDid;
  131. uint8_t GnbSlow;
  132. uint8_t ForceNbPs1;
  133. uint8_t DisplayWatermark;
  134. uint8_t DeepSleepDivId;
  135. uint8_t padding[3];
  136. };
  137. typedef struct SMU7_Fusion_ACPILevel SMU7_Fusion_ACPILevel;
  138. struct SMU7_Fusion_NbDpm {
  139. uint8_t DpmXNbPsHi;
  140. uint8_t DpmXNbPsLo;
  141. uint8_t Dpm0PgNbPsHi;
  142. uint8_t Dpm0PgNbPsLo;
  143. uint8_t EnablePsi1;
  144. uint8_t SkipDPM0;
  145. uint8_t SkipPG;
  146. uint8_t Hysteresis;
  147. uint8_t EnableDpmPstatePoll;
  148. uint8_t padding[3];
  149. };
  150. typedef struct SMU7_Fusion_NbDpm SMU7_Fusion_NbDpm;
  151. struct SMU7_Fusion_StateInfo {
  152. uint32_t SclkFrequency;
  153. uint32_t LclkFrequency;
  154. uint32_t VclkFrequency;
  155. uint32_t DclkFrequency;
  156. uint32_t SamclkFrequency;
  157. uint32_t AclkFrequency;
  158. uint32_t EclkFrequency;
  159. uint8_t DisplayWatermark;
  160. uint8_t McArbIndex;
  161. int8_t SclkIndex;
  162. int8_t MclkIndex;
  163. };
  164. typedef struct SMU7_Fusion_StateInfo SMU7_Fusion_StateInfo;
  165. struct SMU7_Fusion_DpmTable {
  166. uint32_t SystemFlags;
  167. SMU7_PIDController GraphicsPIDController;
  168. SMU7_PIDController GioPIDController;
  169. uint8_t GraphicsDpmLevelCount;
  170. uint8_t GIOLevelCount;
  171. uint8_t UvdLevelCount;
  172. uint8_t VceLevelCount;
  173. uint8_t AcpLevelCount;
  174. uint8_t SamuLevelCount;
  175. uint16_t FpsHighT;
  176. SMU7_Fusion_GraphicsLevel GraphicsLevel[SMU__NUM_SCLK_DPM_STATE];
  177. SMU7_Fusion_ACPILevel ACPILevel;
  178. SMU7_Fusion_UvdLevel UvdLevel[SMU7_MAX_LEVELS_UVD];
  179. SMU7_Fusion_ExtClkLevel VceLevel[SMU7_MAX_LEVELS_VCE];
  180. SMU7_Fusion_ExtClkLevel AcpLevel[SMU7_MAX_LEVELS_ACP];
  181. SMU7_Fusion_ExtClkLevel SamuLevel[SMU7_MAX_LEVELS_SAMU];
  182. uint8_t UvdBootLevel;
  183. uint8_t VceBootLevel;
  184. uint8_t AcpBootLevel;
  185. uint8_t SamuBootLevel;
  186. uint8_t UVDInterval;
  187. uint8_t VCEInterval;
  188. uint8_t ACPInterval;
  189. uint8_t SAMUInterval;
  190. uint8_t GraphicsBootLevel;
  191. uint8_t GraphicsInterval;
  192. uint8_t GraphicsThermThrottleEnable;
  193. uint8_t GraphicsVoltageChangeEnable;
  194. uint8_t GraphicsClkSlowEnable;
  195. uint8_t GraphicsClkSlowDivider;
  196. uint16_t FpsLowT;
  197. uint32_t DisplayCac;
  198. uint32_t LowSclkInterruptT;
  199. uint32_t DRAM_LOG_ADDR_H;
  200. uint32_t DRAM_LOG_ADDR_L;
  201. uint32_t DRAM_LOG_PHY_ADDR_H;
  202. uint32_t DRAM_LOG_PHY_ADDR_L;
  203. uint32_t DRAM_LOG_BUFF_SIZE;
  204. };
  205. struct SMU7_Fusion_GIODpmTable {
  206. SMU7_Fusion_GIOLevel GIOLevel[SMU7_MAX_LEVELS_GIO];
  207. SMU7_PIDController GioPIDController;
  208. uint32_t GIOLevelCount;
  209. uint8_t Enable;
  210. uint8_t GIOVoltageChangeEnable;
  211. uint8_t GIOBootLevel;
  212. uint8_t padding;
  213. uint8_t padding1[2];
  214. uint8_t TargetState;
  215. uint8_t CurrenttState;
  216. uint8_t ThrottleOnHtc;
  217. uint8_t ThermThrottleStatus;
  218. uint8_t ThermThrottleTempSelect;
  219. uint8_t ThermThrottleEnable;
  220. uint16_t TemperatureLimitHigh;
  221. uint16_t TemperatureLimitLow;
  222. };
  223. typedef struct SMU7_Fusion_DpmTable SMU7_Fusion_DpmTable;
  224. typedef struct SMU7_Fusion_GIODpmTable SMU7_Fusion_GIODpmTable;
  225. #pragma pack(pop)
  226. #endif