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