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