pptable.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  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. #ifndef _PPTABLE_H
  23. #define _PPTABLE_H
  24. #pragma pack(1)
  25. typedef struct _ATOM_PPLIB_THERMALCONTROLLER
  26. {
  27. UCHAR ucType; // one of ATOM_PP_THERMALCONTROLLER_*
  28. UCHAR ucI2cLine; // as interpreted by DAL I2C
  29. UCHAR ucI2cAddress;
  30. UCHAR ucFanParameters; // Fan Control Parameters.
  31. UCHAR ucFanMinRPM; // Fan Minimum RPM (hundreds) -- for display purposes only.
  32. UCHAR ucFanMaxRPM; // Fan Maximum RPM (hundreds) -- for display purposes only.
  33. UCHAR ucReserved; // ----
  34. UCHAR ucFlags; // to be defined
  35. } ATOM_PPLIB_THERMALCONTROLLER;
  36. #define ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f
  37. #define ATOM_PP_FANPARAMETERS_NOFAN 0x80 // No fan is connected to this controller.
  38. #define ATOM_PP_THERMALCONTROLLER_NONE 0
  39. #define ATOM_PP_THERMALCONTROLLER_LM63 1 // Not used by PPLib
  40. #define ATOM_PP_THERMALCONTROLLER_ADM1032 2 // Not used by PPLib
  41. #define ATOM_PP_THERMALCONTROLLER_ADM1030 3 // Not used by PPLib
  42. #define ATOM_PP_THERMALCONTROLLER_MUA6649 4 // Not used by PPLib
  43. #define ATOM_PP_THERMALCONTROLLER_LM64 5
  44. #define ATOM_PP_THERMALCONTROLLER_F75375 6 // Not used by PPLib
  45. #define ATOM_PP_THERMALCONTROLLER_RV6xx 7
  46. #define ATOM_PP_THERMALCONTROLLER_RV770 8
  47. #define ATOM_PP_THERMALCONTROLLER_ADT7473 9
  48. #define ATOM_PP_THERMALCONTROLLER_KONG 10
  49. #define ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO 11
  50. #define ATOM_PP_THERMALCONTROLLER_EVERGREEN 12
  51. #define ATOM_PP_THERMALCONTROLLER_EMC2103 13 /* 0x0D */ // Only fan control will be implemented, do NOT show this in PPGen.
  52. #define ATOM_PP_THERMALCONTROLLER_SUMO 14 /* 0x0E */ // Sumo type, used internally
  53. #define ATOM_PP_THERMALCONTROLLER_NISLANDS 15
  54. #define ATOM_PP_THERMALCONTROLLER_SISLANDS 16
  55. #define ATOM_PP_THERMALCONTROLLER_LM96163 17
  56. #define ATOM_PP_THERMALCONTROLLER_CISLANDS 18
  57. #define ATOM_PP_THERMALCONTROLLER_KAVERI 19
  58. // Thermal controller 'combo type' to use an external controller for Fan control and an internal controller for thermal.
  59. // We probably should reserve the bit 0x80 for this use.
  60. // To keep the number of these types low we should also use the same code for all ASICs (i.e. do not distinguish RV6xx and RV7xx Internal here).
  61. // The driver can pick the correct internal controller based on the ASIC.
  62. #define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL 0x89 // ADT7473 Fan Control + Internal Thermal Controller
  63. #define ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL 0x8D // EMC2103 Fan Control + Internal Thermal Controller
  64. typedef struct _ATOM_PPLIB_STATE
  65. {
  66. UCHAR ucNonClockStateIndex;
  67. UCHAR ucClockStateIndices[1]; // variable-sized
  68. } ATOM_PPLIB_STATE;
  69. typedef struct _ATOM_PPLIB_FANTABLE
  70. {
  71. UCHAR ucFanTableFormat; // Change this if the table format changes or version changes so that the other fields are not the same.
  72. UCHAR ucTHyst; // Temperature hysteresis. Integer.
  73. USHORT usTMin; // The temperature, in 0.01 centigrades, below which we just run at a minimal PWM.
  74. USHORT usTMed; // The middle temperature where we change slopes.
  75. USHORT usTHigh; // The high point above TMed for adjusting the second slope.
  76. USHORT usPWMMin; // The minimum PWM value in percent (0.01% increments).
  77. USHORT usPWMMed; // The PWM value (in percent) at TMed.
  78. USHORT usPWMHigh; // The PWM value at THigh.
  79. } ATOM_PPLIB_FANTABLE;
  80. typedef struct _ATOM_PPLIB_FANTABLE2
  81. {
  82. ATOM_PPLIB_FANTABLE basicTable;
  83. USHORT usTMax; // The max temperature
  84. } ATOM_PPLIB_FANTABLE2;
  85. typedef struct _ATOM_PPLIB_FANTABLE3
  86. {
  87. ATOM_PPLIB_FANTABLE2 basicTable2;
  88. UCHAR ucFanControlMode;
  89. USHORT usFanPWMMax;
  90. USHORT usFanOutputSensitivity;
  91. } ATOM_PPLIB_FANTABLE3;
  92. typedef struct _ATOM_PPLIB_EXTENDEDHEADER
  93. {
  94. USHORT usSize;
  95. ULONG ulMaxEngineClock; // For Overdrive.
  96. ULONG ulMaxMemoryClock; // For Overdrive.
  97. // Add extra system parameters here, always adjust size to include all fields.
  98. USHORT usVCETableOffset; //points to ATOM_PPLIB_VCE_Table
  99. USHORT usUVDTableOffset; //points to ATOM_PPLIB_UVD_Table
  100. USHORT usSAMUTableOffset; //points to ATOM_PPLIB_SAMU_Table
  101. USHORT usPPMTableOffset; //points to ATOM_PPLIB_PPM_Table
  102. USHORT usACPTableOffset; //points to ATOM_PPLIB_ACP_Table
  103. USHORT usPowerTuneTableOffset; //points to ATOM_PPLIB_POWERTUNE_Table
  104. } ATOM_PPLIB_EXTENDEDHEADER;
  105. //// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps
  106. #define ATOM_PP_PLATFORM_CAP_BACKBIAS 1
  107. #define ATOM_PP_PLATFORM_CAP_POWERPLAY 2
  108. #define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4
  109. #define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8
  110. #define ATOM_PP_PLATFORM_CAP_ASPM_L1 16
  111. #define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32
  112. #define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64
  113. #define ATOM_PP_PLATFORM_CAP_STEPVDDC 128
  114. #define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256
  115. #define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512
  116. #define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024
  117. #define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048
  118. #define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096
  119. #define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000 // Go to boot state on alerts, e.g. on an AC->DC transition.
  120. #define ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT 0x4000 // Do NOT wait for VBLANK during an alert (e.g. AC->DC transition).
  121. #define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000 // Does the driver control VDDCI independently from VDDC.
  122. #define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000 // Enable the 'regulator hot' feature.
  123. #define ATOM_PP_PLATFORM_CAP_BACO 0x00020000 // Does the driver supports BACO state.
  124. #define ATOM_PP_PLATFORM_CAP_NEW_CAC_VOLTAGE 0x00040000 // Does the driver supports new CAC voltage table.
  125. #define ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY 0x00080000 // Does the driver supports revert GPIO5 polarity.
  126. #define ATOM_PP_PLATFORM_CAP_OUTPUT_THERMAL2GPIO17 0x00100000 // Does the driver supports thermal2GPIO17.
  127. #define ATOM_PP_PLATFORM_CAP_VRHOT_GPIO_CONFIGURABLE 0x00200000 // Does the driver supports VR HOT GPIO Configurable.
  128. #define ATOM_PP_PLATFORM_CAP_TEMP_INVERSION 0x00400000 // Does the driver supports Temp Inversion feature.
  129. #define ATOM_PP_PLATFORM_CAP_EVV 0x00800000
  130. typedef struct _ATOM_PPLIB_POWERPLAYTABLE
  131. {
  132. ATOM_COMMON_TABLE_HEADER sHeader;
  133. UCHAR ucDataRevision;
  134. UCHAR ucNumStates;
  135. UCHAR ucStateEntrySize;
  136. UCHAR ucClockInfoSize;
  137. UCHAR ucNonClockSize;
  138. // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures
  139. USHORT usStateArrayOffset;
  140. // offset from start of this table to array of ASIC-specific structures,
  141. // currently ATOM_PPLIB_CLOCK_INFO.
  142. USHORT usClockInfoArrayOffset;
  143. // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO
  144. USHORT usNonClockInfoArrayOffset;
  145. USHORT usBackbiasTime; // in microseconds
  146. USHORT usVoltageTime; // in microseconds
  147. USHORT usTableSize; //the size of this structure, or the extended structure
  148. ULONG ulPlatformCaps; // See ATOM_PPLIB_CAPS_*
  149. ATOM_PPLIB_THERMALCONTROLLER sThermalController;
  150. USHORT usBootClockInfoOffset;
  151. USHORT usBootNonClockInfoOffset;
  152. } ATOM_PPLIB_POWERPLAYTABLE;
  153. typedef struct _ATOM_PPLIB_POWERPLAYTABLE2
  154. {
  155. ATOM_PPLIB_POWERPLAYTABLE basicTable;
  156. UCHAR ucNumCustomThermalPolicy;
  157. USHORT usCustomThermalPolicyArrayOffset;
  158. }ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2;
  159. typedef struct _ATOM_PPLIB_POWERPLAYTABLE3
  160. {
  161. ATOM_PPLIB_POWERPLAYTABLE2 basicTable2;
  162. USHORT usFormatID; // To be used ONLY by PPGen.
  163. USHORT usFanTableOffset;
  164. USHORT usExtendendedHeaderOffset;
  165. } ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3;
  166. typedef struct _ATOM_PPLIB_POWERPLAYTABLE4
  167. {
  168. ATOM_PPLIB_POWERPLAYTABLE3 basicTable3;
  169. ULONG ulGoldenPPID; // PPGen use only
  170. ULONG ulGoldenRevision; // PPGen use only
  171. USHORT usVddcDependencyOnSCLKOffset;
  172. USHORT usVddciDependencyOnMCLKOffset;
  173. USHORT usVddcDependencyOnMCLKOffset;
  174. USHORT usMaxClockVoltageOnDCOffset;
  175. USHORT usVddcPhaseShedLimitsTableOffset; // Points to ATOM_PPLIB_PhaseSheddingLimits_Table
  176. USHORT usMvddDependencyOnMCLKOffset;
  177. } ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4;
  178. typedef struct _ATOM_PPLIB_POWERPLAYTABLE5
  179. {
  180. ATOM_PPLIB_POWERPLAYTABLE4 basicTable4;
  181. ULONG ulTDPLimit;
  182. ULONG ulNearTDPLimit;
  183. ULONG ulSQRampingThreshold;
  184. USHORT usCACLeakageTableOffset; // Points to ATOM_PPLIB_CAC_Leakage_Table
  185. ULONG ulCACLeakage; // The iLeakage for driver calculated CAC leakage table
  186. USHORT usTDPODLimit;
  187. USHORT usLoadLineSlope; // in milliOhms * 100
  188. } ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5;
  189. //// ATOM_PPLIB_NONCLOCK_INFO::usClassification
  190. #define ATOM_PPLIB_CLASSIFICATION_UI_MASK 0x0007
  191. #define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT 0
  192. #define ATOM_PPLIB_CLASSIFICATION_UI_NONE 0
  193. #define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY 1
  194. #define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED 3
  195. #define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE 5
  196. // 2, 4, 6, 7 are reserved
  197. #define ATOM_PPLIB_CLASSIFICATION_BOOT 0x0008
  198. #define ATOM_PPLIB_CLASSIFICATION_THERMAL 0x0010
  199. #define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE 0x0020
  200. #define ATOM_PPLIB_CLASSIFICATION_REST 0x0040
  201. #define ATOM_PPLIB_CLASSIFICATION_FORCED 0x0080
  202. #define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE 0x0100
  203. #define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE 0x0200
  204. #define ATOM_PPLIB_CLASSIFICATION_UVDSTATE 0x0400
  205. #define ATOM_PPLIB_CLASSIFICATION_3DLOW 0x0800
  206. #define ATOM_PPLIB_CLASSIFICATION_ACPI 0x1000
  207. #define ATOM_PPLIB_CLASSIFICATION_HD2STATE 0x2000
  208. #define ATOM_PPLIB_CLASSIFICATION_HDSTATE 0x4000
  209. #define ATOM_PPLIB_CLASSIFICATION_SDSTATE 0x8000
  210. //// ATOM_PPLIB_NONCLOCK_INFO::usClassification2
  211. #define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2 0x0001
  212. #define ATOM_PPLIB_CLASSIFICATION2_ULV 0x0002
  213. #define ATOM_PPLIB_CLASSIFICATION2_MVC 0x0004 //Multi-View Codec (BD-3D)
  214. //// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings
  215. #define ATOM_PPLIB_SINGLE_DISPLAY_ONLY 0x00000001
  216. #define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK 0x00000002
  217. // 0 is 2.5Gb/s, 1 is 5Gb/s
  218. #define ATOM_PPLIB_PCIE_LINK_SPEED_MASK 0x00000004
  219. #define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT 2
  220. // lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec
  221. #define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK 0x000000F8
  222. #define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT 3
  223. // lookup into reduced refresh-rate table
  224. #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK 0x00000F00
  225. #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8
  226. #define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED 0
  227. #define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ 1
  228. // 2-15 TBD as needed.
  229. #define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING 0x00001000
  230. #define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS 0x00002000
  231. #define ATOM_PPLIB_DISALLOW_ON_DC 0x00004000
  232. #define ATOM_PPLIB_ENABLE_VARIBRIGHT 0x00008000
  233. //memory related flags
  234. #define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF 0x000010000
  235. //M3 Arb //2bits, current 3 sets of parameters in total
  236. #define ATOM_PPLIB_M3ARB_MASK 0x00060000
  237. #define ATOM_PPLIB_M3ARB_SHIFT 17
  238. #define ATOM_PPLIB_ENABLE_DRR 0x00080000
  239. // remaining 16 bits are reserved
  240. typedef struct _ATOM_PPLIB_THERMAL_STATE
  241. {
  242. UCHAR ucMinTemperature;
  243. UCHAR ucMaxTemperature;
  244. UCHAR ucThermalAction;
  245. }ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE;
  246. // Contained in an array starting at the offset
  247. // in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset.
  248. // referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex
  249. #define ATOM_PPLIB_NONCLOCKINFO_VER1 12
  250. #define ATOM_PPLIB_NONCLOCKINFO_VER2 24
  251. typedef struct _ATOM_PPLIB_NONCLOCK_INFO
  252. {
  253. USHORT usClassification;
  254. UCHAR ucMinTemperature;
  255. UCHAR ucMaxTemperature;
  256. ULONG ulCapsAndSettings;
  257. UCHAR ucRequiredPower;
  258. USHORT usClassification2;
  259. ULONG ulVCLK;
  260. ULONG ulDCLK;
  261. UCHAR ucUnused[5];
  262. } ATOM_PPLIB_NONCLOCK_INFO;
  263. // Contained in an array starting at the offset
  264. // in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset.
  265. // referenced from ATOM_PPLIB_STATE::ucClockStateIndices
  266. typedef struct _ATOM_PPLIB_R600_CLOCK_INFO
  267. {
  268. USHORT usEngineClockLow;
  269. UCHAR ucEngineClockHigh;
  270. USHORT usMemoryClockLow;
  271. UCHAR ucMemoryClockHigh;
  272. USHORT usVDDC;
  273. USHORT usUnused1;
  274. USHORT usUnused2;
  275. ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
  276. } ATOM_PPLIB_R600_CLOCK_INFO;
  277. // ulFlags in ATOM_PPLIB_R600_CLOCK_INFO
  278. #define ATOM_PPLIB_R600_FLAGS_PCIEGEN2 1
  279. #define ATOM_PPLIB_R600_FLAGS_UVDSAFE 2
  280. #define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE 4
  281. #define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF 8
  282. #define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF 16
  283. #define ATOM_PPLIB_R600_FLAGS_LOWPOWER 32 // On the RV770 use 'low power' setting (sequencer S0).
  284. typedef struct _ATOM_PPLIB_RS780_CLOCK_INFO
  285. {
  286. USHORT usLowEngineClockLow; // Low Engine clock in MHz (the same way as on the R600).
  287. UCHAR ucLowEngineClockHigh;
  288. USHORT usHighEngineClockLow; // High Engine clock in MHz.
  289. UCHAR ucHighEngineClockHigh;
  290. USHORT usMemoryClockLow; // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants.
  291. UCHAR ucMemoryClockHigh; // Currentyl unused.
  292. UCHAR ucPadding; // For proper alignment and size.
  293. USHORT usVDDC; // For the 780, use: None, Low, High, Variable
  294. UCHAR ucMaxHTLinkWidth; // From SBIOS - {2, 4, 8, 16}
  295. UCHAR ucMinHTLinkWidth; // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could
  296. USHORT usHTLinkFreq; // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200).
  297. ULONG ulFlags;
  298. } ATOM_PPLIB_RS780_CLOCK_INFO;
  299. #define ATOM_PPLIB_RS780_VOLTAGE_NONE 0
  300. #define ATOM_PPLIB_RS780_VOLTAGE_LOW 1
  301. #define ATOM_PPLIB_RS780_VOLTAGE_HIGH 2
  302. #define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE 3
  303. #define ATOM_PPLIB_RS780_SPMCLK_NONE 0 // We cannot change the side port memory clock, leave it as it is.
  304. #define ATOM_PPLIB_RS780_SPMCLK_LOW 1
  305. #define ATOM_PPLIB_RS780_SPMCLK_HIGH 2
  306. #define ATOM_PPLIB_RS780_HTLINKFREQ_NONE 0
  307. #define ATOM_PPLIB_RS780_HTLINKFREQ_LOW 1
  308. #define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH 2
  309. typedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO
  310. {
  311. USHORT usEngineClockLow;
  312. UCHAR ucEngineClockHigh;
  313. USHORT usMemoryClockLow;
  314. UCHAR ucMemoryClockHigh;
  315. USHORT usVDDC;
  316. USHORT usVDDCI;
  317. USHORT usUnused;
  318. ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
  319. } ATOM_PPLIB_EVERGREEN_CLOCK_INFO;
  320. typedef struct _ATOM_PPLIB_SI_CLOCK_INFO
  321. {
  322. USHORT usEngineClockLow;
  323. UCHAR ucEngineClockHigh;
  324. USHORT usMemoryClockLow;
  325. UCHAR ucMemoryClockHigh;
  326. USHORT usVDDC;
  327. USHORT usVDDCI;
  328. UCHAR ucPCIEGen;
  329. UCHAR ucUnused1;
  330. ULONG ulFlags; // ATOM_PPLIB_SI_FLAGS_*, no flag is necessary for now
  331. } ATOM_PPLIB_SI_CLOCK_INFO;
  332. typedef struct _ATOM_PPLIB_CI_CLOCK_INFO
  333. {
  334. USHORT usEngineClockLow;
  335. UCHAR ucEngineClockHigh;
  336. USHORT usMemoryClockLow;
  337. UCHAR ucMemoryClockHigh;
  338. UCHAR ucPCIEGen;
  339. USHORT usPCIELane;
  340. } ATOM_PPLIB_CI_CLOCK_INFO;
  341. typedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{
  342. USHORT usEngineClockLow; //clockfrequency & 0xFFFF. The unit is in 10khz
  343. UCHAR ucEngineClockHigh; //clockfrequency >> 16.
  344. UCHAR vddcIndex; //2-bit vddc index;
  345. USHORT tdpLimit;
  346. //please initalize to 0
  347. USHORT rsv1;
  348. //please initialize to 0s
  349. ULONG rsv2[2];
  350. }ATOM_PPLIB_SUMO_CLOCK_INFO;
  351. typedef struct _ATOM_PPLIB_STATE_V2
  352. {
  353. //number of valid dpm levels in this state; Driver uses it to calculate the whole
  354. //size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR)
  355. UCHAR ucNumDPMLevels;
  356. //a index to the array of nonClockInfos
  357. UCHAR nonClockInfoIndex;
  358. /**
  359. * Driver will read the first ucNumDPMLevels in this array
  360. */
  361. UCHAR clockInfoIndex[1];
  362. } ATOM_PPLIB_STATE_V2;
  363. typedef struct _StateArray{
  364. //how many states we have
  365. UCHAR ucNumEntries;
  366. ATOM_PPLIB_STATE_V2 states[1];
  367. }StateArray;
  368. typedef struct _ClockInfoArray{
  369. //how many clock levels we have
  370. UCHAR ucNumEntries;
  371. //sizeof(ATOM_PPLIB_CLOCK_INFO)
  372. UCHAR ucEntrySize;
  373. UCHAR clockInfo[1];
  374. }ClockInfoArray;
  375. typedef struct _NonClockInfoArray{
  376. //how many non-clock levels we have. normally should be same as number of states
  377. UCHAR ucNumEntries;
  378. //sizeof(ATOM_PPLIB_NONCLOCK_INFO)
  379. UCHAR ucEntrySize;
  380. ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1];
  381. }NonClockInfoArray;
  382. typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record
  383. {
  384. USHORT usClockLow;
  385. UCHAR ucClockHigh;
  386. USHORT usVoltage;
  387. }ATOM_PPLIB_Clock_Voltage_Dependency_Record;
  388. typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table
  389. {
  390. UCHAR ucNumEntries; // Number of entries.
  391. ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1]; // Dynamically allocate entries.
  392. }ATOM_PPLIB_Clock_Voltage_Dependency_Table;
  393. typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record
  394. {
  395. USHORT usSclkLow;
  396. UCHAR ucSclkHigh;
  397. USHORT usMclkLow;
  398. UCHAR ucMclkHigh;
  399. USHORT usVddc;
  400. USHORT usVddci;
  401. }ATOM_PPLIB_Clock_Voltage_Limit_Record;
  402. typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table
  403. {
  404. UCHAR ucNumEntries; // Number of entries.
  405. ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1]; // Dynamically allocate entries.
  406. }ATOM_PPLIB_Clock_Voltage_Limit_Table;
  407. union _ATOM_PPLIB_CAC_Leakage_Record
  408. {
  409. struct
  410. {
  411. USHORT usVddc; // We use this field for the "fake" standardized VDDC for power calculations; For CI and newer, we use this as the real VDDC value. in CI we read it as StdVoltageHiSidd
  412. ULONG ulLeakageValue; // For CI and newer we use this as the "fake" standar VDDC value. in CI we read it as StdVoltageLoSidd
  413. };
  414. struct
  415. {
  416. USHORT usVddc1;
  417. USHORT usVddc2;
  418. USHORT usVddc3;
  419. };
  420. };
  421. typedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record;
  422. typedef struct _ATOM_PPLIB_CAC_Leakage_Table
  423. {
  424. UCHAR ucNumEntries; // Number of entries.
  425. ATOM_PPLIB_CAC_Leakage_Record entries[1]; // Dynamically allocate entries.
  426. }ATOM_PPLIB_CAC_Leakage_Table;
  427. typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record
  428. {
  429. USHORT usVoltage;
  430. USHORT usSclkLow;
  431. UCHAR ucSclkHigh;
  432. USHORT usMclkLow;
  433. UCHAR ucMclkHigh;
  434. }ATOM_PPLIB_PhaseSheddingLimits_Record;
  435. typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table
  436. {
  437. UCHAR ucNumEntries; // Number of entries.
  438. ATOM_PPLIB_PhaseSheddingLimits_Record entries[1]; // Dynamically allocate entries.
  439. }ATOM_PPLIB_PhaseSheddingLimits_Table;
  440. typedef struct _VCEClockInfo{
  441. USHORT usEVClkLow;
  442. UCHAR ucEVClkHigh;
  443. USHORT usECClkLow;
  444. UCHAR ucECClkHigh;
  445. }VCEClockInfo;
  446. typedef struct _VCEClockInfoArray{
  447. UCHAR ucNumEntries;
  448. VCEClockInfo entries[1];
  449. }VCEClockInfoArray;
  450. typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record
  451. {
  452. USHORT usVoltage;
  453. UCHAR ucVCEClockInfoIndex;
  454. }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record;
  455. typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table
  456. {
  457. UCHAR numEntries;
  458. ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[1];
  459. }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table;
  460. typedef struct _ATOM_PPLIB_VCE_State_Record
  461. {
  462. UCHAR ucVCEClockInfoIndex;
  463. UCHAR ucClockInfoIndex; //highest 2 bits indicates memory p-states, lower 6bits indicates index to ClockInfoArrary
  464. }ATOM_PPLIB_VCE_State_Record;
  465. typedef struct _ATOM_PPLIB_VCE_State_Table
  466. {
  467. UCHAR numEntries;
  468. ATOM_PPLIB_VCE_State_Record entries[1];
  469. }ATOM_PPLIB_VCE_State_Table;
  470. typedef struct _ATOM_PPLIB_VCE_Table
  471. {
  472. UCHAR revid;
  473. // VCEClockInfoArray array;
  474. // ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table limits;
  475. // ATOM_PPLIB_VCE_State_Table states;
  476. }ATOM_PPLIB_VCE_Table;
  477. typedef struct _UVDClockInfo{
  478. USHORT usVClkLow;
  479. UCHAR ucVClkHigh;
  480. USHORT usDClkLow;
  481. UCHAR ucDClkHigh;
  482. }UVDClockInfo;
  483. typedef struct _UVDClockInfoArray{
  484. UCHAR ucNumEntries;
  485. UVDClockInfo entries[1];
  486. }UVDClockInfoArray;
  487. typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record
  488. {
  489. USHORT usVoltage;
  490. UCHAR ucUVDClockInfoIndex;
  491. }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record;
  492. typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table
  493. {
  494. UCHAR numEntries;
  495. ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[1];
  496. }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table;
  497. typedef struct _ATOM_PPLIB_UVD_Table
  498. {
  499. UCHAR revid;
  500. // UVDClockInfoArray array;
  501. // ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table limits;
  502. }ATOM_PPLIB_UVD_Table;
  503. typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record
  504. {
  505. USHORT usVoltage;
  506. USHORT usSAMClockLow;
  507. UCHAR ucSAMClockHigh;
  508. }ATOM_PPLIB_SAMClk_Voltage_Limit_Record;
  509. typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{
  510. UCHAR numEntries;
  511. ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[1];
  512. }ATOM_PPLIB_SAMClk_Voltage_Limit_Table;
  513. typedef struct _ATOM_PPLIB_SAMU_Table
  514. {
  515. UCHAR revid;
  516. ATOM_PPLIB_SAMClk_Voltage_Limit_Table limits;
  517. }ATOM_PPLIB_SAMU_Table;
  518. typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record
  519. {
  520. USHORT usVoltage;
  521. USHORT usACPClockLow;
  522. UCHAR ucACPClockHigh;
  523. }ATOM_PPLIB_ACPClk_Voltage_Limit_Record;
  524. typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{
  525. UCHAR numEntries;
  526. ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[1];
  527. }ATOM_PPLIB_ACPClk_Voltage_Limit_Table;
  528. typedef struct _ATOM_PPLIB_ACP_Table
  529. {
  530. UCHAR revid;
  531. ATOM_PPLIB_ACPClk_Voltage_Limit_Table limits;
  532. }ATOM_PPLIB_ACP_Table;
  533. typedef struct _ATOM_PowerTune_Table{
  534. USHORT usTDP;
  535. USHORT usConfigurableTDP;
  536. USHORT usTDC;
  537. USHORT usBatteryPowerLimit;
  538. USHORT usSmallPowerLimit;
  539. USHORT usLowCACLeakage;
  540. USHORT usHighCACLeakage;
  541. }ATOM_PowerTune_Table;
  542. typedef struct _ATOM_PPLIB_POWERTUNE_Table
  543. {
  544. UCHAR revid;
  545. ATOM_PowerTune_Table power_tune_table;
  546. }ATOM_PPLIB_POWERTUNE_Table;
  547. typedef struct _ATOM_PPLIB_POWERTUNE_Table_V1
  548. {
  549. UCHAR revid;
  550. ATOM_PowerTune_Table power_tune_table;
  551. USHORT usMaximumPowerDeliveryLimit;
  552. USHORT usReserve[7];
  553. } ATOM_PPLIB_POWERTUNE_Table_V1;
  554. #define ATOM_PPM_A_A 1
  555. #define ATOM_PPM_A_I 2
  556. typedef struct _ATOM_PPLIB_PPM_Table
  557. {
  558. UCHAR ucRevId;
  559. UCHAR ucPpmDesign; //A+I or A+A
  560. USHORT usCpuCoreNumber;
  561. ULONG ulPlatformTDP;
  562. ULONG ulSmallACPlatformTDP;
  563. ULONG ulPlatformTDC;
  564. ULONG ulSmallACPlatformTDC;
  565. ULONG ulApuTDP;
  566. ULONG ulDGpuTDP;
  567. ULONG ulDGpuUlvPower;
  568. ULONG ulTjmax;
  569. } ATOM_PPLIB_PPM_Table;
  570. #pragma pack()
  571. #endif