vega10_pptable.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /*
  2. * Copyright 2016 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 _VEGA10_PPTABLE_H_
  24. #define _VEGA10_PPTABLE_H_
  25. #pragma pack(push, 1)
  26. #define ATOM_VEGA10_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f
  27. #define ATOM_VEGA10_PP_FANPARAMETERS_NOFAN 0x80
  28. #define ATOM_VEGA10_PP_THERMALCONTROLLER_NONE 0
  29. #define ATOM_VEGA10_PP_THERMALCONTROLLER_LM96163 17
  30. #define ATOM_VEGA10_PP_THERMALCONTROLLER_VEGA10 24
  31. #define ATOM_VEGA10_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL 0x89
  32. #define ATOM_VEGA10_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL 0x8D
  33. #define ATOM_VEGA10_PP_PLATFORM_CAP_POWERPLAY 0x1
  34. #define ATOM_VEGA10_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 0x2
  35. #define ATOM_VEGA10_PP_PLATFORM_CAP_HARDWAREDC 0x4
  36. #define ATOM_VEGA10_PP_PLATFORM_CAP_BACO 0x8
  37. #define ATOM_VEGA10_PP_PLATFORM_COMBINE_PCC_WITH_THERMAL_SIGNAL 0x10
  38. /* ATOM_PPLIB_NONCLOCK_INFO::usClassification */
  39. #define ATOM_PPLIB_CLASSIFICATION_UI_MASK 0x0007
  40. #define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT 0
  41. #define ATOM_PPLIB_CLASSIFICATION_UI_NONE 0
  42. #define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY 1
  43. #define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED 3
  44. #define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE 5
  45. /* 2, 4, 6, 7 are reserved */
  46. #define ATOM_PPLIB_CLASSIFICATION_BOOT 0x0008
  47. #define ATOM_PPLIB_CLASSIFICATION_THERMAL 0x0010
  48. #define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE 0x0020
  49. #define ATOM_PPLIB_CLASSIFICATION_REST 0x0040
  50. #define ATOM_PPLIB_CLASSIFICATION_FORCED 0x0080
  51. #define ATOM_PPLIB_CLASSIFICATION_ACPI 0x1000
  52. /* ATOM_PPLIB_NONCLOCK_INFO::usClassification2 */
  53. #define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2 0x0001
  54. #define ATOM_Vega10_DISALLOW_ON_DC 0x00004000
  55. #define ATOM_Vega10_ENABLE_VARIBRIGHT 0x00008000
  56. #define ATOM_Vega10_TABLE_REVISION_VEGA10 8
  57. #define ATOM_Vega10_VoltageMode_AVFS_Interpolate 0
  58. #define ATOM_Vega10_VoltageMode_AVFS_WorstCase 1
  59. #define ATOM_Vega10_VoltageMode_Static 2
  60. typedef struct _ATOM_Vega10_POWERPLAYTABLE {
  61. struct atom_common_table_header sHeader;
  62. UCHAR ucTableRevision;
  63. USHORT usTableSize; /* the size of header structure */
  64. ULONG ulGoldenPPID; /* PPGen use only */
  65. ULONG ulGoldenRevision; /* PPGen use only */
  66. USHORT usFormatID; /* PPGen use only */
  67. ULONG ulPlatformCaps; /* See ATOM_Vega10_CAPS_* */
  68. ULONG ulMaxODEngineClock; /* For Overdrive. */
  69. ULONG ulMaxODMemoryClock; /* For Overdrive. */
  70. USHORT usPowerControlLimit;
  71. USHORT usUlvVoltageOffset; /* in mv units */
  72. USHORT usUlvSmnclkDid;
  73. USHORT usUlvMp1clkDid;
  74. USHORT usUlvGfxclkBypass;
  75. USHORT usGfxclkSlewRate;
  76. UCHAR ucGfxVoltageMode;
  77. UCHAR ucSocVoltageMode;
  78. UCHAR ucUclkVoltageMode;
  79. UCHAR ucUvdVoltageMode;
  80. UCHAR ucVceVoltageMode;
  81. UCHAR ucMp0VoltageMode;
  82. UCHAR ucDcefVoltageMode;
  83. USHORT usStateArrayOffset; /* points to ATOM_Vega10_State_Array */
  84. USHORT usFanTableOffset; /* points to ATOM_Vega10_Fan_Table */
  85. USHORT usThermalControllerOffset; /* points to ATOM_Vega10_Thermal_Controller */
  86. USHORT usSocclkDependencyTableOffset; /* points to ATOM_Vega10_SOCCLK_Dependency_Table */
  87. USHORT usMclkDependencyTableOffset; /* points to ATOM_Vega10_MCLK_Dependency_Table */
  88. USHORT usGfxclkDependencyTableOffset; /* points to ATOM_Vega10_GFXCLK_Dependency_Table */
  89. USHORT usDcefclkDependencyTableOffset; /* points to ATOM_Vega10_DCEFCLK_Dependency_Table */
  90. USHORT usVddcLookupTableOffset; /* points to ATOM_Vega10_Voltage_Lookup_Table */
  91. USHORT usVddmemLookupTableOffset; /* points to ATOM_Vega10_Voltage_Lookup_Table */
  92. USHORT usMMDependencyTableOffset; /* points to ATOM_Vega10_MM_Dependency_Table */
  93. USHORT usVCEStateTableOffset; /* points to ATOM_Vega10_VCE_State_Table */
  94. USHORT usReserve; /* No PPM Support for Vega10 */
  95. USHORT usPowerTuneTableOffset; /* points to ATOM_Vega10_PowerTune_Table */
  96. USHORT usHardLimitTableOffset; /* points to ATOM_Vega10_Hard_Limit_Table */
  97. USHORT usVddciLookupTableOffset; /* points to ATOM_Vega10_Voltage_Lookup_Table */
  98. USHORT usPCIETableOffset; /* points to ATOM_Vega10_PCIE_Table */
  99. USHORT usPixclkDependencyTableOffset; /* points to ATOM_Vega10_PIXCLK_Dependency_Table */
  100. USHORT usDispClkDependencyTableOffset; /* points to ATOM_Vega10_DISPCLK_Dependency_Table */
  101. USHORT usPhyClkDependencyTableOffset; /* points to ATOM_Vega10_PHYCLK_Dependency_Table */
  102. } ATOM_Vega10_POWERPLAYTABLE;
  103. typedef struct _ATOM_Vega10_State {
  104. UCHAR ucSocClockIndexHigh;
  105. UCHAR ucSocClockIndexLow;
  106. UCHAR ucGfxClockIndexHigh;
  107. UCHAR ucGfxClockIndexLow;
  108. UCHAR ucMemClockIndexHigh;
  109. UCHAR ucMemClockIndexLow;
  110. USHORT usClassification;
  111. ULONG ulCapsAndSettings;
  112. USHORT usClassification2;
  113. } ATOM_Vega10_State;
  114. typedef struct _ATOM_Vega10_State_Array {
  115. UCHAR ucRevId;
  116. UCHAR ucNumEntries; /* Number of entries. */
  117. ATOM_Vega10_State states[1]; /* Dynamically allocate entries. */
  118. } ATOM_Vega10_State_Array;
  119. typedef struct _ATOM_Vega10_CLK_Dependency_Record {
  120. ULONG ulClk; /* Frequency of Clock */
  121. UCHAR ucVddInd; /* Base voltage */
  122. } ATOM_Vega10_CLK_Dependency_Record;
  123. typedef struct _ATOM_Vega10_GFXCLK_Dependency_Record {
  124. ULONG ulClk; /* Clock Frequency */
  125. UCHAR ucVddInd; /* SOC_VDD index */
  126. USHORT usCKSVOffsetandDisable; /* Bits 0~30: Voltage offset for CKS, Bit 31: Disable/enable for the GFXCLK level. */
  127. USHORT usAVFSOffset; /* AVFS Voltage offset */
  128. } ATOM_Vega10_GFXCLK_Dependency_Record;
  129. typedef struct _ATOM_Vega10_MCLK_Dependency_Record {
  130. ULONG ulMemClk; /* Clock Frequency */
  131. UCHAR ucVddInd; /* SOC_VDD index */
  132. UCHAR ucVddMemInd; /* MEM_VDD - only non zero for MCLK record */
  133. UCHAR ucVddciInd; /* VDDCI = only non zero for MCLK record */
  134. } ATOM_Vega10_MCLK_Dependency_Record;
  135. typedef struct _ATOM_Vega10_GFXCLK_Dependency_Table {
  136. UCHAR ucRevId;
  137. UCHAR ucNumEntries; /* Number of entries. */
  138. ATOM_Vega10_GFXCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
  139. } ATOM_Vega10_GFXCLK_Dependency_Table;
  140. typedef struct _ATOM_Vega10_MCLK_Dependency_Table {
  141. UCHAR ucRevId;
  142. UCHAR ucNumEntries; /* Number of entries. */
  143. ATOM_Vega10_MCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
  144. } ATOM_Vega10_MCLK_Dependency_Table;
  145. typedef struct _ATOM_Vega10_SOCCLK_Dependency_Table {
  146. UCHAR ucRevId;
  147. UCHAR ucNumEntries; /* Number of entries. */
  148. ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
  149. } ATOM_Vega10_SOCCLK_Dependency_Table;
  150. typedef struct _ATOM_Vega10_DCEFCLK_Dependency_Table {
  151. UCHAR ucRevId;
  152. UCHAR ucNumEntries; /* Number of entries. */
  153. ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
  154. } ATOM_Vega10_DCEFCLK_Dependency_Table;
  155. typedef struct _ATOM_Vega10_PIXCLK_Dependency_Table {
  156. UCHAR ucRevId;
  157. UCHAR ucNumEntries; /* Number of entries. */
  158. ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
  159. } ATOM_Vega10_PIXCLK_Dependency_Table;
  160. typedef struct _ATOM_Vega10_DISPCLK_Dependency_Table {
  161. UCHAR ucRevId;
  162. UCHAR ucNumEntries; /* Number of entries.*/
  163. ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
  164. } ATOM_Vega10_DISPCLK_Dependency_Table;
  165. typedef struct _ATOM_Vega10_PHYCLK_Dependency_Table {
  166. UCHAR ucRevId;
  167. UCHAR ucNumEntries; /* Number of entries. */
  168. ATOM_Vega10_CLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
  169. } ATOM_Vega10_PHYCLK_Dependency_Table;
  170. typedef struct _ATOM_Vega10_MM_Dependency_Record {
  171. UCHAR ucVddcInd; /* SOC_VDD voltage */
  172. ULONG ulDClk; /* UVD D-clock */
  173. ULONG ulVClk; /* UVD V-clock */
  174. ULONG ulEClk; /* VCE clock */
  175. ULONG ulPSPClk; /* PSP clock */
  176. } ATOM_Vega10_MM_Dependency_Record;
  177. typedef struct _ATOM_Vega10_MM_Dependency_Table {
  178. UCHAR ucRevId;
  179. UCHAR ucNumEntries; /* Number of entries */
  180. ATOM_Vega10_MM_Dependency_Record entries[1]; /* Dynamically allocate entries */
  181. } ATOM_Vega10_MM_Dependency_Table;
  182. typedef struct _ATOM_Vega10_PCIE_Record {
  183. ULONG ulLCLK; /* LClock */
  184. UCHAR ucPCIEGenSpeed; /* PCIE Speed */
  185. UCHAR ucPCIELaneWidth; /* PCIE Lane Width */
  186. } ATOM_Vega10_PCIE_Record;
  187. typedef struct _ATOM_Vega10_PCIE_Table {
  188. UCHAR ucRevId;
  189. UCHAR ucNumEntries; /* Number of entries */
  190. ATOM_Vega10_PCIE_Record entries[1]; /* Dynamically allocate entries. */
  191. } ATOM_Vega10_PCIE_Table;
  192. typedef struct _ATOM_Vega10_Voltage_Lookup_Record {
  193. USHORT usVdd; /* Base voltage */
  194. } ATOM_Vega10_Voltage_Lookup_Record;
  195. typedef struct _ATOM_Vega10_Voltage_Lookup_Table {
  196. UCHAR ucRevId;
  197. UCHAR ucNumEntries; /* Number of entries */
  198. ATOM_Vega10_Voltage_Lookup_Record entries[1]; /* Dynamically allocate entries */
  199. } ATOM_Vega10_Voltage_Lookup_Table;
  200. typedef struct _ATOM_Vega10_Fan_Table {
  201. UCHAR ucRevId; /* Change this if the table format changes or version changes so that the other fields are not the same. */
  202. USHORT usFanOutputSensitivity; /* Sensitivity of fan reaction to temepature changes. */
  203. USHORT usFanRPMMax; /* The default value in RPM. */
  204. USHORT usThrottlingRPM;
  205. USHORT usFanAcousticLimit; /* Minimum Fan Controller Frequency Acoustic Limit. */
  206. USHORT usTargetTemperature; /* The default ideal temperature in Celcius. */
  207. USHORT usMinimumPWMLimit; /* The minimum PWM that the advanced fan controller can set. */
  208. USHORT usTargetGfxClk; /* The ideal Fan Controller GFXCLK Frequency Acoustic Limit. */
  209. USHORT usFanGainEdge;
  210. USHORT usFanGainHotspot;
  211. USHORT usFanGainLiquid;
  212. USHORT usFanGainVrVddc;
  213. USHORT usFanGainVrMvdd;
  214. USHORT usFanGainPlx;
  215. USHORT usFanGainHbm;
  216. UCHAR ucEnableZeroRPM;
  217. USHORT usFanStopTemperature;
  218. USHORT usFanStartTemperature;
  219. } ATOM_Vega10_Fan_Table;
  220. typedef struct _ATOM_Vega10_Fan_Table_V2 {
  221. UCHAR ucRevId;
  222. USHORT usFanOutputSensitivity;
  223. USHORT usFanAcousticLimitRpm;
  224. USHORT usThrottlingRPM;
  225. USHORT usTargetTemperature;
  226. USHORT usMinimumPWMLimit;
  227. USHORT usTargetGfxClk;
  228. USHORT usFanGainEdge;
  229. USHORT usFanGainHotspot;
  230. USHORT usFanGainLiquid;
  231. USHORT usFanGainVrVddc;
  232. USHORT usFanGainVrMvdd;
  233. USHORT usFanGainPlx;
  234. USHORT usFanGainHbm;
  235. UCHAR ucEnableZeroRPM;
  236. USHORT usFanStopTemperature;
  237. USHORT usFanStartTemperature;
  238. UCHAR ucFanParameters;
  239. UCHAR ucFanMinRPM;
  240. UCHAR ucFanMaxRPM;
  241. } ATOM_Vega10_Fan_Table_V2;
  242. typedef struct _ATOM_Vega10_Thermal_Controller {
  243. UCHAR ucRevId;
  244. UCHAR ucType; /* one of ATOM_VEGA10_PP_THERMALCONTROLLER_*/
  245. UCHAR ucI2cLine; /* as interpreted by DAL I2C */
  246. UCHAR ucI2cAddress;
  247. UCHAR ucFanParameters; /* Fan Control Parameters. */
  248. UCHAR ucFanMinRPM; /* Fan Minimum RPM (hundreds) -- for display purposes only.*/
  249. UCHAR ucFanMaxRPM; /* Fan Maximum RPM (hundreds) -- for display purposes only.*/
  250. UCHAR ucFlags; /* to be defined */
  251. } ATOM_Vega10_Thermal_Controller;
  252. typedef struct _ATOM_Vega10_VCE_State_Record
  253. {
  254. UCHAR ucVCEClockIndex; /*index into usVCEDependencyTableOffset of 'ATOM_Vega10_MM_Dependency_Table' type */
  255. UCHAR ucFlag; /* 2 bits indicates memory p-states */
  256. UCHAR ucSCLKIndex; /* index into ATOM_Vega10_SCLK_Dependency_Table */
  257. UCHAR ucMCLKIndex; /* index into ATOM_Vega10_MCLK_Dependency_Table */
  258. } ATOM_Vega10_VCE_State_Record;
  259. typedef struct _ATOM_Vega10_VCE_State_Table
  260. {
  261. UCHAR ucRevId;
  262. UCHAR ucNumEntries;
  263. ATOM_Vega10_VCE_State_Record entries[1];
  264. } ATOM_Vega10_VCE_State_Table;
  265. typedef struct _ATOM_Vega10_PowerTune_Table {
  266. UCHAR ucRevId;
  267. USHORT usSocketPowerLimit;
  268. USHORT usBatteryPowerLimit;
  269. USHORT usSmallPowerLimit;
  270. USHORT usTdcLimit;
  271. USHORT usEdcLimit;
  272. USHORT usSoftwareShutdownTemp;
  273. USHORT usTemperatureLimitHotSpot;
  274. USHORT usTemperatureLimitLiquid1;
  275. USHORT usTemperatureLimitLiquid2;
  276. USHORT usTemperatureLimitHBM;
  277. USHORT usTemperatureLimitVrSoc;
  278. USHORT usTemperatureLimitVrMem;
  279. USHORT usTemperatureLimitPlx;
  280. USHORT usLoadLineResistance;
  281. UCHAR ucLiquid1_I2C_address;
  282. UCHAR ucLiquid2_I2C_address;
  283. UCHAR ucVr_I2C_address;
  284. UCHAR ucPlx_I2C_address;
  285. UCHAR ucLiquid_I2C_LineSCL;
  286. UCHAR ucLiquid_I2C_LineSDA;
  287. UCHAR ucVr_I2C_LineSCL;
  288. UCHAR ucVr_I2C_LineSDA;
  289. UCHAR ucPlx_I2C_LineSCL;
  290. UCHAR ucPlx_I2C_LineSDA;
  291. USHORT usTemperatureLimitTedge;
  292. } ATOM_Vega10_PowerTune_Table;
  293. typedef struct _ATOM_Vega10_PowerTune_Table_V2
  294. {
  295. UCHAR ucRevId;
  296. USHORT usSocketPowerLimit;
  297. USHORT usBatteryPowerLimit;
  298. USHORT usSmallPowerLimit;
  299. USHORT usTdcLimit;
  300. USHORT usEdcLimit;
  301. USHORT usSoftwareShutdownTemp;
  302. USHORT usTemperatureLimitHotSpot;
  303. USHORT usTemperatureLimitLiquid1;
  304. USHORT usTemperatureLimitLiquid2;
  305. USHORT usTemperatureLimitHBM;
  306. USHORT usTemperatureLimitVrSoc;
  307. USHORT usTemperatureLimitVrMem;
  308. USHORT usTemperatureLimitPlx;
  309. USHORT usLoadLineResistance;
  310. UCHAR ucLiquid1_I2C_address;
  311. UCHAR ucLiquid2_I2C_address;
  312. UCHAR ucLiquid_I2C_Line;
  313. UCHAR ucVr_I2C_address;
  314. UCHAR ucVr_I2C_Line;
  315. UCHAR ucPlx_I2C_address;
  316. UCHAR ucPlx_I2C_Line;
  317. USHORT usTemperatureLimitTedge;
  318. } ATOM_Vega10_PowerTune_Table_V2;
  319. typedef struct _ATOM_Vega10_Hard_Limit_Record {
  320. ULONG ulSOCCLKLimit;
  321. ULONG ulGFXCLKLimit;
  322. ULONG ulMCLKLimit;
  323. USHORT usVddcLimit;
  324. USHORT usVddciLimit;
  325. USHORT usVddMemLimit;
  326. } ATOM_Vega10_Hard_Limit_Record;
  327. typedef struct _ATOM_Vega10_Hard_Limit_Table
  328. {
  329. UCHAR ucRevId;
  330. UCHAR ucNumEntries;
  331. ATOM_Vega10_Hard_Limit_Record entries[1];
  332. } ATOM_Vega10_Hard_Limit_Table;
  333. typedef struct _Vega10_PPTable_Generic_SubTable_Header
  334. {
  335. UCHAR ucRevId;
  336. } Vega10_PPTable_Generic_SubTable_Header;
  337. #pragma pack(pop)
  338. #endif