smu7_fusion.h 8.7 KB

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