Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2013 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  */
0022 
0023 #ifndef _PPTABLE_H
0024 #define _PPTABLE_H
0025 
0026 #pragma pack(1)
0027 
0028 typedef struct _ATOM_PPLIB_THERMALCONTROLLER
0029 
0030 {
0031     UCHAR ucType;           // one of ATOM_PP_THERMALCONTROLLER_*
0032     UCHAR ucI2cLine;        // as interpreted by DAL I2C
0033     UCHAR ucI2cAddress;
0034     UCHAR ucFanParameters;  // Fan Control Parameters.
0035     UCHAR ucFanMinRPM;      // Fan Minimum RPM (hundreds) -- for display purposes only.
0036     UCHAR ucFanMaxRPM;      // Fan Maximum RPM (hundreds) -- for display purposes only.
0037     UCHAR ucReserved;       // ----
0038     UCHAR ucFlags;          // to be defined
0039 } ATOM_PPLIB_THERMALCONTROLLER;
0040 
0041 #define ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f
0042 #define ATOM_PP_FANPARAMETERS_NOFAN                                 0x80    // No fan is connected to this controller.
0043 
0044 #define ATOM_PP_THERMALCONTROLLER_NONE      0
0045 #define ATOM_PP_THERMALCONTROLLER_LM63      1  // Not used by PPLib
0046 #define ATOM_PP_THERMALCONTROLLER_ADM1032   2  // Not used by PPLib
0047 #define ATOM_PP_THERMALCONTROLLER_ADM1030   3  // Not used by PPLib
0048 #define ATOM_PP_THERMALCONTROLLER_MUA6649   4  // Not used by PPLib
0049 #define ATOM_PP_THERMALCONTROLLER_LM64      5
0050 #define ATOM_PP_THERMALCONTROLLER_F75375    6  // Not used by PPLib
0051 #define ATOM_PP_THERMALCONTROLLER_RV6xx     7
0052 #define ATOM_PP_THERMALCONTROLLER_RV770     8
0053 #define ATOM_PP_THERMALCONTROLLER_ADT7473   9
0054 #define ATOM_PP_THERMALCONTROLLER_KONG      10
0055 #define ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO     11
0056 #define ATOM_PP_THERMALCONTROLLER_EVERGREEN 12
0057 #define ATOM_PP_THERMALCONTROLLER_EMC2103   13  /* 0x0D */ // Only fan control will be implemented, do NOT show this in PPGen.
0058 #define ATOM_PP_THERMALCONTROLLER_SUMO      14  /* 0x0E */ // Sumo type, used internally
0059 #define ATOM_PP_THERMALCONTROLLER_NISLANDS  15
0060 #define ATOM_PP_THERMALCONTROLLER_SISLANDS  16
0061 #define ATOM_PP_THERMALCONTROLLER_LM96163   17
0062 #define ATOM_PP_THERMALCONTROLLER_CISLANDS  18
0063 #define ATOM_PP_THERMALCONTROLLER_KAVERI    19
0064 
0065 
0066 // Thermal controller 'combo type' to use an external controller for Fan control and an internal controller for thermal.
0067 // We probably should reserve the bit 0x80 for this use.
0068 // 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).
0069 // The driver can pick the correct internal controller based on the ASIC.
0070 
0071 #define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL   0x89    // ADT7473 Fan Control + Internal Thermal Controller
0072 #define ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL   0x8D    // EMC2103 Fan Control + Internal Thermal Controller
0073 
0074 typedef struct _ATOM_PPLIB_STATE
0075 {
0076     UCHAR ucNonClockStateIndex;
0077     UCHAR ucClockStateIndices[1]; // variable-sized
0078 } ATOM_PPLIB_STATE;
0079 
0080 
0081 typedef struct _ATOM_PPLIB_FANTABLE
0082 {
0083     UCHAR   ucFanTableFormat;                // Change this if the table format changes or version changes so that the other fields are not the same.
0084     UCHAR   ucTHyst;                         // Temperature hysteresis. Integer.
0085     USHORT  usTMin;                          // The temperature, in 0.01 centigrades, below which we just run at a minimal PWM.
0086     USHORT  usTMed;                          // The middle temperature where we change slopes.
0087     USHORT  usTHigh;                         // The high point above TMed for adjusting the second slope.
0088     USHORT  usPWMMin;                        // The minimum PWM value in percent (0.01% increments).
0089     USHORT  usPWMMed;                        // The PWM value (in percent) at TMed.
0090     USHORT  usPWMHigh;                       // The PWM value at THigh.
0091 } ATOM_PPLIB_FANTABLE;
0092 
0093 typedef struct _ATOM_PPLIB_FANTABLE2
0094 {
0095     ATOM_PPLIB_FANTABLE basicTable;
0096     USHORT  usTMax;                          // The max temperature
0097 } ATOM_PPLIB_FANTABLE2;
0098 
0099 typedef struct _ATOM_PPLIB_FANTABLE3
0100 {
0101     ATOM_PPLIB_FANTABLE2 basicTable2;
0102     UCHAR ucFanControlMode;
0103     USHORT usFanPWMMax;
0104     USHORT usFanOutputSensitivity;
0105 } ATOM_PPLIB_FANTABLE3;
0106 
0107 typedef struct _ATOM_PPLIB_EXTENDEDHEADER
0108 {
0109     USHORT  usSize;
0110     ULONG   ulMaxEngineClock;   // For Overdrive.
0111     ULONG   ulMaxMemoryClock;   // For Overdrive.
0112     // Add extra system parameters here, always adjust size to include all fields.
0113     USHORT  usVCETableOffset; //points to ATOM_PPLIB_VCE_Table
0114     USHORT  usUVDTableOffset;   //points to ATOM_PPLIB_UVD_Table
0115     USHORT  usSAMUTableOffset;  //points to ATOM_PPLIB_SAMU_Table
0116     USHORT  usPPMTableOffset;   //points to ATOM_PPLIB_PPM_Table
0117     USHORT  usACPTableOffset;  //points to ATOM_PPLIB_ACP_Table   
0118     USHORT  usPowerTuneTableOffset; //points to ATOM_PPLIB_POWERTUNE_Table   
0119 } ATOM_PPLIB_EXTENDEDHEADER;
0120 
0121 //// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps
0122 #define ATOM_PP_PLATFORM_CAP_BACKBIAS 1
0123 #define ATOM_PP_PLATFORM_CAP_POWERPLAY 2
0124 #define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4
0125 #define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8
0126 #define ATOM_PP_PLATFORM_CAP_ASPM_L1 16
0127 #define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32
0128 #define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64
0129 #define ATOM_PP_PLATFORM_CAP_STEPVDDC 128
0130 #define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256
0131 #define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512
0132 #define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024
0133 #define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048
0134 #define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096
0135 #define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000              // Go to boot state on alerts, e.g. on an AC->DC transition.
0136 #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).
0137 #define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000                   // Does the driver control VDDCI independently from VDDC.
0138 #define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000               // Enable the 'regulator hot' feature.
0139 #define ATOM_PP_PLATFORM_CAP_BACO          0x00020000               // Does the driver supports BACO state.
0140 #define ATOM_PP_PLATFORM_CAP_NEW_CAC_VOLTAGE   0x00040000           // Does the driver supports new CAC voltage table.
0141 #define ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY   0x00080000     // Does the driver supports revert GPIO5 polarity.
0142 #define ATOM_PP_PLATFORM_CAP_OUTPUT_THERMAL2GPIO17   0x00100000     // Does the driver supports thermal2GPIO17.
0143 #define ATOM_PP_PLATFORM_CAP_VRHOT_GPIO_CONFIGURABLE   0x00200000   // Does the driver supports VR HOT GPIO Configurable.
0144 #define ATOM_PP_PLATFORM_CAP_TEMP_INVERSION   0x00400000            // Does the driver supports Temp Inversion feature.
0145 #define ATOM_PP_PLATFORM_CAP_EVV    0x00800000
0146 
0147 typedef struct _ATOM_PPLIB_POWERPLAYTABLE
0148 {
0149       ATOM_COMMON_TABLE_HEADER sHeader;
0150 
0151       UCHAR ucDataRevision;
0152 
0153       UCHAR ucNumStates;
0154       UCHAR ucStateEntrySize;
0155       UCHAR ucClockInfoSize;
0156       UCHAR ucNonClockSize;
0157 
0158       // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures
0159       USHORT usStateArrayOffset;
0160 
0161       // offset from start of this table to array of ASIC-specific structures,
0162       // currently ATOM_PPLIB_CLOCK_INFO.
0163       USHORT usClockInfoArrayOffset;
0164 
0165       // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO
0166       USHORT usNonClockInfoArrayOffset;
0167 
0168       USHORT usBackbiasTime;    // in microseconds
0169       USHORT usVoltageTime;     // in microseconds
0170       USHORT usTableSize;       //the size of this structure, or the extended structure
0171 
0172       ULONG ulPlatformCaps;            // See ATOM_PPLIB_CAPS_*
0173 
0174       ATOM_PPLIB_THERMALCONTROLLER    sThermalController;
0175 
0176       USHORT usBootClockInfoOffset;
0177       USHORT usBootNonClockInfoOffset;
0178 
0179 } ATOM_PPLIB_POWERPLAYTABLE;
0180 
0181 typedef struct _ATOM_PPLIB_POWERPLAYTABLE2
0182 {
0183     ATOM_PPLIB_POWERPLAYTABLE basicTable;
0184     UCHAR   ucNumCustomThermalPolicy;
0185     USHORT  usCustomThermalPolicyArrayOffset;
0186 }ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2;
0187 
0188 typedef struct _ATOM_PPLIB_POWERPLAYTABLE3
0189 {
0190     ATOM_PPLIB_POWERPLAYTABLE2 basicTable2;
0191     USHORT                     usFormatID;                      // To be used ONLY by PPGen.
0192     USHORT                     usFanTableOffset;
0193     USHORT                     usExtendendedHeaderOffset;
0194 } ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3;
0195 
0196 typedef struct _ATOM_PPLIB_POWERPLAYTABLE4
0197 {
0198     ATOM_PPLIB_POWERPLAYTABLE3 basicTable3;
0199     ULONG                      ulGoldenPPID;                    // PPGen use only     
0200     ULONG                      ulGoldenRevision;                // PPGen use only
0201     USHORT                     usVddcDependencyOnSCLKOffset;
0202     USHORT                     usVddciDependencyOnMCLKOffset;
0203     USHORT                     usVddcDependencyOnMCLKOffset;
0204     USHORT                     usMaxClockVoltageOnDCOffset;
0205     USHORT                     usVddcPhaseShedLimitsTableOffset;    // Points to ATOM_PPLIB_PhaseSheddingLimits_Table
0206     USHORT                     usMvddDependencyOnMCLKOffset;  
0207 } ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4;
0208 
0209 typedef struct _ATOM_PPLIB_POWERPLAYTABLE5
0210 {
0211     ATOM_PPLIB_POWERPLAYTABLE4 basicTable4;
0212     ULONG                      ulTDPLimit;
0213     ULONG                      ulNearTDPLimit;
0214     ULONG                      ulSQRampingThreshold;
0215     USHORT                     usCACLeakageTableOffset;         // Points to ATOM_PPLIB_CAC_Leakage_Table
0216     ULONG                      ulCACLeakage;                    // The iLeakage for driver calculated CAC leakage table
0217     USHORT                     usTDPODLimit;
0218     USHORT                     usLoadLineSlope;                 // in milliOhms * 100
0219 } ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5;
0220 
0221 //// ATOM_PPLIB_NONCLOCK_INFO::usClassification
0222 #define ATOM_PPLIB_CLASSIFICATION_UI_MASK          0x0007
0223 #define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT         0
0224 #define ATOM_PPLIB_CLASSIFICATION_UI_NONE          0
0225 #define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY       1
0226 #define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED      3
0227 #define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE   5
0228 // 2, 4, 6, 7 are reserved
0229 
0230 #define ATOM_PPLIB_CLASSIFICATION_BOOT                   0x0008
0231 #define ATOM_PPLIB_CLASSIFICATION_THERMAL                0x0010
0232 #define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE     0x0020
0233 #define ATOM_PPLIB_CLASSIFICATION_REST                   0x0040
0234 #define ATOM_PPLIB_CLASSIFICATION_FORCED                 0x0080
0235 #define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE          0x0100
0236 #define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE      0x0200
0237 #define ATOM_PPLIB_CLASSIFICATION_UVDSTATE               0x0400
0238 #define ATOM_PPLIB_CLASSIFICATION_3DLOW                  0x0800
0239 #define ATOM_PPLIB_CLASSIFICATION_ACPI                   0x1000
0240 #define ATOM_PPLIB_CLASSIFICATION_HD2STATE               0x2000
0241 #define ATOM_PPLIB_CLASSIFICATION_HDSTATE                0x4000
0242 #define ATOM_PPLIB_CLASSIFICATION_SDSTATE                0x8000
0243 
0244 //// ATOM_PPLIB_NONCLOCK_INFO::usClassification2
0245 #define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2     0x0001
0246 #define ATOM_PPLIB_CLASSIFICATION2_ULV                      0x0002
0247 #define ATOM_PPLIB_CLASSIFICATION2_MVC                      0x0004   //Multi-View Codec (BD-3D)
0248 
0249 //// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings
0250 #define ATOM_PPLIB_SINGLE_DISPLAY_ONLY           0x00000001
0251 #define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK         0x00000002
0252 
0253 // 0 is 2.5Gb/s, 1 is 5Gb/s
0254 #define ATOM_PPLIB_PCIE_LINK_SPEED_MASK            0x00000004
0255 #define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT           2
0256 
0257 // lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec
0258 #define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK            0x000000F8
0259 #define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT           3
0260 
0261 // lookup into reduced refresh-rate table
0262 #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK  0x00000F00
0263 #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8
0264 
0265 #define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED    0
0266 #define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ         1
0267 // 2-15 TBD as needed.
0268 
0269 #define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING        0x00001000
0270 #define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS  0x00002000
0271 
0272 #define ATOM_PPLIB_DISALLOW_ON_DC                       0x00004000
0273 
0274 #define ATOM_PPLIB_ENABLE_VARIBRIGHT                     0x00008000
0275 
0276 //memory related flags
0277 #define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF               0x000010000
0278 
0279 //M3 Arb    //2bits, current 3 sets of parameters in total
0280 #define ATOM_PPLIB_M3ARB_MASK                       0x00060000
0281 #define ATOM_PPLIB_M3ARB_SHIFT                      17
0282 
0283 #define ATOM_PPLIB_ENABLE_DRR                       0x00080000
0284 
0285 // remaining 16 bits are reserved
0286 typedef struct _ATOM_PPLIB_THERMAL_STATE
0287 {
0288     UCHAR   ucMinTemperature;
0289     UCHAR   ucMaxTemperature;
0290     UCHAR   ucThermalAction;
0291 }ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE;
0292 
0293 // Contained in an array starting at the offset
0294 // in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset.
0295 // referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex
0296 #define ATOM_PPLIB_NONCLOCKINFO_VER1      12
0297 #define ATOM_PPLIB_NONCLOCKINFO_VER2      24
0298 typedef struct _ATOM_PPLIB_NONCLOCK_INFO
0299 {
0300       USHORT usClassification;
0301       UCHAR  ucMinTemperature;
0302       UCHAR  ucMaxTemperature;
0303       ULONG  ulCapsAndSettings;
0304       UCHAR  ucRequiredPower;
0305       USHORT usClassification2;
0306       ULONG  ulVCLK;
0307       ULONG  ulDCLK;
0308       UCHAR  ucUnused[5];
0309 } ATOM_PPLIB_NONCLOCK_INFO;
0310 
0311 // Contained in an array starting at the offset
0312 // in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset.
0313 // referenced from ATOM_PPLIB_STATE::ucClockStateIndices
0314 typedef struct _ATOM_PPLIB_R600_CLOCK_INFO
0315 {
0316       USHORT usEngineClockLow;
0317       UCHAR ucEngineClockHigh;
0318 
0319       USHORT usMemoryClockLow;
0320       UCHAR ucMemoryClockHigh;
0321 
0322       USHORT usVDDC;
0323       USHORT usUnused1;
0324       USHORT usUnused2;
0325 
0326       ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
0327 
0328 } ATOM_PPLIB_R600_CLOCK_INFO;
0329 
0330 // ulFlags in ATOM_PPLIB_R600_CLOCK_INFO
0331 #define ATOM_PPLIB_R600_FLAGS_PCIEGEN2          1
0332 #define ATOM_PPLIB_R600_FLAGS_UVDSAFE           2
0333 #define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE    4
0334 #define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF    8
0335 #define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF   16
0336 #define ATOM_PPLIB_R600_FLAGS_LOWPOWER         32   // On the RV770 use 'low power' setting (sequencer S0).
0337 
0338 typedef struct _ATOM_PPLIB_RS780_CLOCK_INFO
0339 
0340 {
0341       USHORT usLowEngineClockLow;         // Low Engine clock in MHz (the same way as on the R600).
0342       UCHAR  ucLowEngineClockHigh;
0343       USHORT usHighEngineClockLow;        // High Engine clock in MHz.
0344       UCHAR  ucHighEngineClockHigh;
0345       USHORT usMemoryClockLow;            // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants.
0346       UCHAR  ucMemoryClockHigh;           // Currentyl unused.
0347       UCHAR  ucPadding;                   // For proper alignment and size.
0348       USHORT usVDDC;                      // For the 780, use: None, Low, High, Variable
0349       UCHAR  ucMaxHTLinkWidth;            // From SBIOS - {2, 4, 8, 16}
0350       UCHAR  ucMinHTLinkWidth;            // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could 
0351       USHORT usHTLinkFreq;                // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200).
0352       ULONG  ulFlags; 
0353 } ATOM_PPLIB_RS780_CLOCK_INFO;
0354 
0355 #define ATOM_PPLIB_RS780_VOLTAGE_NONE       0 
0356 #define ATOM_PPLIB_RS780_VOLTAGE_LOW        1 
0357 #define ATOM_PPLIB_RS780_VOLTAGE_HIGH       2 
0358 #define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE   3 
0359 
0360 #define ATOM_PPLIB_RS780_SPMCLK_NONE        0   // We cannot change the side port memory clock, leave it as it is.
0361 #define ATOM_PPLIB_RS780_SPMCLK_LOW         1
0362 #define ATOM_PPLIB_RS780_SPMCLK_HIGH        2
0363 
0364 #define ATOM_PPLIB_RS780_HTLINKFREQ_NONE       0 
0365 #define ATOM_PPLIB_RS780_HTLINKFREQ_LOW        1 
0366 #define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH       2 
0367 
0368 typedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO
0369 {
0370       USHORT usEngineClockLow;
0371       UCHAR  ucEngineClockHigh;
0372 
0373       USHORT usMemoryClockLow;
0374       UCHAR  ucMemoryClockHigh;
0375 
0376       USHORT usVDDC;
0377       USHORT usVDDCI;
0378       USHORT usUnused;
0379 
0380       ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
0381 
0382 } ATOM_PPLIB_EVERGREEN_CLOCK_INFO;
0383 
0384 typedef struct _ATOM_PPLIB_SI_CLOCK_INFO
0385 {
0386       USHORT usEngineClockLow;
0387       UCHAR  ucEngineClockHigh;
0388 
0389       USHORT usMemoryClockLow;
0390       UCHAR  ucMemoryClockHigh;
0391 
0392       USHORT usVDDC;
0393       USHORT usVDDCI;
0394       UCHAR  ucPCIEGen;
0395       UCHAR  ucUnused1;
0396 
0397       ULONG ulFlags; // ATOM_PPLIB_SI_FLAGS_*, no flag is necessary for now
0398 
0399 } ATOM_PPLIB_SI_CLOCK_INFO;
0400 
0401 typedef struct _ATOM_PPLIB_CI_CLOCK_INFO
0402 {
0403       USHORT usEngineClockLow;
0404       UCHAR  ucEngineClockHigh;
0405 
0406       USHORT usMemoryClockLow;
0407       UCHAR  ucMemoryClockHigh;
0408       
0409       UCHAR  ucPCIEGen;
0410       USHORT usPCIELane;
0411 } ATOM_PPLIB_CI_CLOCK_INFO;
0412 
0413 typedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{
0414       USHORT usEngineClockLow;  //clockfrequency & 0xFFFF. The unit is in 10khz
0415       UCHAR  ucEngineClockHigh; //clockfrequency >> 16. 
0416       UCHAR  vddcIndex;         //2-bit vddc index;
0417       USHORT tdpLimit;
0418       //please initalize to 0
0419       USHORT rsv1;
0420       //please initialize to 0s
0421       ULONG rsv2[2];
0422 }ATOM_PPLIB_SUMO_CLOCK_INFO;
0423 
0424 typedef struct _ATOM_PPLIB_STATE_V2
0425 {
0426       //number of valid dpm levels in this state; Driver uses it to calculate the whole 
0427       //size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR)
0428       UCHAR ucNumDPMLevels;
0429       
0430       //a index to the array of nonClockInfos
0431       UCHAR nonClockInfoIndex;
0432       /**
0433       * Driver will read the first ucNumDPMLevels in this array
0434       */
0435       UCHAR clockInfoIndex[1];
0436 } ATOM_PPLIB_STATE_V2;
0437 
0438 typedef struct _StateArray{
0439     //how many states we have 
0440     UCHAR ucNumEntries;
0441     
0442     ATOM_PPLIB_STATE_V2 states[1];
0443 }StateArray;
0444 
0445 
0446 typedef struct _ClockInfoArray{
0447     //how many clock levels we have
0448     UCHAR ucNumEntries;
0449     
0450     //sizeof(ATOM_PPLIB_CLOCK_INFO)
0451     UCHAR ucEntrySize;
0452     
0453     UCHAR clockInfo[1];
0454 }ClockInfoArray;
0455 
0456 typedef struct _NonClockInfoArray{
0457 
0458     //how many non-clock levels we have. normally should be same as number of states
0459     UCHAR ucNumEntries;
0460     //sizeof(ATOM_PPLIB_NONCLOCK_INFO)
0461     UCHAR ucEntrySize;
0462     
0463     ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1];
0464 }NonClockInfoArray;
0465 
0466 typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record
0467 {
0468     USHORT usClockLow;
0469     UCHAR  ucClockHigh;
0470     USHORT usVoltage;
0471 }ATOM_PPLIB_Clock_Voltage_Dependency_Record;
0472 
0473 typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table
0474 {
0475     UCHAR ucNumEntries;                                                // Number of entries.
0476     ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1];             // Dynamically allocate entries.
0477 }ATOM_PPLIB_Clock_Voltage_Dependency_Table;
0478 
0479 typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record
0480 {
0481     USHORT usSclkLow;
0482     UCHAR  ucSclkHigh;
0483     USHORT usMclkLow;
0484     UCHAR  ucMclkHigh;
0485     USHORT usVddc;
0486     USHORT usVddci;
0487 }ATOM_PPLIB_Clock_Voltage_Limit_Record;
0488 
0489 typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table
0490 {
0491     UCHAR ucNumEntries;                                                // Number of entries.
0492     ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1];                  // Dynamically allocate entries.
0493 }ATOM_PPLIB_Clock_Voltage_Limit_Table;
0494 
0495 union _ATOM_PPLIB_CAC_Leakage_Record
0496 {
0497     struct
0498     {
0499         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
0500         ULONG  ulLeakageValue;  // For CI and newer we use this as the "fake" standar VDDC value. in CI we read it as StdVoltageLoSidd
0501 
0502     };
0503     struct
0504      {
0505         USHORT usVddc1;
0506         USHORT usVddc2;
0507         USHORT usVddc3;
0508      };
0509 };
0510 
0511 typedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record;
0512 
0513 typedef struct _ATOM_PPLIB_CAC_Leakage_Table
0514 {
0515     UCHAR ucNumEntries;                                                 // Number of entries.
0516     ATOM_PPLIB_CAC_Leakage_Record entries[1];                           // Dynamically allocate entries.
0517 }ATOM_PPLIB_CAC_Leakage_Table;
0518 
0519 typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record
0520 {
0521     USHORT usVoltage;
0522     USHORT usSclkLow;
0523     UCHAR  ucSclkHigh;
0524     USHORT usMclkLow;
0525     UCHAR  ucMclkHigh;
0526 }ATOM_PPLIB_PhaseSheddingLimits_Record;
0527 
0528 typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table
0529 {
0530     UCHAR ucNumEntries;                                                 // Number of entries.
0531     ATOM_PPLIB_PhaseSheddingLimits_Record entries[1];                   // Dynamically allocate entries.
0532 }ATOM_PPLIB_PhaseSheddingLimits_Table;
0533 
0534 typedef struct _VCEClockInfo{
0535     USHORT usEVClkLow;
0536     UCHAR  ucEVClkHigh;
0537     USHORT usECClkLow;
0538     UCHAR  ucECClkHigh;
0539 }VCEClockInfo;
0540 
0541 typedef struct _VCEClockInfoArray{
0542     UCHAR ucNumEntries;
0543     VCEClockInfo entries[1];
0544 }VCEClockInfoArray;
0545 
0546 typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record
0547 {
0548     USHORT usVoltage;
0549     UCHAR  ucVCEClockInfoIndex;
0550 }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record;
0551 
0552 typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table
0553 {
0554     UCHAR numEntries;
0555     ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[1];
0556 }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table;
0557 
0558 typedef struct _ATOM_PPLIB_VCE_State_Record
0559 {
0560     UCHAR  ucVCEClockInfoIndex;
0561     UCHAR  ucClockInfoIndex; //highest 2 bits indicates memory p-states, lower 6bits indicates index to ClockInfoArrary
0562 }ATOM_PPLIB_VCE_State_Record;
0563 
0564 typedef struct _ATOM_PPLIB_VCE_State_Table
0565 {
0566     UCHAR numEntries;
0567     ATOM_PPLIB_VCE_State_Record entries[1];
0568 }ATOM_PPLIB_VCE_State_Table;
0569 
0570 
0571 typedef struct _ATOM_PPLIB_VCE_Table
0572 {
0573       UCHAR revid;
0574 //    VCEClockInfoArray array;
0575 //    ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table limits;
0576 //    ATOM_PPLIB_VCE_State_Table states;
0577 }ATOM_PPLIB_VCE_Table;
0578 
0579 
0580 typedef struct _UVDClockInfo{
0581     USHORT usVClkLow;
0582     UCHAR  ucVClkHigh;
0583     USHORT usDClkLow;
0584     UCHAR  ucDClkHigh;
0585 }UVDClockInfo;
0586 
0587 typedef struct _UVDClockInfoArray{
0588     UCHAR ucNumEntries;
0589     UVDClockInfo entries[1];
0590 }UVDClockInfoArray;
0591 
0592 typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record
0593 {
0594     USHORT usVoltage;
0595     UCHAR  ucUVDClockInfoIndex;
0596 }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record;
0597 
0598 typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table
0599 {
0600     UCHAR numEntries;
0601     ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[1];
0602 }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table;
0603 
0604 typedef struct _ATOM_PPLIB_UVD_Table
0605 {
0606       UCHAR revid;
0607 //    UVDClockInfoArray array;
0608 //    ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table limits;
0609 }ATOM_PPLIB_UVD_Table;
0610 
0611 typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record
0612 {
0613       USHORT usVoltage;
0614       USHORT usSAMClockLow;
0615       UCHAR  ucSAMClockHigh;
0616 }ATOM_PPLIB_SAMClk_Voltage_Limit_Record;
0617 
0618 typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{
0619     UCHAR numEntries;
0620     ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[1];
0621 }ATOM_PPLIB_SAMClk_Voltage_Limit_Table;
0622 
0623 typedef struct _ATOM_PPLIB_SAMU_Table
0624 {
0625       UCHAR revid;
0626       ATOM_PPLIB_SAMClk_Voltage_Limit_Table limits;
0627 }ATOM_PPLIB_SAMU_Table;
0628 
0629 typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record
0630 {
0631       USHORT usVoltage;
0632       USHORT usACPClockLow;
0633       UCHAR  ucACPClockHigh;
0634 }ATOM_PPLIB_ACPClk_Voltage_Limit_Record;
0635 
0636 typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{
0637     UCHAR numEntries;
0638     ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[1];
0639 }ATOM_PPLIB_ACPClk_Voltage_Limit_Table;
0640 
0641 typedef struct _ATOM_PPLIB_ACP_Table
0642 {
0643       UCHAR revid;
0644       ATOM_PPLIB_ACPClk_Voltage_Limit_Table limits;
0645 }ATOM_PPLIB_ACP_Table;
0646 
0647 typedef struct _ATOM_PowerTune_Table{
0648     USHORT usTDP;
0649     USHORT usConfigurableTDP;
0650     USHORT usTDC;
0651     USHORT usBatteryPowerLimit;
0652     USHORT usSmallPowerLimit;
0653     USHORT usLowCACLeakage;
0654     USHORT usHighCACLeakage;
0655 }ATOM_PowerTune_Table;
0656 
0657 typedef struct _ATOM_PPLIB_POWERTUNE_Table
0658 {
0659       UCHAR revid;
0660       ATOM_PowerTune_Table power_tune_table;
0661 }ATOM_PPLIB_POWERTUNE_Table;
0662 
0663 typedef struct _ATOM_PPLIB_POWERTUNE_Table_V1
0664 {
0665       UCHAR revid;
0666       ATOM_PowerTune_Table power_tune_table;
0667       USHORT usMaximumPowerDeliveryLimit;
0668       USHORT usReserve[7];
0669 } ATOM_PPLIB_POWERTUNE_Table_V1;
0670 
0671 #define ATOM_PPM_A_A    1
0672 #define ATOM_PPM_A_I    2
0673 typedef struct _ATOM_PPLIB_PPM_Table
0674 {
0675       UCHAR  ucRevId;
0676       UCHAR  ucPpmDesign;          //A+I or A+A
0677       USHORT usCpuCoreNumber;
0678       ULONG  ulPlatformTDP;
0679       ULONG  ulSmallACPlatformTDP;
0680       ULONG  ulPlatformTDC;
0681       ULONG  ulSmallACPlatformTDC;
0682       ULONG  ulApuTDP;
0683       ULONG  ulDGpuTDP;  
0684       ULONG  ulDGpuUlvPower;
0685       ULONG  ulTjmax;
0686 } ATOM_PPLIB_PPM_Table;
0687 
0688 #pragma pack()
0689 
0690 #endif