pptable.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  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. /* points to ATOM_PPLIB_POWERTUNE_Table */
  104. USHORT usPowerTuneTableOffset;
  105. /* points to ATOM_PPLIB_CLOCK_Voltage_Dependency_Table for sclkVddgfxTable */
  106. USHORT usSclkVddgfxTableOffset;
  107. } ATOM_PPLIB_EXTENDEDHEADER;
  108. //// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps
  109. #define ATOM_PP_PLATFORM_CAP_BACKBIAS 1
  110. #define ATOM_PP_PLATFORM_CAP_POWERPLAY 2
  111. #define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4
  112. #define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8
  113. #define ATOM_PP_PLATFORM_CAP_ASPM_L1 16
  114. #define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32
  115. #define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64
  116. #define ATOM_PP_PLATFORM_CAP_STEPVDDC 128
  117. #define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256
  118. #define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512
  119. #define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024
  120. #define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048
  121. #define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096
  122. #define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000 // Go to boot state on alerts, e.g. on an AC->DC transition.
  123. #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).
  124. #define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000 // Does the driver control VDDCI independently from VDDC.
  125. #define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000 // Enable the 'regulator hot' feature.
  126. #define ATOM_PP_PLATFORM_CAP_BACO 0x00020000 // Does the driver supports BACO state.
  127. #define ATOM_PP_PLATFORM_CAP_NEW_CAC_VOLTAGE 0x00040000 // Does the driver supports new CAC voltage table.
  128. #define ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY 0x00080000 // Does the driver supports revert GPIO5 polarity.
  129. #define ATOM_PP_PLATFORM_CAP_OUTPUT_THERMAL2GPIO17 0x00100000 // Does the driver supports thermal2GPIO17.
  130. #define ATOM_PP_PLATFORM_CAP_VRHOT_GPIO_CONFIGURABLE 0x00200000 // Does the driver supports VR HOT GPIO Configurable.
  131. #define ATOM_PP_PLATFORM_CAP_TEMP_INVERSION 0x00400000 // Does the driver supports Temp Inversion feature.
  132. #define ATOM_PP_PLATFORM_CAP_EVV 0x00800000
  133. typedef struct _ATOM_PPLIB_POWERPLAYTABLE
  134. {
  135. ATOM_COMMON_TABLE_HEADER sHeader;
  136. UCHAR ucDataRevision;
  137. UCHAR ucNumStates;
  138. UCHAR ucStateEntrySize;
  139. UCHAR ucClockInfoSize;
  140. UCHAR ucNonClockSize;
  141. // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures
  142. USHORT usStateArrayOffset;
  143. // offset from start of this table to array of ASIC-specific structures,
  144. // currently ATOM_PPLIB_CLOCK_INFO.
  145. USHORT usClockInfoArrayOffset;
  146. // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO
  147. USHORT usNonClockInfoArrayOffset;
  148. USHORT usBackbiasTime; // in microseconds
  149. USHORT usVoltageTime; // in microseconds
  150. USHORT usTableSize; //the size of this structure, or the extended structure
  151. ULONG ulPlatformCaps; // See ATOM_PPLIB_CAPS_*
  152. ATOM_PPLIB_THERMALCONTROLLER sThermalController;
  153. USHORT usBootClockInfoOffset;
  154. USHORT usBootNonClockInfoOffset;
  155. } ATOM_PPLIB_POWERPLAYTABLE;
  156. typedef struct _ATOM_PPLIB_POWERPLAYTABLE2
  157. {
  158. ATOM_PPLIB_POWERPLAYTABLE basicTable;
  159. UCHAR ucNumCustomThermalPolicy;
  160. USHORT usCustomThermalPolicyArrayOffset;
  161. }ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2;
  162. typedef struct _ATOM_PPLIB_POWERPLAYTABLE3
  163. {
  164. ATOM_PPLIB_POWERPLAYTABLE2 basicTable2;
  165. USHORT usFormatID; // To be used ONLY by PPGen.
  166. USHORT usFanTableOffset;
  167. USHORT usExtendendedHeaderOffset;
  168. } ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3;
  169. typedef struct _ATOM_PPLIB_POWERPLAYTABLE4
  170. {
  171. ATOM_PPLIB_POWERPLAYTABLE3 basicTable3;
  172. ULONG ulGoldenPPID; // PPGen use only
  173. ULONG ulGoldenRevision; // PPGen use only
  174. USHORT usVddcDependencyOnSCLKOffset;
  175. USHORT usVddciDependencyOnMCLKOffset;
  176. USHORT usVddcDependencyOnMCLKOffset;
  177. USHORT usMaxClockVoltageOnDCOffset;
  178. USHORT usVddcPhaseShedLimitsTableOffset; // Points to ATOM_PPLIB_PhaseSheddingLimits_Table
  179. USHORT usMvddDependencyOnMCLKOffset;
  180. } ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4;
  181. typedef struct _ATOM_PPLIB_POWERPLAYTABLE5
  182. {
  183. ATOM_PPLIB_POWERPLAYTABLE4 basicTable4;
  184. ULONG ulTDPLimit;
  185. ULONG ulNearTDPLimit;
  186. ULONG ulSQRampingThreshold;
  187. USHORT usCACLeakageTableOffset; // Points to ATOM_PPLIB_CAC_Leakage_Table
  188. ULONG ulCACLeakage; // The iLeakage for driver calculated CAC leakage table
  189. USHORT usTDPODLimit;
  190. USHORT usLoadLineSlope; // in milliOhms * 100
  191. } ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5;
  192. //// ATOM_PPLIB_NONCLOCK_INFO::usClassification
  193. #define ATOM_PPLIB_CLASSIFICATION_UI_MASK 0x0007
  194. #define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT 0
  195. #define ATOM_PPLIB_CLASSIFICATION_UI_NONE 0
  196. #define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY 1
  197. #define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED 3
  198. #define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE 5
  199. // 2, 4, 6, 7 are reserved
  200. #define ATOM_PPLIB_CLASSIFICATION_BOOT 0x0008
  201. #define ATOM_PPLIB_CLASSIFICATION_THERMAL 0x0010
  202. #define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE 0x0020
  203. #define ATOM_PPLIB_CLASSIFICATION_REST 0x0040
  204. #define ATOM_PPLIB_CLASSIFICATION_FORCED 0x0080
  205. #define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE 0x0100
  206. #define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE 0x0200
  207. #define ATOM_PPLIB_CLASSIFICATION_UVDSTATE 0x0400
  208. #define ATOM_PPLIB_CLASSIFICATION_3DLOW 0x0800
  209. #define ATOM_PPLIB_CLASSIFICATION_ACPI 0x1000
  210. #define ATOM_PPLIB_CLASSIFICATION_HD2STATE 0x2000
  211. #define ATOM_PPLIB_CLASSIFICATION_HDSTATE 0x4000
  212. #define ATOM_PPLIB_CLASSIFICATION_SDSTATE 0x8000
  213. //// ATOM_PPLIB_NONCLOCK_INFO::usClassification2
  214. #define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2 0x0001
  215. #define ATOM_PPLIB_CLASSIFICATION2_ULV 0x0002
  216. #define ATOM_PPLIB_CLASSIFICATION2_MVC 0x0004 //Multi-View Codec (BD-3D)
  217. //// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings
  218. #define ATOM_PPLIB_SINGLE_DISPLAY_ONLY 0x00000001
  219. #define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK 0x00000002
  220. // 0 is 2.5Gb/s, 1 is 5Gb/s
  221. #define ATOM_PPLIB_PCIE_LINK_SPEED_MASK 0x00000004
  222. #define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT 2
  223. // lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec
  224. #define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK 0x000000F8
  225. #define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT 3
  226. // lookup into reduced refresh-rate table
  227. #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK 0x00000F00
  228. #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8
  229. #define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED 0
  230. #define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ 1
  231. // 2-15 TBD as needed.
  232. #define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING 0x00001000
  233. #define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS 0x00002000
  234. #define ATOM_PPLIB_DISALLOW_ON_DC 0x00004000
  235. #define ATOM_PPLIB_ENABLE_VARIBRIGHT 0x00008000
  236. //memory related flags
  237. #define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF 0x000010000
  238. //M3 Arb //2bits, current 3 sets of parameters in total
  239. #define ATOM_PPLIB_M3ARB_MASK 0x00060000
  240. #define ATOM_PPLIB_M3ARB_SHIFT 17
  241. #define ATOM_PPLIB_ENABLE_DRR 0x00080000
  242. // remaining 16 bits are reserved
  243. typedef struct _ATOM_PPLIB_THERMAL_STATE
  244. {
  245. UCHAR ucMinTemperature;
  246. UCHAR ucMaxTemperature;
  247. UCHAR ucThermalAction;
  248. }ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE;
  249. // Contained in an array starting at the offset
  250. // in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset.
  251. // referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex
  252. #define ATOM_PPLIB_NONCLOCKINFO_VER1 12
  253. #define ATOM_PPLIB_NONCLOCKINFO_VER2 24
  254. typedef struct _ATOM_PPLIB_NONCLOCK_INFO
  255. {
  256. USHORT usClassification;
  257. UCHAR ucMinTemperature;
  258. UCHAR ucMaxTemperature;
  259. ULONG ulCapsAndSettings;
  260. UCHAR ucRequiredPower;
  261. USHORT usClassification2;
  262. ULONG ulVCLK;
  263. ULONG ulDCLK;
  264. UCHAR ucUnused[5];
  265. } ATOM_PPLIB_NONCLOCK_INFO;
  266. // Contained in an array starting at the offset
  267. // in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset.
  268. // referenced from ATOM_PPLIB_STATE::ucClockStateIndices
  269. typedef struct _ATOM_PPLIB_R600_CLOCK_INFO
  270. {
  271. USHORT usEngineClockLow;
  272. UCHAR ucEngineClockHigh;
  273. USHORT usMemoryClockLow;
  274. UCHAR ucMemoryClockHigh;
  275. USHORT usVDDC;
  276. USHORT usUnused1;
  277. USHORT usUnused2;
  278. ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
  279. } ATOM_PPLIB_R600_CLOCK_INFO;
  280. // ulFlags in ATOM_PPLIB_R600_CLOCK_INFO
  281. #define ATOM_PPLIB_R600_FLAGS_PCIEGEN2 1
  282. #define ATOM_PPLIB_R600_FLAGS_UVDSAFE 2
  283. #define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE 4
  284. #define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF 8
  285. #define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF 16
  286. #define ATOM_PPLIB_R600_FLAGS_LOWPOWER 32 // On the RV770 use 'low power' setting (sequencer S0).
  287. typedef struct _ATOM_PPLIB_RS780_CLOCK_INFO
  288. {
  289. USHORT usLowEngineClockLow; // Low Engine clock in MHz (the same way as on the R600).
  290. UCHAR ucLowEngineClockHigh;
  291. USHORT usHighEngineClockLow; // High Engine clock in MHz.
  292. UCHAR ucHighEngineClockHigh;
  293. USHORT usMemoryClockLow; // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants.
  294. UCHAR ucMemoryClockHigh; // Currentyl unused.
  295. UCHAR ucPadding; // For proper alignment and size.
  296. USHORT usVDDC; // For the 780, use: None, Low, High, Variable
  297. UCHAR ucMaxHTLinkWidth; // From SBIOS - {2, 4, 8, 16}
  298. UCHAR ucMinHTLinkWidth; // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could
  299. USHORT usHTLinkFreq; // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200).
  300. ULONG ulFlags;
  301. } ATOM_PPLIB_RS780_CLOCK_INFO;
  302. #define ATOM_PPLIB_RS780_VOLTAGE_NONE 0
  303. #define ATOM_PPLIB_RS780_VOLTAGE_LOW 1
  304. #define ATOM_PPLIB_RS780_VOLTAGE_HIGH 2
  305. #define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE 3
  306. #define ATOM_PPLIB_RS780_SPMCLK_NONE 0 // We cannot change the side port memory clock, leave it as it is.
  307. #define ATOM_PPLIB_RS780_SPMCLK_LOW 1
  308. #define ATOM_PPLIB_RS780_SPMCLK_HIGH 2
  309. #define ATOM_PPLIB_RS780_HTLINKFREQ_NONE 0
  310. #define ATOM_PPLIB_RS780_HTLINKFREQ_LOW 1
  311. #define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH 2
  312. typedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO
  313. {
  314. USHORT usEngineClockLow;
  315. UCHAR ucEngineClockHigh;
  316. USHORT usMemoryClockLow;
  317. UCHAR ucMemoryClockHigh;
  318. USHORT usVDDC;
  319. USHORT usVDDCI;
  320. USHORT usUnused;
  321. ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
  322. } ATOM_PPLIB_EVERGREEN_CLOCK_INFO;
  323. typedef struct _ATOM_PPLIB_SI_CLOCK_INFO
  324. {
  325. USHORT usEngineClockLow;
  326. UCHAR ucEngineClockHigh;
  327. USHORT usMemoryClockLow;
  328. UCHAR ucMemoryClockHigh;
  329. USHORT usVDDC;
  330. USHORT usVDDCI;
  331. UCHAR ucPCIEGen;
  332. UCHAR ucUnused1;
  333. ULONG ulFlags; // ATOM_PPLIB_SI_FLAGS_*, no flag is necessary for now
  334. } ATOM_PPLIB_SI_CLOCK_INFO;
  335. typedef struct _ATOM_PPLIB_CI_CLOCK_INFO
  336. {
  337. USHORT usEngineClockLow;
  338. UCHAR ucEngineClockHigh;
  339. USHORT usMemoryClockLow;
  340. UCHAR ucMemoryClockHigh;
  341. UCHAR ucPCIEGen;
  342. USHORT usPCIELane;
  343. } ATOM_PPLIB_CI_CLOCK_INFO;
  344. typedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{
  345. USHORT usEngineClockLow; //clockfrequency & 0xFFFF. The unit is in 10khz
  346. UCHAR ucEngineClockHigh; //clockfrequency >> 16.
  347. UCHAR vddcIndex; //2-bit vddc index;
  348. USHORT tdpLimit;
  349. //please initalize to 0
  350. USHORT rsv1;
  351. //please initialize to 0s
  352. ULONG rsv2[2];
  353. }ATOM_PPLIB_SUMO_CLOCK_INFO;
  354. typedef struct _ATOM_PPLIB_CZ_CLOCK_INFO {
  355. UCHAR index;
  356. UCHAR rsv[3];
  357. } ATOM_PPLIB_CZ_CLOCK_INFO;
  358. typedef struct _ATOM_PPLIB_STATE_V2
  359. {
  360. //number of valid dpm levels in this state; Driver uses it to calculate the whole
  361. //size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR)
  362. UCHAR ucNumDPMLevels;
  363. //a index to the array of nonClockInfos
  364. UCHAR nonClockInfoIndex;
  365. /**
  366. * Driver will read the first ucNumDPMLevels in this array
  367. */
  368. UCHAR clockInfoIndex[1];
  369. } ATOM_PPLIB_STATE_V2;
  370. typedef struct _StateArray{
  371. //how many states we have
  372. UCHAR ucNumEntries;
  373. ATOM_PPLIB_STATE_V2 states[1];
  374. }StateArray;
  375. typedef struct _ClockInfoArray{
  376. //how many clock levels we have
  377. UCHAR ucNumEntries;
  378. //sizeof(ATOM_PPLIB_CLOCK_INFO)
  379. UCHAR ucEntrySize;
  380. UCHAR clockInfo[1];
  381. }ClockInfoArray;
  382. typedef struct _NonClockInfoArray{
  383. //how many non-clock levels we have. normally should be same as number of states
  384. UCHAR ucNumEntries;
  385. //sizeof(ATOM_PPLIB_NONCLOCK_INFO)
  386. UCHAR ucEntrySize;
  387. ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1];
  388. }NonClockInfoArray;
  389. typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record
  390. {
  391. USHORT usClockLow;
  392. UCHAR ucClockHigh;
  393. USHORT usVoltage;
  394. }ATOM_PPLIB_Clock_Voltage_Dependency_Record;
  395. typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table
  396. {
  397. UCHAR ucNumEntries; // Number of entries.
  398. ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1]; // Dynamically allocate entries.
  399. }ATOM_PPLIB_Clock_Voltage_Dependency_Table;
  400. typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record
  401. {
  402. USHORT usSclkLow;
  403. UCHAR ucSclkHigh;
  404. USHORT usMclkLow;
  405. UCHAR ucMclkHigh;
  406. USHORT usVddc;
  407. USHORT usVddci;
  408. }ATOM_PPLIB_Clock_Voltage_Limit_Record;
  409. typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table
  410. {
  411. UCHAR ucNumEntries; // Number of entries.
  412. ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1]; // Dynamically allocate entries.
  413. }ATOM_PPLIB_Clock_Voltage_Limit_Table;
  414. union _ATOM_PPLIB_CAC_Leakage_Record
  415. {
  416. struct
  417. {
  418. 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
  419. ULONG ulLeakageValue; // For CI and newer we use this as the "fake" standar VDDC value. in CI we read it as StdVoltageLoSidd
  420. };
  421. struct
  422. {
  423. USHORT usVddc1;
  424. USHORT usVddc2;
  425. USHORT usVddc3;
  426. };
  427. };
  428. typedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record;
  429. typedef struct _ATOM_PPLIB_CAC_Leakage_Table
  430. {
  431. UCHAR ucNumEntries; // Number of entries.
  432. ATOM_PPLIB_CAC_Leakage_Record entries[1]; // Dynamically allocate entries.
  433. }ATOM_PPLIB_CAC_Leakage_Table;
  434. typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record
  435. {
  436. USHORT usVoltage;
  437. USHORT usSclkLow;
  438. UCHAR ucSclkHigh;
  439. USHORT usMclkLow;
  440. UCHAR ucMclkHigh;
  441. }ATOM_PPLIB_PhaseSheddingLimits_Record;
  442. typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table
  443. {
  444. UCHAR ucNumEntries; // Number of entries.
  445. ATOM_PPLIB_PhaseSheddingLimits_Record entries[1]; // Dynamically allocate entries.
  446. }ATOM_PPLIB_PhaseSheddingLimits_Table;
  447. typedef struct _VCEClockInfo{
  448. USHORT usEVClkLow;
  449. UCHAR ucEVClkHigh;
  450. USHORT usECClkLow;
  451. UCHAR ucECClkHigh;
  452. }VCEClockInfo;
  453. typedef struct _VCEClockInfoArray{
  454. UCHAR ucNumEntries;
  455. VCEClockInfo entries[1];
  456. }VCEClockInfoArray;
  457. typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record
  458. {
  459. USHORT usVoltage;
  460. UCHAR ucVCEClockInfoIndex;
  461. }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record;
  462. typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table
  463. {
  464. UCHAR numEntries;
  465. ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[1];
  466. }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table;
  467. typedef struct _ATOM_PPLIB_VCE_State_Record
  468. {
  469. UCHAR ucVCEClockInfoIndex;
  470. UCHAR ucClockInfoIndex; //highest 2 bits indicates memory p-states, lower 6bits indicates index to ClockInfoArrary
  471. }ATOM_PPLIB_VCE_State_Record;
  472. typedef struct _ATOM_PPLIB_VCE_State_Table
  473. {
  474. UCHAR numEntries;
  475. ATOM_PPLIB_VCE_State_Record entries[1];
  476. }ATOM_PPLIB_VCE_State_Table;
  477. typedef struct _ATOM_PPLIB_VCE_Table
  478. {
  479. UCHAR revid;
  480. // VCEClockInfoArray array;
  481. // ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table limits;
  482. // ATOM_PPLIB_VCE_State_Table states;
  483. }ATOM_PPLIB_VCE_Table;
  484. typedef struct _UVDClockInfo{
  485. USHORT usVClkLow;
  486. UCHAR ucVClkHigh;
  487. USHORT usDClkLow;
  488. UCHAR ucDClkHigh;
  489. }UVDClockInfo;
  490. typedef struct _UVDClockInfoArray{
  491. UCHAR ucNumEntries;
  492. UVDClockInfo entries[1];
  493. }UVDClockInfoArray;
  494. typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record
  495. {
  496. USHORT usVoltage;
  497. UCHAR ucUVDClockInfoIndex;
  498. }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record;
  499. typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table
  500. {
  501. UCHAR numEntries;
  502. ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[1];
  503. }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table;
  504. typedef struct _ATOM_PPLIB_UVD_Table
  505. {
  506. UCHAR revid;
  507. // UVDClockInfoArray array;
  508. // ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table limits;
  509. }ATOM_PPLIB_UVD_Table;
  510. typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record
  511. {
  512. USHORT usVoltage;
  513. USHORT usSAMClockLow;
  514. UCHAR ucSAMClockHigh;
  515. }ATOM_PPLIB_SAMClk_Voltage_Limit_Record;
  516. typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{
  517. UCHAR numEntries;
  518. ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[1];
  519. }ATOM_PPLIB_SAMClk_Voltage_Limit_Table;
  520. typedef struct _ATOM_PPLIB_SAMU_Table
  521. {
  522. UCHAR revid;
  523. ATOM_PPLIB_SAMClk_Voltage_Limit_Table limits;
  524. }ATOM_PPLIB_SAMU_Table;
  525. typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record
  526. {
  527. USHORT usVoltage;
  528. USHORT usACPClockLow;
  529. UCHAR ucACPClockHigh;
  530. }ATOM_PPLIB_ACPClk_Voltage_Limit_Record;
  531. typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{
  532. UCHAR numEntries;
  533. ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[1];
  534. }ATOM_PPLIB_ACPClk_Voltage_Limit_Table;
  535. typedef struct _ATOM_PPLIB_ACP_Table
  536. {
  537. UCHAR revid;
  538. ATOM_PPLIB_ACPClk_Voltage_Limit_Table limits;
  539. }ATOM_PPLIB_ACP_Table;
  540. typedef struct _ATOM_PowerTune_Table{
  541. USHORT usTDP;
  542. USHORT usConfigurableTDP;
  543. USHORT usTDC;
  544. USHORT usBatteryPowerLimit;
  545. USHORT usSmallPowerLimit;
  546. USHORT usLowCACLeakage;
  547. USHORT usHighCACLeakage;
  548. }ATOM_PowerTune_Table;
  549. typedef struct _ATOM_PPLIB_POWERTUNE_Table
  550. {
  551. UCHAR revid;
  552. ATOM_PowerTune_Table power_tune_table;
  553. }ATOM_PPLIB_POWERTUNE_Table;
  554. typedef struct _ATOM_PPLIB_POWERTUNE_Table_V1
  555. {
  556. UCHAR revid;
  557. ATOM_PowerTune_Table power_tune_table;
  558. USHORT usMaximumPowerDeliveryLimit;
  559. USHORT usReserve[7];
  560. } ATOM_PPLIB_POWERTUNE_Table_V1;
  561. #define ATOM_PPM_A_A 1
  562. #define ATOM_PPM_A_I 2
  563. typedef struct _ATOM_PPLIB_PPM_Table
  564. {
  565. UCHAR ucRevId;
  566. UCHAR ucPpmDesign; //A+I or A+A
  567. USHORT usCpuCoreNumber;
  568. ULONG ulPlatformTDP;
  569. ULONG ulSmallACPlatformTDP;
  570. ULONG ulPlatformTDC;
  571. ULONG ulSmallACPlatformTDC;
  572. ULONG ulApuTDP;
  573. ULONG ulDGpuTDP;
  574. ULONG ulDGpuUlvPower;
  575. ULONG ulTjmax;
  576. } ATOM_PPLIB_PPM_Table;
  577. #pragma pack()
  578. #endif