pptable.h 25 KB

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