pptable.h 27 KB

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