xref: /openbsd-src/sys/dev/pci/drm/amd/include/pptable.h (revision 7095acedb239a3cd523d421b3bd960eb776c15e0)
1fb4d8502Sjsg /*
2fb4d8502Sjsg  * Copyright 2013 Advanced Micro Devices, Inc.
3fb4d8502Sjsg  *
4fb4d8502Sjsg  * Permission is hereby granted, free of charge, to any person obtaining a
5fb4d8502Sjsg  * copy of this software and associated documentation files (the "Software"),
6fb4d8502Sjsg  * to deal in the Software without restriction, including without limitation
7fb4d8502Sjsg  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8fb4d8502Sjsg  * and/or sell copies of the Software, and to permit persons to whom the
9fb4d8502Sjsg  * Software is furnished to do so, subject to the following conditions:
10fb4d8502Sjsg  *
11fb4d8502Sjsg  * The above copyright notice and this permission notice shall be included in
12fb4d8502Sjsg  * all copies or substantial portions of the Software.
13fb4d8502Sjsg  *
14fb4d8502Sjsg  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15fb4d8502Sjsg  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16fb4d8502Sjsg  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17fb4d8502Sjsg  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18fb4d8502Sjsg  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19fb4d8502Sjsg  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20fb4d8502Sjsg  * OTHER DEALINGS IN THE SOFTWARE.
21fb4d8502Sjsg  */
22fb4d8502Sjsg 
23fb4d8502Sjsg #ifndef _PPTABLE_H
24fb4d8502Sjsg #define _PPTABLE_H
25fb4d8502Sjsg 
26fb4d8502Sjsg #pragma pack(1)
27fb4d8502Sjsg 
28fb4d8502Sjsg typedef struct _ATOM_PPLIB_THERMALCONTROLLER
29fb4d8502Sjsg 
30fb4d8502Sjsg {
31fb4d8502Sjsg     UCHAR ucType;           // one of ATOM_PP_THERMALCONTROLLER_*
32fb4d8502Sjsg     UCHAR ucI2cLine;        // as interpreted by DAL I2C
33fb4d8502Sjsg     UCHAR ucI2cAddress;
34fb4d8502Sjsg     UCHAR ucFanParameters;  // Fan Control Parameters.
35fb4d8502Sjsg     UCHAR ucFanMinRPM;      // Fan Minimum RPM (hundreds) -- for display purposes only.
36fb4d8502Sjsg     UCHAR ucFanMaxRPM;      // Fan Maximum RPM (hundreds) -- for display purposes only.
37fb4d8502Sjsg     UCHAR ucReserved;       // ----
38fb4d8502Sjsg     UCHAR ucFlags;          // to be defined
39fb4d8502Sjsg } ATOM_PPLIB_THERMALCONTROLLER;
40fb4d8502Sjsg 
41fb4d8502Sjsg #define ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f
42fb4d8502Sjsg #define ATOM_PP_FANPARAMETERS_NOFAN                                 0x80    // No fan is connected to this controller.
43fb4d8502Sjsg 
44fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_NONE      0
45fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_LM63      1  // Not used by PPLib
46fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_ADM1032   2  // Not used by PPLib
47fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_ADM1030   3  // Not used by PPLib
48fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_MUA6649   4  // Not used by PPLib
49fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_LM64      5
50fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_F75375    6  // Not used by PPLib
51fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_RV6xx     7
52fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_RV770     8
53fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_ADT7473   9
54fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_KONG      10
55fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO     11
56fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_EVERGREEN 12
57fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_EMC2103   13  /* 0x0D */ // Only fan control will be implemented, do NOT show this in PPGen.
58fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_SUMO      14  /* 0x0E */ // Sumo type, used internally
59fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_NISLANDS  15
60fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_SISLANDS  16
61fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_LM96163   17
62fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_CISLANDS  18
63fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_KAVERI    19
64fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_ICELAND   20
65fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_TONGA     21
66fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_FIJI      22
67fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_POLARIS10 23
68fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_VEGA10    24
69fb4d8502Sjsg 
70fb4d8502Sjsg 
71fb4d8502Sjsg // Thermal controller 'combo type' to use an external controller for Fan control and an internal controller for thermal.
72fb4d8502Sjsg // We probably should reserve the bit 0x80 for this use.
73fb4d8502Sjsg // 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).
74fb4d8502Sjsg // The driver can pick the correct internal controller based on the ASIC.
75fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL   0x89    // ADT7473 Fan Control + Internal Thermal Controller
76fb4d8502Sjsg #define ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL   0x8D    // EMC2103 Fan Control + Internal Thermal Controller
77fb4d8502Sjsg 
78fb4d8502Sjsg typedef struct _ATOM_PPLIB_STATE
79fb4d8502Sjsg {
80fb4d8502Sjsg     UCHAR ucNonClockStateIndex;
81*7095acedSjsg     UCHAR ucClockStateIndices[]; // variable-sized
82fb4d8502Sjsg } ATOM_PPLIB_STATE;
83fb4d8502Sjsg 
84fb4d8502Sjsg 
85fb4d8502Sjsg typedef struct _ATOM_PPLIB_FANTABLE
86fb4d8502Sjsg {
87fb4d8502Sjsg     UCHAR   ucFanTableFormat;                // Change this if the table format changes or version changes so that the other fields are not the same.
88fb4d8502Sjsg     UCHAR   ucTHyst;                         // Temperature hysteresis. Integer.
89fb4d8502Sjsg     USHORT  usTMin;                          // The temperature, in 0.01 centigrades, below which we just run at a minimal PWM.
90fb4d8502Sjsg     USHORT  usTMed;                          // The middle temperature where we change slopes.
91fb4d8502Sjsg     USHORT  usTHigh;                         // The high point above TMed for adjusting the second slope.
92fb4d8502Sjsg     USHORT  usPWMMin;                        // The minimum PWM value in percent (0.01% increments).
93fb4d8502Sjsg     USHORT  usPWMMed;                        // The PWM value (in percent) at TMed.
94fb4d8502Sjsg     USHORT  usPWMHigh;                       // The PWM value at THigh.
95fb4d8502Sjsg } ATOM_PPLIB_FANTABLE;
96fb4d8502Sjsg 
97fb4d8502Sjsg typedef struct _ATOM_PPLIB_FANTABLE2
98fb4d8502Sjsg {
99fb4d8502Sjsg     ATOM_PPLIB_FANTABLE basicTable;
100fb4d8502Sjsg     USHORT  usTMax;                          // The max temperature
101fb4d8502Sjsg } ATOM_PPLIB_FANTABLE2;
102fb4d8502Sjsg 
103fb4d8502Sjsg typedef struct _ATOM_PPLIB_FANTABLE3
104fb4d8502Sjsg {
105fb4d8502Sjsg 	ATOM_PPLIB_FANTABLE2 basicTable2;
106fb4d8502Sjsg 	UCHAR ucFanControlMode;
107fb4d8502Sjsg 	USHORT usFanPWMMax;
108fb4d8502Sjsg 	USHORT usFanOutputSensitivity;
109fb4d8502Sjsg } ATOM_PPLIB_FANTABLE3;
110fb4d8502Sjsg 
111fb4d8502Sjsg typedef struct _ATOM_PPLIB_FANTABLE4
112fb4d8502Sjsg {
113fb4d8502Sjsg     ATOM_PPLIB_FANTABLE3 basicTable3;
114fb4d8502Sjsg     USHORT  usFanRPMMax;
115fb4d8502Sjsg } ATOM_PPLIB_FANTABLE4;
116fb4d8502Sjsg 
117fb4d8502Sjsg typedef struct _ATOM_PPLIB_FANTABLE5
118fb4d8502Sjsg {
119fb4d8502Sjsg     ATOM_PPLIB_FANTABLE4 basicTable4;
120fb4d8502Sjsg     USHORT  usFanCurrentLow;
121fb4d8502Sjsg     USHORT  usFanCurrentHigh;
122fb4d8502Sjsg     USHORT  usFanRPMLow;
123fb4d8502Sjsg     USHORT  usFanRPMHigh;
124fb4d8502Sjsg } ATOM_PPLIB_FANTABLE5;
125fb4d8502Sjsg 
126fb4d8502Sjsg typedef struct _ATOM_PPLIB_EXTENDEDHEADER
127fb4d8502Sjsg {
128fb4d8502Sjsg     USHORT  usSize;
129fb4d8502Sjsg     ULONG   ulMaxEngineClock;   // For Overdrive.
130fb4d8502Sjsg     ULONG   ulMaxMemoryClock;   // For Overdrive.
131fb4d8502Sjsg     // Add extra system parameters here, always adjust size to include all fields.
132fb4d8502Sjsg     USHORT  usVCETableOffset; //points to ATOM_PPLIB_VCE_Table
133fb4d8502Sjsg     USHORT  usUVDTableOffset;   //points to ATOM_PPLIB_UVD_Table
134fb4d8502Sjsg     USHORT  usSAMUTableOffset;  //points to ATOM_PPLIB_SAMU_Table
135fb4d8502Sjsg     USHORT  usPPMTableOffset;   //points to ATOM_PPLIB_PPM_Table
136fb4d8502Sjsg     USHORT  usACPTableOffset;  //points to ATOM_PPLIB_ACP_Table
137fb4d8502Sjsg     /* points to ATOM_PPLIB_POWERTUNE_Table */
138fb4d8502Sjsg     USHORT  usPowerTuneTableOffset;
139fb4d8502Sjsg     /* points to ATOM_PPLIB_CLOCK_Voltage_Dependency_Table for sclkVddgfxTable */
140fb4d8502Sjsg     USHORT  usSclkVddgfxTableOffset;
141fb4d8502Sjsg     USHORT  usVQBudgetingTableOffset; /* points to the vqBudgetingTable; */
142fb4d8502Sjsg } ATOM_PPLIB_EXTENDEDHEADER;
143fb4d8502Sjsg 
144fb4d8502Sjsg //// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps
145fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_BACKBIAS 1
146fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_POWERPLAY 2
147fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4
148fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8
149fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_ASPM_L1 16
150fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32
151fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64
152fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_STEPVDDC 128
153fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256
154fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512
155fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024
156fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048
157fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096
158fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000              // Go to boot state on alerts, e.g. on an AC->DC transition.
159fb4d8502Sjsg #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).
160fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000                   // Does the driver control VDDCI independently from VDDC.
161fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000               // Enable the 'regulator hot' feature.
162fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_BACO          0x00020000               // Does the driver supports BACO state.
163fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_NEW_CAC_VOLTAGE   0x00040000           // Does the driver supports new CAC voltage table.
164fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY   0x00080000     // Does the driver supports revert GPIO5 polarity.
165fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_OUTPUT_THERMAL2GPIO17   0x00100000     // Does the driver supports thermal2GPIO17.
166fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_VRHOT_GPIO_CONFIGURABLE   0x00200000   // Does the driver supports VR HOT GPIO Configurable.
167fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_TEMP_INVERSION   0x00400000            // Does the driver supports Temp Inversion feature.
168fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_EVV    0x00800000
169fb4d8502Sjsg #define ATOM_PP_PLATFORM_COMBINE_PCC_WITH_THERMAL_SIGNAL    0x01000000
170fb4d8502Sjsg #define ATOM_PP_PLATFORM_LOAD_POST_PRODUCTION_FIRMWARE    0x02000000
171fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_DISABLE_USING_ACTUAL_TEMPERATURE_FOR_POWER_CALC   0x04000000
172fb4d8502Sjsg #define ATOM_PP_PLATFORM_CAP_VRHOT_POLARITY_HIGH   0x08000000
173fb4d8502Sjsg 
174fb4d8502Sjsg typedef struct _ATOM_PPLIB_POWERPLAYTABLE
175fb4d8502Sjsg {
176fb4d8502Sjsg       ATOM_COMMON_TABLE_HEADER sHeader;
177fb4d8502Sjsg 
178fb4d8502Sjsg       UCHAR ucDataRevision;
179fb4d8502Sjsg 
180fb4d8502Sjsg       UCHAR ucNumStates;
181fb4d8502Sjsg       UCHAR ucStateEntrySize;
182fb4d8502Sjsg       UCHAR ucClockInfoSize;
183fb4d8502Sjsg       UCHAR ucNonClockSize;
184fb4d8502Sjsg 
185fb4d8502Sjsg       // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures
186fb4d8502Sjsg       USHORT usStateArrayOffset;
187fb4d8502Sjsg 
188fb4d8502Sjsg       // offset from start of this table to array of ASIC-specific structures,
189fb4d8502Sjsg       // currently ATOM_PPLIB_CLOCK_INFO.
190fb4d8502Sjsg       USHORT usClockInfoArrayOffset;
191fb4d8502Sjsg 
192fb4d8502Sjsg       // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO
193fb4d8502Sjsg       USHORT usNonClockInfoArrayOffset;
194fb4d8502Sjsg 
195fb4d8502Sjsg       USHORT usBackbiasTime;    // in microseconds
196fb4d8502Sjsg       USHORT usVoltageTime;     // in microseconds
197fb4d8502Sjsg       USHORT usTableSize;       //the size of this structure, or the extended structure
198fb4d8502Sjsg 
199fb4d8502Sjsg       ULONG ulPlatformCaps;            // See ATOM_PPLIB_CAPS_*
200fb4d8502Sjsg 
201fb4d8502Sjsg       ATOM_PPLIB_THERMALCONTROLLER    sThermalController;
202fb4d8502Sjsg 
203fb4d8502Sjsg       USHORT usBootClockInfoOffset;
204fb4d8502Sjsg       USHORT usBootNonClockInfoOffset;
205fb4d8502Sjsg 
206fb4d8502Sjsg } ATOM_PPLIB_POWERPLAYTABLE;
207fb4d8502Sjsg 
208fb4d8502Sjsg typedef struct _ATOM_PPLIB_POWERPLAYTABLE2
209fb4d8502Sjsg {
210fb4d8502Sjsg     ATOM_PPLIB_POWERPLAYTABLE basicTable;
211fb4d8502Sjsg     UCHAR   ucNumCustomThermalPolicy;
212fb4d8502Sjsg     USHORT  usCustomThermalPolicyArrayOffset;
213fb4d8502Sjsg }ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2;
214fb4d8502Sjsg 
215fb4d8502Sjsg typedef struct _ATOM_PPLIB_POWERPLAYTABLE3
216fb4d8502Sjsg {
217fb4d8502Sjsg     ATOM_PPLIB_POWERPLAYTABLE2 basicTable2;
218fb4d8502Sjsg     USHORT                     usFormatID;                      // To be used ONLY by PPGen.
219fb4d8502Sjsg     USHORT                     usFanTableOffset;
220fb4d8502Sjsg     USHORT                     usExtendendedHeaderOffset;
221fb4d8502Sjsg } ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3;
222fb4d8502Sjsg 
223fb4d8502Sjsg typedef struct _ATOM_PPLIB_POWERPLAYTABLE4
224fb4d8502Sjsg {
225fb4d8502Sjsg     ATOM_PPLIB_POWERPLAYTABLE3 basicTable3;
226fb4d8502Sjsg     ULONG                      ulGoldenPPID;                    // PPGen use only
227fb4d8502Sjsg     ULONG                      ulGoldenRevision;                // PPGen use only
228fb4d8502Sjsg     USHORT                     usVddcDependencyOnSCLKOffset;
229fb4d8502Sjsg     USHORT                     usVddciDependencyOnMCLKOffset;
230fb4d8502Sjsg     USHORT                     usVddcDependencyOnMCLKOffset;
231fb4d8502Sjsg     USHORT                     usMaxClockVoltageOnDCOffset;
232fb4d8502Sjsg     USHORT                     usVddcPhaseShedLimitsTableOffset;    // Points to ATOM_PPLIB_PhaseSheddingLimits_Table
233fb4d8502Sjsg     USHORT                     usMvddDependencyOnMCLKOffset;
234fb4d8502Sjsg } ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4;
235fb4d8502Sjsg 
236fb4d8502Sjsg typedef struct _ATOM_PPLIB_POWERPLAYTABLE5
237fb4d8502Sjsg {
238fb4d8502Sjsg     ATOM_PPLIB_POWERPLAYTABLE4 basicTable4;
239fb4d8502Sjsg     ULONG                      ulTDPLimit;
240fb4d8502Sjsg     ULONG                      ulNearTDPLimit;
241fb4d8502Sjsg     ULONG                      ulSQRampingThreshold;
242fb4d8502Sjsg     USHORT                     usCACLeakageTableOffset;         // Points to ATOM_PPLIB_CAC_Leakage_Table
243fb4d8502Sjsg     ULONG                      ulCACLeakage;                    // The iLeakage for driver calculated CAC leakage table
244fb4d8502Sjsg     USHORT                     usTDPODLimit;
245fb4d8502Sjsg     USHORT                     usLoadLineSlope;                 // in milliOhms * 100
246fb4d8502Sjsg } ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5;
247fb4d8502Sjsg 
248fb4d8502Sjsg //// ATOM_PPLIB_NONCLOCK_INFO::usClassification
249fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_UI_MASK          0x0007
250fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT         0
251fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_UI_NONE          0
252fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY       1
253fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED      3
254fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE   5
255fb4d8502Sjsg // 2, 4, 6, 7 are reserved
256fb4d8502Sjsg 
257fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_BOOT                   0x0008
258fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_THERMAL                0x0010
259fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE     0x0020
260fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_REST                   0x0040
261fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_FORCED                 0x0080
262fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE          0x0100
263fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE      0x0200
264fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_UVDSTATE               0x0400
265fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_3DLOW                  0x0800
266fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_ACPI                   0x1000
267fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_HD2STATE               0x2000
268fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_HDSTATE                0x4000
269fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION_SDSTATE                0x8000
270fb4d8502Sjsg 
271fb4d8502Sjsg //// ATOM_PPLIB_NONCLOCK_INFO::usClassification2
272fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2     0x0001
273fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION2_ULV                      0x0002
274fb4d8502Sjsg #define ATOM_PPLIB_CLASSIFICATION2_MVC                      0x0004   //Multi-View Codec (BD-3D)
275fb4d8502Sjsg 
276fb4d8502Sjsg //// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings
277fb4d8502Sjsg #define ATOM_PPLIB_SINGLE_DISPLAY_ONLY           0x00000001
278fb4d8502Sjsg #define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK         0x00000002
279fb4d8502Sjsg 
280fb4d8502Sjsg // 0 is 2.5Gb/s, 1 is 5Gb/s
281fb4d8502Sjsg #define ATOM_PPLIB_PCIE_LINK_SPEED_MASK            0x00000004
282fb4d8502Sjsg #define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT           2
283fb4d8502Sjsg 
284fb4d8502Sjsg // lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec
285fb4d8502Sjsg #define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK            0x000000F8
286fb4d8502Sjsg #define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT           3
287fb4d8502Sjsg 
288fb4d8502Sjsg // lookup into reduced refresh-rate table
289fb4d8502Sjsg #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK  0x00000F00
290fb4d8502Sjsg #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8
291fb4d8502Sjsg 
292fb4d8502Sjsg #define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED    0
293fb4d8502Sjsg #define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ         1
294fb4d8502Sjsg // 2-15 TBD as needed.
295fb4d8502Sjsg 
296fb4d8502Sjsg #define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING        0x00001000
297fb4d8502Sjsg #define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS  0x00002000
298fb4d8502Sjsg 
299fb4d8502Sjsg #define ATOM_PPLIB_DISALLOW_ON_DC                       0x00004000
300fb4d8502Sjsg 
301fb4d8502Sjsg #define ATOM_PPLIB_ENABLE_VARIBRIGHT                     0x00008000
302fb4d8502Sjsg 
303fb4d8502Sjsg //memory related flags
304fb4d8502Sjsg #define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF               0x000010000
305fb4d8502Sjsg 
306fb4d8502Sjsg //M3 Arb    //2bits, current 3 sets of parameters in total
307fb4d8502Sjsg #define ATOM_PPLIB_M3ARB_MASK                       0x00060000
308fb4d8502Sjsg #define ATOM_PPLIB_M3ARB_SHIFT                      17
309fb4d8502Sjsg 
310fb4d8502Sjsg #define ATOM_PPLIB_ENABLE_DRR                       0x00080000
311fb4d8502Sjsg 
312fb4d8502Sjsg // remaining 16 bits are reserved
313fb4d8502Sjsg typedef struct _ATOM_PPLIB_THERMAL_STATE
314fb4d8502Sjsg {
315fb4d8502Sjsg     UCHAR   ucMinTemperature;
316fb4d8502Sjsg     UCHAR   ucMaxTemperature;
317fb4d8502Sjsg     UCHAR   ucThermalAction;
318fb4d8502Sjsg }ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE;
319fb4d8502Sjsg 
320fb4d8502Sjsg // Contained in an array starting at the offset
321fb4d8502Sjsg // in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset.
322fb4d8502Sjsg // referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex
323fb4d8502Sjsg #define ATOM_PPLIB_NONCLOCKINFO_VER1      12
324fb4d8502Sjsg #define ATOM_PPLIB_NONCLOCKINFO_VER2      24
325fb4d8502Sjsg typedef struct _ATOM_PPLIB_NONCLOCK_INFO
326fb4d8502Sjsg {
327fb4d8502Sjsg       USHORT usClassification;
328fb4d8502Sjsg       UCHAR  ucMinTemperature;
329fb4d8502Sjsg       UCHAR  ucMaxTemperature;
330fb4d8502Sjsg       ULONG  ulCapsAndSettings;
331fb4d8502Sjsg       UCHAR  ucRequiredPower;
332fb4d8502Sjsg       USHORT usClassification2;
333fb4d8502Sjsg       ULONG  ulVCLK;
334fb4d8502Sjsg       ULONG  ulDCLK;
335fb4d8502Sjsg       UCHAR  ucUnused[5];
336fb4d8502Sjsg } ATOM_PPLIB_NONCLOCK_INFO;
337fb4d8502Sjsg 
338fb4d8502Sjsg // Contained in an array starting at the offset
339fb4d8502Sjsg // in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset.
340fb4d8502Sjsg // referenced from ATOM_PPLIB_STATE::ucClockStateIndices
341fb4d8502Sjsg typedef struct _ATOM_PPLIB_R600_CLOCK_INFO
342fb4d8502Sjsg {
343fb4d8502Sjsg       USHORT usEngineClockLow;
344fb4d8502Sjsg       UCHAR ucEngineClockHigh;
345fb4d8502Sjsg 
346fb4d8502Sjsg       USHORT usMemoryClockLow;
347fb4d8502Sjsg       UCHAR ucMemoryClockHigh;
348fb4d8502Sjsg 
349fb4d8502Sjsg       USHORT usVDDC;
350fb4d8502Sjsg       USHORT usUnused1;
351fb4d8502Sjsg       USHORT usUnused2;
352fb4d8502Sjsg 
353fb4d8502Sjsg       ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
354fb4d8502Sjsg 
355fb4d8502Sjsg } ATOM_PPLIB_R600_CLOCK_INFO;
356fb4d8502Sjsg 
357fb4d8502Sjsg // ulFlags in ATOM_PPLIB_R600_CLOCK_INFO
358fb4d8502Sjsg #define ATOM_PPLIB_R600_FLAGS_PCIEGEN2          1
359fb4d8502Sjsg #define ATOM_PPLIB_R600_FLAGS_UVDSAFE           2
360fb4d8502Sjsg #define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE    4
361fb4d8502Sjsg #define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF    8
362fb4d8502Sjsg #define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF   16
363fb4d8502Sjsg #define ATOM_PPLIB_R600_FLAGS_LOWPOWER         32   // On the RV770 use 'low power' setting (sequencer S0).
364fb4d8502Sjsg 
365fb4d8502Sjsg typedef struct _ATOM_PPLIB_RS780_CLOCK_INFO
366fb4d8502Sjsg 
367fb4d8502Sjsg {
368fb4d8502Sjsg       USHORT usLowEngineClockLow;         // Low Engine clock in MHz (the same way as on the R600).
369fb4d8502Sjsg       UCHAR  ucLowEngineClockHigh;
370fb4d8502Sjsg       USHORT usHighEngineClockLow;        // High Engine clock in MHz.
371fb4d8502Sjsg       UCHAR  ucHighEngineClockHigh;
372fb4d8502Sjsg       USHORT usMemoryClockLow;            // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants.
373fb4d8502Sjsg       UCHAR  ucMemoryClockHigh;           // Currentyl unused.
374fb4d8502Sjsg       UCHAR  ucPadding;                   // For proper alignment and size.
375fb4d8502Sjsg       USHORT usVDDC;                      // For the 780, use: None, Low, High, Variable
376fb4d8502Sjsg       UCHAR  ucMaxHTLinkWidth;            // From SBIOS - {2, 4, 8, 16}
377fb4d8502Sjsg       UCHAR  ucMinHTLinkWidth;            // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could
378fb4d8502Sjsg       USHORT usHTLinkFreq;                // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200).
379fb4d8502Sjsg       ULONG  ulFlags;
380fb4d8502Sjsg } ATOM_PPLIB_RS780_CLOCK_INFO;
381fb4d8502Sjsg 
382fb4d8502Sjsg #define ATOM_PPLIB_RS780_VOLTAGE_NONE       0
383fb4d8502Sjsg #define ATOM_PPLIB_RS780_VOLTAGE_LOW        1
384fb4d8502Sjsg #define ATOM_PPLIB_RS780_VOLTAGE_HIGH       2
385fb4d8502Sjsg #define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE   3
386fb4d8502Sjsg 
387fb4d8502Sjsg #define ATOM_PPLIB_RS780_SPMCLK_NONE        0   // We cannot change the side port memory clock, leave it as it is.
388fb4d8502Sjsg #define ATOM_PPLIB_RS780_SPMCLK_LOW         1
389fb4d8502Sjsg #define ATOM_PPLIB_RS780_SPMCLK_HIGH        2
390fb4d8502Sjsg 
391fb4d8502Sjsg #define ATOM_PPLIB_RS780_HTLINKFREQ_NONE       0
392fb4d8502Sjsg #define ATOM_PPLIB_RS780_HTLINKFREQ_LOW        1
393fb4d8502Sjsg #define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH       2
394fb4d8502Sjsg 
395fb4d8502Sjsg typedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO
396fb4d8502Sjsg {
397fb4d8502Sjsg       USHORT usEngineClockLow;
398fb4d8502Sjsg       UCHAR  ucEngineClockHigh;
399fb4d8502Sjsg 
400fb4d8502Sjsg       USHORT usMemoryClockLow;
401fb4d8502Sjsg       UCHAR  ucMemoryClockHigh;
402fb4d8502Sjsg 
403fb4d8502Sjsg       USHORT usVDDC;
404fb4d8502Sjsg       USHORT usVDDCI;
405fb4d8502Sjsg       USHORT usUnused;
406fb4d8502Sjsg 
407fb4d8502Sjsg       ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
408fb4d8502Sjsg 
409fb4d8502Sjsg } ATOM_PPLIB_EVERGREEN_CLOCK_INFO;
410fb4d8502Sjsg 
411fb4d8502Sjsg typedef struct _ATOM_PPLIB_SI_CLOCK_INFO
412fb4d8502Sjsg {
413fb4d8502Sjsg       USHORT usEngineClockLow;
414fb4d8502Sjsg       UCHAR  ucEngineClockHigh;
415fb4d8502Sjsg 
416fb4d8502Sjsg       USHORT usMemoryClockLow;
417fb4d8502Sjsg       UCHAR  ucMemoryClockHigh;
418fb4d8502Sjsg 
419fb4d8502Sjsg       USHORT usVDDC;
420fb4d8502Sjsg       USHORT usVDDCI;
421fb4d8502Sjsg       UCHAR  ucPCIEGen;
422fb4d8502Sjsg       UCHAR  ucUnused1;
423fb4d8502Sjsg 
424fb4d8502Sjsg       ULONG ulFlags; // ATOM_PPLIB_SI_FLAGS_*, no flag is necessary for now
425fb4d8502Sjsg 
426fb4d8502Sjsg } ATOM_PPLIB_SI_CLOCK_INFO;
427fb4d8502Sjsg 
428fb4d8502Sjsg typedef struct _ATOM_PPLIB_CI_CLOCK_INFO
429fb4d8502Sjsg {
430fb4d8502Sjsg       USHORT usEngineClockLow;
431fb4d8502Sjsg       UCHAR  ucEngineClockHigh;
432fb4d8502Sjsg 
433fb4d8502Sjsg       USHORT usMemoryClockLow;
434fb4d8502Sjsg       UCHAR  ucMemoryClockHigh;
435fb4d8502Sjsg 
436fb4d8502Sjsg       UCHAR  ucPCIEGen;
437fb4d8502Sjsg       USHORT usPCIELane;
438fb4d8502Sjsg } ATOM_PPLIB_CI_CLOCK_INFO;
439fb4d8502Sjsg 
440fb4d8502Sjsg typedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{
441fb4d8502Sjsg       USHORT usEngineClockLow;  //clockfrequency & 0xFFFF. The unit is in 10khz
442fb4d8502Sjsg       UCHAR  ucEngineClockHigh; //clockfrequency >> 16.
443fb4d8502Sjsg       UCHAR  vddcIndex;         //2-bit vddc index;
444fb4d8502Sjsg       USHORT tdpLimit;
445fb4d8502Sjsg       //please initalize to 0
446fb4d8502Sjsg       USHORT rsv1;
447fb4d8502Sjsg       //please initialize to 0s
448fb4d8502Sjsg       ULONG rsv2[2];
449fb4d8502Sjsg }ATOM_PPLIB_SUMO_CLOCK_INFO;
450fb4d8502Sjsg 
451fb4d8502Sjsg typedef struct _ATOM_PPLIB_KV_CLOCK_INFO {
452fb4d8502Sjsg       USHORT usEngineClockLow;
453fb4d8502Sjsg       UCHAR  ucEngineClockHigh;
454fb4d8502Sjsg       UCHAR  vddcIndex;
455fb4d8502Sjsg       USHORT tdpLimit;
456fb4d8502Sjsg       USHORT rsv1;
457fb4d8502Sjsg       ULONG rsv2[2];
458fb4d8502Sjsg } ATOM_PPLIB_KV_CLOCK_INFO;
459fb4d8502Sjsg 
460fb4d8502Sjsg typedef struct _ATOM_PPLIB_CZ_CLOCK_INFO {
461fb4d8502Sjsg       UCHAR index;
462fb4d8502Sjsg       UCHAR rsv[3];
463fb4d8502Sjsg } ATOM_PPLIB_CZ_CLOCK_INFO;
464fb4d8502Sjsg 
465fb4d8502Sjsg typedef struct _ATOM_PPLIB_STATE_V2
466fb4d8502Sjsg {
467fb4d8502Sjsg       //number of valid dpm levels in this state; Driver uses it to calculate the whole
468fb4d8502Sjsg       //size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR)
469fb4d8502Sjsg       UCHAR ucNumDPMLevels;
470fb4d8502Sjsg 
471fb4d8502Sjsg       //a index to the array of nonClockInfos
472fb4d8502Sjsg       UCHAR nonClockInfoIndex;
473fb4d8502Sjsg       /**
474fb4d8502Sjsg       * Driver will read the first ucNumDPMLevels in this array
475fb4d8502Sjsg       */
476*7095acedSjsg       UCHAR clockInfoIndex[];
477fb4d8502Sjsg } ATOM_PPLIB_STATE_V2;
478fb4d8502Sjsg 
479fb4d8502Sjsg typedef struct _StateArray{
480fb4d8502Sjsg     //how many states we have
481fb4d8502Sjsg     UCHAR ucNumEntries;
482fb4d8502Sjsg 
483fb4d8502Sjsg     ATOM_PPLIB_STATE_V2 states[1];
484fb4d8502Sjsg }StateArray;
485fb4d8502Sjsg 
486fb4d8502Sjsg 
487fb4d8502Sjsg typedef struct _ClockInfoArray{
488fb4d8502Sjsg     //how many clock levels we have
489fb4d8502Sjsg     UCHAR ucNumEntries;
490fb4d8502Sjsg 
491fb4d8502Sjsg     //sizeof(ATOM_PPLIB_CLOCK_INFO)
492fb4d8502Sjsg     UCHAR ucEntrySize;
493fb4d8502Sjsg 
494fb4d8502Sjsg     UCHAR clockInfo[1];
495fb4d8502Sjsg }ClockInfoArray;
496fb4d8502Sjsg 
497fb4d8502Sjsg typedef struct _NonClockInfoArray{
498fb4d8502Sjsg 
499fb4d8502Sjsg     //how many non-clock levels we have. normally should be same as number of states
500fb4d8502Sjsg     UCHAR ucNumEntries;
501fb4d8502Sjsg     //sizeof(ATOM_PPLIB_NONCLOCK_INFO)
502fb4d8502Sjsg     UCHAR ucEntrySize;
503fb4d8502Sjsg 
504fb4d8502Sjsg     ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1];
505fb4d8502Sjsg }NonClockInfoArray;
506fb4d8502Sjsg 
507fb4d8502Sjsg typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record
508fb4d8502Sjsg {
509fb4d8502Sjsg     USHORT usClockLow;
510fb4d8502Sjsg     UCHAR  ucClockHigh;
511fb4d8502Sjsg     USHORT usVoltage;
512fb4d8502Sjsg }ATOM_PPLIB_Clock_Voltage_Dependency_Record;
513fb4d8502Sjsg 
514fb4d8502Sjsg typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table
515fb4d8502Sjsg {
516fb4d8502Sjsg     UCHAR ucNumEntries;                                                // Number of entries.
517fb4d8502Sjsg     ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1];             // Dynamically allocate entries.
518fb4d8502Sjsg }ATOM_PPLIB_Clock_Voltage_Dependency_Table;
519fb4d8502Sjsg 
520fb4d8502Sjsg typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record
521fb4d8502Sjsg {
522fb4d8502Sjsg     USHORT usSclkLow;
523fb4d8502Sjsg     UCHAR  ucSclkHigh;
524fb4d8502Sjsg     USHORT usMclkLow;
525fb4d8502Sjsg     UCHAR  ucMclkHigh;
526fb4d8502Sjsg     USHORT usVddc;
527fb4d8502Sjsg     USHORT usVddci;
528fb4d8502Sjsg }ATOM_PPLIB_Clock_Voltage_Limit_Record;
529fb4d8502Sjsg 
530fb4d8502Sjsg typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table
531fb4d8502Sjsg {
532fb4d8502Sjsg     UCHAR ucNumEntries;                                                // Number of entries.
533fb4d8502Sjsg     ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1];                  // Dynamically allocate entries.
534fb4d8502Sjsg }ATOM_PPLIB_Clock_Voltage_Limit_Table;
535fb4d8502Sjsg 
536fb4d8502Sjsg union _ATOM_PPLIB_CAC_Leakage_Record
537fb4d8502Sjsg {
538fb4d8502Sjsg     struct
539fb4d8502Sjsg     {
540fb4d8502Sjsg         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
541fb4d8502Sjsg         ULONG  ulLeakageValue;  // For CI and newer we use this as the "fake" standar VDDC value. in CI we read it as StdVoltageLoSidd
542fb4d8502Sjsg 
543fb4d8502Sjsg     };
544fb4d8502Sjsg     struct
545fb4d8502Sjsg      {
546fb4d8502Sjsg         USHORT usVddc1;
547fb4d8502Sjsg         USHORT usVddc2;
548fb4d8502Sjsg         USHORT usVddc3;
549fb4d8502Sjsg      };
550fb4d8502Sjsg };
551fb4d8502Sjsg 
552fb4d8502Sjsg typedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record;
553fb4d8502Sjsg 
554fb4d8502Sjsg typedef struct _ATOM_PPLIB_CAC_Leakage_Table
555fb4d8502Sjsg {
556fb4d8502Sjsg     UCHAR ucNumEntries;                                                 // Number of entries.
557fb4d8502Sjsg     ATOM_PPLIB_CAC_Leakage_Record entries[1];                           // Dynamically allocate entries.
558fb4d8502Sjsg }ATOM_PPLIB_CAC_Leakage_Table;
559fb4d8502Sjsg 
560fb4d8502Sjsg typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record
561fb4d8502Sjsg {
562fb4d8502Sjsg     USHORT usVoltage;
563fb4d8502Sjsg     USHORT usSclkLow;
564fb4d8502Sjsg     UCHAR  ucSclkHigh;
565fb4d8502Sjsg     USHORT usMclkLow;
566fb4d8502Sjsg     UCHAR  ucMclkHigh;
567fb4d8502Sjsg }ATOM_PPLIB_PhaseSheddingLimits_Record;
568fb4d8502Sjsg 
569fb4d8502Sjsg typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table
570fb4d8502Sjsg {
571fb4d8502Sjsg     UCHAR ucNumEntries;                                                 // Number of entries.
572fb4d8502Sjsg     ATOM_PPLIB_PhaseSheddingLimits_Record entries[1];                   // Dynamically allocate entries.
573fb4d8502Sjsg }ATOM_PPLIB_PhaseSheddingLimits_Table;
574fb4d8502Sjsg 
575fb4d8502Sjsg typedef struct _VCEClockInfo{
576fb4d8502Sjsg     USHORT usEVClkLow;
577fb4d8502Sjsg     UCHAR  ucEVClkHigh;
578fb4d8502Sjsg     USHORT usECClkLow;
579fb4d8502Sjsg     UCHAR  ucECClkHigh;
580fb4d8502Sjsg }VCEClockInfo;
581fb4d8502Sjsg 
582fb4d8502Sjsg typedef struct _VCEClockInfoArray{
583fb4d8502Sjsg     UCHAR ucNumEntries;
584fb4d8502Sjsg     VCEClockInfo entries[1];
585fb4d8502Sjsg }VCEClockInfoArray;
586fb4d8502Sjsg 
587fb4d8502Sjsg typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record
588fb4d8502Sjsg {
589fb4d8502Sjsg     USHORT usVoltage;
590fb4d8502Sjsg     UCHAR  ucVCEClockInfoIndex;
591fb4d8502Sjsg }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record;
592fb4d8502Sjsg 
593fb4d8502Sjsg typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table
594fb4d8502Sjsg {
595fb4d8502Sjsg     UCHAR numEntries;
596fb4d8502Sjsg     ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[1];
597fb4d8502Sjsg }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table;
598fb4d8502Sjsg 
599fb4d8502Sjsg typedef struct _ATOM_PPLIB_VCE_State_Record
600fb4d8502Sjsg {
601fb4d8502Sjsg     UCHAR  ucVCEClockInfoIndex;
602fb4d8502Sjsg     UCHAR  ucClockInfoIndex; //highest 2 bits indicates memory p-states, lower 6bits indicates index to ClockInfoArrary
603fb4d8502Sjsg }ATOM_PPLIB_VCE_State_Record;
604fb4d8502Sjsg 
605fb4d8502Sjsg typedef struct _ATOM_PPLIB_VCE_State_Table
606fb4d8502Sjsg {
607fb4d8502Sjsg     UCHAR numEntries;
608fb4d8502Sjsg     ATOM_PPLIB_VCE_State_Record entries[1];
609fb4d8502Sjsg }ATOM_PPLIB_VCE_State_Table;
610fb4d8502Sjsg 
611fb4d8502Sjsg 
612fb4d8502Sjsg typedef struct _ATOM_PPLIB_VCE_Table
613fb4d8502Sjsg {
614fb4d8502Sjsg       UCHAR revid;
615fb4d8502Sjsg //    VCEClockInfoArray array;
616fb4d8502Sjsg //    ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table limits;
617fb4d8502Sjsg //    ATOM_PPLIB_VCE_State_Table states;
618fb4d8502Sjsg }ATOM_PPLIB_VCE_Table;
619fb4d8502Sjsg 
620fb4d8502Sjsg 
621fb4d8502Sjsg typedef struct _UVDClockInfo{
622fb4d8502Sjsg     USHORT usVClkLow;
623fb4d8502Sjsg     UCHAR  ucVClkHigh;
624fb4d8502Sjsg     USHORT usDClkLow;
625fb4d8502Sjsg     UCHAR  ucDClkHigh;
626fb4d8502Sjsg }UVDClockInfo;
627fb4d8502Sjsg 
628fb4d8502Sjsg typedef struct _UVDClockInfoArray{
629fb4d8502Sjsg     UCHAR ucNumEntries;
630fb4d8502Sjsg     UVDClockInfo entries[1];
631fb4d8502Sjsg }UVDClockInfoArray;
632fb4d8502Sjsg 
633fb4d8502Sjsg typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record
634fb4d8502Sjsg {
635fb4d8502Sjsg     USHORT usVoltage;
636fb4d8502Sjsg     UCHAR  ucUVDClockInfoIndex;
637fb4d8502Sjsg }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record;
638fb4d8502Sjsg 
639fb4d8502Sjsg typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table
640fb4d8502Sjsg {
641fb4d8502Sjsg     UCHAR numEntries;
642fb4d8502Sjsg     ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[1];
643fb4d8502Sjsg }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table;
644fb4d8502Sjsg 
645fb4d8502Sjsg typedef struct _ATOM_PPLIB_UVD_Table
646fb4d8502Sjsg {
647fb4d8502Sjsg       UCHAR revid;
648fb4d8502Sjsg //    UVDClockInfoArray array;
649fb4d8502Sjsg //    ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table limits;
650fb4d8502Sjsg }ATOM_PPLIB_UVD_Table;
651fb4d8502Sjsg 
652fb4d8502Sjsg typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record
653fb4d8502Sjsg {
654fb4d8502Sjsg       USHORT usVoltage;
655fb4d8502Sjsg       USHORT usSAMClockLow;
656fb4d8502Sjsg       UCHAR  ucSAMClockHigh;
657fb4d8502Sjsg }ATOM_PPLIB_SAMClk_Voltage_Limit_Record;
658fb4d8502Sjsg 
659fb4d8502Sjsg typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{
660fb4d8502Sjsg     UCHAR numEntries;
661fb4d8502Sjsg     ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[1];
662fb4d8502Sjsg }ATOM_PPLIB_SAMClk_Voltage_Limit_Table;
663fb4d8502Sjsg 
664fb4d8502Sjsg typedef struct _ATOM_PPLIB_SAMU_Table
665fb4d8502Sjsg {
666fb4d8502Sjsg       UCHAR revid;
667fb4d8502Sjsg       ATOM_PPLIB_SAMClk_Voltage_Limit_Table limits;
668fb4d8502Sjsg }ATOM_PPLIB_SAMU_Table;
669fb4d8502Sjsg 
670fb4d8502Sjsg typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record
671fb4d8502Sjsg {
672fb4d8502Sjsg       USHORT usVoltage;
673fb4d8502Sjsg       USHORT usACPClockLow;
674fb4d8502Sjsg       UCHAR  ucACPClockHigh;
675fb4d8502Sjsg }ATOM_PPLIB_ACPClk_Voltage_Limit_Record;
676fb4d8502Sjsg 
677fb4d8502Sjsg typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{
678fb4d8502Sjsg     UCHAR numEntries;
679fb4d8502Sjsg     ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[1];
680fb4d8502Sjsg }ATOM_PPLIB_ACPClk_Voltage_Limit_Table;
681fb4d8502Sjsg 
682fb4d8502Sjsg typedef struct _ATOM_PPLIB_ACP_Table
683fb4d8502Sjsg {
684fb4d8502Sjsg       UCHAR revid;
685fb4d8502Sjsg       ATOM_PPLIB_ACPClk_Voltage_Limit_Table limits;
686fb4d8502Sjsg }ATOM_PPLIB_ACP_Table;
687fb4d8502Sjsg 
688fb4d8502Sjsg typedef struct _ATOM_PowerTune_Table{
689fb4d8502Sjsg     USHORT usTDP;
690fb4d8502Sjsg     USHORT usConfigurableTDP;
691fb4d8502Sjsg     USHORT usTDC;
692fb4d8502Sjsg     USHORT usBatteryPowerLimit;
693fb4d8502Sjsg     USHORT usSmallPowerLimit;
694fb4d8502Sjsg     USHORT usLowCACLeakage;
695fb4d8502Sjsg     USHORT usHighCACLeakage;
696fb4d8502Sjsg }ATOM_PowerTune_Table;
697fb4d8502Sjsg 
698fb4d8502Sjsg typedef struct _ATOM_PPLIB_POWERTUNE_Table
699fb4d8502Sjsg {
700fb4d8502Sjsg       UCHAR revid;
701fb4d8502Sjsg       ATOM_PowerTune_Table power_tune_table;
702fb4d8502Sjsg }ATOM_PPLIB_POWERTUNE_Table;
703fb4d8502Sjsg 
704fb4d8502Sjsg typedef struct _ATOM_PPLIB_POWERTUNE_Table_V1
705fb4d8502Sjsg {
706fb4d8502Sjsg       UCHAR revid;
707fb4d8502Sjsg       ATOM_PowerTune_Table power_tune_table;
708fb4d8502Sjsg       USHORT usMaximumPowerDeliveryLimit;
709fb4d8502Sjsg       USHORT usTjMax;
710fb4d8502Sjsg       USHORT usReserve[6];
711fb4d8502Sjsg } ATOM_PPLIB_POWERTUNE_Table_V1;
712fb4d8502Sjsg 
713fb4d8502Sjsg #define ATOM_PPM_A_A    1
714fb4d8502Sjsg #define ATOM_PPM_A_I    2
715fb4d8502Sjsg typedef struct _ATOM_PPLIB_PPM_Table
716fb4d8502Sjsg {
717fb4d8502Sjsg       UCHAR  ucRevId;
718fb4d8502Sjsg       UCHAR  ucPpmDesign;          //A+I or A+A
719fb4d8502Sjsg       USHORT usCpuCoreNumber;
720fb4d8502Sjsg       ULONG  ulPlatformTDP;
721fb4d8502Sjsg       ULONG  ulSmallACPlatformTDP;
722fb4d8502Sjsg       ULONG  ulPlatformTDC;
723fb4d8502Sjsg       ULONG  ulSmallACPlatformTDC;
724fb4d8502Sjsg       ULONG  ulApuTDP;
725fb4d8502Sjsg       ULONG  ulDGpuTDP;
726fb4d8502Sjsg       ULONG  ulDGpuUlvPower;
727fb4d8502Sjsg       ULONG  ulTjmax;
728fb4d8502Sjsg } ATOM_PPLIB_PPM_Table;
729fb4d8502Sjsg 
730fb4d8502Sjsg #define    VQ_DisplayConfig_NoneAWD   1
731fb4d8502Sjsg #define    VQ_DisplayConfig_AWD       2
732fb4d8502Sjsg 
733fb4d8502Sjsg typedef struct ATOM_PPLIB_VQ_Budgeting_Record{
734fb4d8502Sjsg     ULONG ulDeviceID;
735fb4d8502Sjsg     ULONG ulSustainableSOCPowerLimitLow; /* in mW */
736fb4d8502Sjsg     ULONG ulSustainableSOCPowerLimitHigh; /* in mW */
737fb4d8502Sjsg 
738fb4d8502Sjsg     ULONG ulDClk;
739fb4d8502Sjsg     ULONG ulEClk;
740fb4d8502Sjsg     ULONG ulDispSclk;
741fb4d8502Sjsg     UCHAR ucDispConfig;
742fb4d8502Sjsg 
743fb4d8502Sjsg } ATOM_PPLIB_VQ_Budgeting_Record;
744fb4d8502Sjsg 
745fb4d8502Sjsg typedef struct ATOM_PPLIB_VQ_Budgeting_Table {
746fb4d8502Sjsg     UCHAR revid;
747fb4d8502Sjsg     UCHAR numEntries;
748fb4d8502Sjsg     ATOM_PPLIB_VQ_Budgeting_Record         entries[1];
749fb4d8502Sjsg } ATOM_PPLIB_VQ_Budgeting_Table;
750fb4d8502Sjsg 
751fb4d8502Sjsg #pragma pack()
752fb4d8502Sjsg 
753fb4d8502Sjsg #endif
754