pptable.h 25 KB

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