Path: blob/master/drivers/gpu/drm/amd/include/pptable.h
26517 views
/*1* Copyright 2013 Advanced Micro Devices, Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*/2122#ifndef _PPTABLE_H23#define _PPTABLE_H2425#pragma pack(1)2627typedef struct _ATOM_PPLIB_THERMALCONTROLLER2829{30UCHAR ucType; // one of ATOM_PP_THERMALCONTROLLER_*31UCHAR ucI2cLine; // as interpreted by DAL I2C32UCHAR ucI2cAddress;33UCHAR ucFanParameters; // Fan Control Parameters.34UCHAR ucFanMinRPM; // Fan Minimum RPM (hundreds) -- for display purposes only.35UCHAR ucFanMaxRPM; // Fan Maximum RPM (hundreds) -- for display purposes only.36UCHAR ucReserved; // ----37UCHAR ucFlags; // to be defined38} ATOM_PPLIB_THERMALCONTROLLER;3940#define ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f41#define ATOM_PP_FANPARAMETERS_NOFAN 0x80 // No fan is connected to this controller.4243#define ATOM_PP_THERMALCONTROLLER_NONE 044#define ATOM_PP_THERMALCONTROLLER_LM63 1 // Not used by PPLib45#define ATOM_PP_THERMALCONTROLLER_ADM1032 2 // Not used by PPLib46#define ATOM_PP_THERMALCONTROLLER_ADM1030 3 // Not used by PPLib47#define ATOM_PP_THERMALCONTROLLER_MUA6649 4 // Not used by PPLib48#define ATOM_PP_THERMALCONTROLLER_LM64 549#define ATOM_PP_THERMALCONTROLLER_F75375 6 // Not used by PPLib50#define ATOM_PP_THERMALCONTROLLER_RV6xx 751#define ATOM_PP_THERMALCONTROLLER_RV770 852#define ATOM_PP_THERMALCONTROLLER_ADT7473 953#define ATOM_PP_THERMALCONTROLLER_KONG 1054#define ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO 1155#define ATOM_PP_THERMALCONTROLLER_EVERGREEN 1256#define ATOM_PP_THERMALCONTROLLER_EMC2103 13 /* 0x0D */ // Only fan control will be implemented, do NOT show this in PPGen.57#define ATOM_PP_THERMALCONTROLLER_SUMO 14 /* 0x0E */ // Sumo type, used internally58#define ATOM_PP_THERMALCONTROLLER_NISLANDS 1559#define ATOM_PP_THERMALCONTROLLER_SISLANDS 1660#define ATOM_PP_THERMALCONTROLLER_LM96163 1761#define ATOM_PP_THERMALCONTROLLER_CISLANDS 1862#define ATOM_PP_THERMALCONTROLLER_KAVERI 1963#define ATOM_PP_THERMALCONTROLLER_ICELAND 2064#define ATOM_PP_THERMALCONTROLLER_TONGA 2165#define ATOM_PP_THERMALCONTROLLER_FIJI 2266#define ATOM_PP_THERMALCONTROLLER_POLARIS10 2367#define ATOM_PP_THERMALCONTROLLER_VEGA10 24686970// Thermal controller 'combo type' to use an external controller for Fan control and an internal controller for thermal.71// We probably should reserve the bit 0x80 for this use.72// 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).73// The driver can pick the correct internal controller based on the ASIC.74#define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL 0x89 // ADT7473 Fan Control + Internal Thermal Controller75#define ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL 0x8D // EMC2103 Fan Control + Internal Thermal Controller7677typedef struct _ATOM_PPLIB_STATE78{79UCHAR ucNonClockStateIndex;80UCHAR ucClockStateIndices[]; // variable-sized81} ATOM_PPLIB_STATE;828384typedef struct _ATOM_PPLIB_FANTABLE85{86UCHAR ucFanTableFormat; // Change this if the table format changes or version changes so that the other fields are not the same.87UCHAR ucTHyst; // Temperature hysteresis. Integer.88USHORT usTMin; // The temperature, in 0.01 centigrades, below which we just run at a minimal PWM.89USHORT usTMed; // The middle temperature where we change slopes.90USHORT usTHigh; // The high point above TMed for adjusting the second slope.91USHORT usPWMMin; // The minimum PWM value in percent (0.01% increments).92USHORT usPWMMed; // The PWM value (in percent) at TMed.93USHORT usPWMHigh; // The PWM value at THigh.94} ATOM_PPLIB_FANTABLE;9596typedef struct _ATOM_PPLIB_FANTABLE297{98ATOM_PPLIB_FANTABLE basicTable;99USHORT usTMax; // The max temperature100} ATOM_PPLIB_FANTABLE2;101102typedef struct _ATOM_PPLIB_FANTABLE3103{104ATOM_PPLIB_FANTABLE2 basicTable2;105UCHAR ucFanControlMode;106USHORT usFanPWMMax;107USHORT usFanOutputSensitivity;108} ATOM_PPLIB_FANTABLE3;109110typedef struct _ATOM_PPLIB_FANTABLE4111{112ATOM_PPLIB_FANTABLE3 basicTable3;113USHORT usFanRPMMax;114} ATOM_PPLIB_FANTABLE4;115116typedef struct _ATOM_PPLIB_FANTABLE5117{118ATOM_PPLIB_FANTABLE4 basicTable4;119USHORT usFanCurrentLow;120USHORT usFanCurrentHigh;121USHORT usFanRPMLow;122USHORT usFanRPMHigh;123} ATOM_PPLIB_FANTABLE5;124125typedef struct _ATOM_PPLIB_EXTENDEDHEADER126{127USHORT usSize;128ULONG ulMaxEngineClock; // For Overdrive.129ULONG ulMaxMemoryClock; // For Overdrive.130// Add extra system parameters here, always adjust size to include all fields.131USHORT usVCETableOffset; //points to ATOM_PPLIB_VCE_Table132USHORT usUVDTableOffset; //points to ATOM_PPLIB_UVD_Table133USHORT usSAMUTableOffset; //points to ATOM_PPLIB_SAMU_Table134USHORT usPPMTableOffset; //points to ATOM_PPLIB_PPM_Table135USHORT usACPTableOffset; //points to ATOM_PPLIB_ACP_Table136/* points to ATOM_PPLIB_POWERTUNE_Table */137USHORT usPowerTuneTableOffset;138/* points to ATOM_PPLIB_CLOCK_Voltage_Dependency_Table for sclkVddgfxTable */139USHORT usSclkVddgfxTableOffset;140USHORT usVQBudgetingTableOffset; /* points to the vqBudgetingTable; */141} ATOM_PPLIB_EXTENDEDHEADER;142143//// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps144#define ATOM_PP_PLATFORM_CAP_BACKBIAS 1145#define ATOM_PP_PLATFORM_CAP_POWERPLAY 2146#define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4147#define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8148#define ATOM_PP_PLATFORM_CAP_ASPM_L1 16149#define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32150#define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64151#define ATOM_PP_PLATFORM_CAP_STEPVDDC 128152#define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256153#define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512154#define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024155#define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048156#define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096157#define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000 // Go to boot state on alerts, e.g. on an AC->DC transition.158#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).159#define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000 // Does the driver control VDDCI independently from VDDC.160#define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000 // Enable the 'regulator hot' feature.161#define ATOM_PP_PLATFORM_CAP_BACO 0x00020000 // Does the driver supports BACO state.162#define ATOM_PP_PLATFORM_CAP_NEW_CAC_VOLTAGE 0x00040000 // Does the driver supports new CAC voltage table.163#define ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY 0x00080000 // Does the driver supports revert GPIO5 polarity.164#define ATOM_PP_PLATFORM_CAP_OUTPUT_THERMAL2GPIO17 0x00100000 // Does the driver supports thermal2GPIO17.165#define ATOM_PP_PLATFORM_CAP_VRHOT_GPIO_CONFIGURABLE 0x00200000 // Does the driver supports VR HOT GPIO Configurable.166#define ATOM_PP_PLATFORM_CAP_TEMP_INVERSION 0x00400000 // Does the driver supports Temp Inversion feature.167#define ATOM_PP_PLATFORM_CAP_EVV 0x00800000168#define ATOM_PP_PLATFORM_COMBINE_PCC_WITH_THERMAL_SIGNAL 0x01000000169#define ATOM_PP_PLATFORM_LOAD_POST_PRODUCTION_FIRMWARE 0x02000000170#define ATOM_PP_PLATFORM_CAP_DISABLE_USING_ACTUAL_TEMPERATURE_FOR_POWER_CALC 0x04000000171#define ATOM_PP_PLATFORM_CAP_VRHOT_POLARITY_HIGH 0x08000000172173typedef struct _ATOM_PPLIB_POWERPLAYTABLE174{175ATOM_COMMON_TABLE_HEADER sHeader;176177UCHAR ucDataRevision;178179UCHAR ucNumStates;180UCHAR ucStateEntrySize;181UCHAR ucClockInfoSize;182UCHAR ucNonClockSize;183184// offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures185USHORT usStateArrayOffset;186187// offset from start of this table to array of ASIC-specific structures,188// currently ATOM_PPLIB_CLOCK_INFO.189USHORT usClockInfoArrayOffset;190191// offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO192USHORT usNonClockInfoArrayOffset;193194USHORT usBackbiasTime; // in microseconds195USHORT usVoltageTime; // in microseconds196USHORT usTableSize; //the size of this structure, or the extended structure197198ULONG ulPlatformCaps; // See ATOM_PPLIB_CAPS_*199200ATOM_PPLIB_THERMALCONTROLLER sThermalController;201202USHORT usBootClockInfoOffset;203USHORT usBootNonClockInfoOffset;204205} ATOM_PPLIB_POWERPLAYTABLE;206207typedef struct _ATOM_PPLIB_POWERPLAYTABLE2208{209ATOM_PPLIB_POWERPLAYTABLE basicTable;210UCHAR ucNumCustomThermalPolicy;211USHORT usCustomThermalPolicyArrayOffset;212}ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2;213214typedef struct _ATOM_PPLIB_POWERPLAYTABLE3215{216ATOM_PPLIB_POWERPLAYTABLE2 basicTable2;217USHORT usFormatID; // To be used ONLY by PPGen.218USHORT usFanTableOffset;219USHORT usExtendendedHeaderOffset;220} ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3;221222typedef struct _ATOM_PPLIB_POWERPLAYTABLE4223{224ATOM_PPLIB_POWERPLAYTABLE3 basicTable3;225ULONG ulGoldenPPID; // PPGen use only226ULONG ulGoldenRevision; // PPGen use only227USHORT usVddcDependencyOnSCLKOffset;228USHORT usVddciDependencyOnMCLKOffset;229USHORT usVddcDependencyOnMCLKOffset;230USHORT usMaxClockVoltageOnDCOffset;231USHORT usVddcPhaseShedLimitsTableOffset; // Points to ATOM_PPLIB_PhaseSheddingLimits_Table232USHORT usMvddDependencyOnMCLKOffset;233} ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4;234235typedef struct _ATOM_PPLIB_POWERPLAYTABLE5236{237ATOM_PPLIB_POWERPLAYTABLE4 basicTable4;238ULONG ulTDPLimit;239ULONG ulNearTDPLimit;240ULONG ulSQRampingThreshold;241USHORT usCACLeakageTableOffset; // Points to ATOM_PPLIB_CAC_Leakage_Table242ULONG ulCACLeakage; // The iLeakage for driver calculated CAC leakage table243USHORT usTDPODLimit;244USHORT usLoadLineSlope; // in milliOhms * 100245} ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5;246247//// ATOM_PPLIB_NONCLOCK_INFO::usClassification248#define ATOM_PPLIB_CLASSIFICATION_UI_MASK 0x0007249#define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT 0250#define ATOM_PPLIB_CLASSIFICATION_UI_NONE 0251#define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY 1252#define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED 3253#define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE 5254// 2, 4, 6, 7 are reserved255256#define ATOM_PPLIB_CLASSIFICATION_BOOT 0x0008257#define ATOM_PPLIB_CLASSIFICATION_THERMAL 0x0010258#define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE 0x0020259#define ATOM_PPLIB_CLASSIFICATION_REST 0x0040260#define ATOM_PPLIB_CLASSIFICATION_FORCED 0x0080261#define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE 0x0100262#define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE 0x0200263#define ATOM_PPLIB_CLASSIFICATION_UVDSTATE 0x0400264#define ATOM_PPLIB_CLASSIFICATION_3DLOW 0x0800265#define ATOM_PPLIB_CLASSIFICATION_ACPI 0x1000266#define ATOM_PPLIB_CLASSIFICATION_HD2STATE 0x2000267#define ATOM_PPLIB_CLASSIFICATION_HDSTATE 0x4000268#define ATOM_PPLIB_CLASSIFICATION_SDSTATE 0x8000269270//// ATOM_PPLIB_NONCLOCK_INFO::usClassification2271#define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2 0x0001272#define ATOM_PPLIB_CLASSIFICATION2_ULV 0x0002273#define ATOM_PPLIB_CLASSIFICATION2_MVC 0x0004 //Multi-View Codec (BD-3D)274275//// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings276#define ATOM_PPLIB_SINGLE_DISPLAY_ONLY 0x00000001277#define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK 0x00000002278279// 0 is 2.5Gb/s, 1 is 5Gb/s280#define ATOM_PPLIB_PCIE_LINK_SPEED_MASK 0x00000004281#define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT 2282283// lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec284#define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK 0x000000F8285#define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT 3286287// lookup into reduced refresh-rate table288#define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK 0x00000F00289#define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8290291#define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED 0292#define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ 1293// 2-15 TBD as needed.294295#define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING 0x00001000296#define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS 0x00002000297298#define ATOM_PPLIB_DISALLOW_ON_DC 0x00004000299300#define ATOM_PPLIB_ENABLE_VARIBRIGHT 0x00008000301302//memory related flags303#define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF 0x000010000304305//M3 Arb //2bits, current 3 sets of parameters in total306#define ATOM_PPLIB_M3ARB_MASK 0x00060000307#define ATOM_PPLIB_M3ARB_SHIFT 17308309#define ATOM_PPLIB_ENABLE_DRR 0x00080000310311// remaining 16 bits are reserved312typedef struct _ATOM_PPLIB_THERMAL_STATE313{314UCHAR ucMinTemperature;315UCHAR ucMaxTemperature;316UCHAR ucThermalAction;317}ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE;318319// Contained in an array starting at the offset320// in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset.321// referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex322#define ATOM_PPLIB_NONCLOCKINFO_VER1 12323#define ATOM_PPLIB_NONCLOCKINFO_VER2 24324typedef struct _ATOM_PPLIB_NONCLOCK_INFO325{326USHORT usClassification;327UCHAR ucMinTemperature;328UCHAR ucMaxTemperature;329ULONG ulCapsAndSettings;330UCHAR ucRequiredPower;331USHORT usClassification2;332ULONG ulVCLK;333ULONG ulDCLK;334UCHAR ucUnused[5];335} ATOM_PPLIB_NONCLOCK_INFO;336337// Contained in an array starting at the offset338// in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset.339// referenced from ATOM_PPLIB_STATE::ucClockStateIndices340typedef struct _ATOM_PPLIB_R600_CLOCK_INFO341{342USHORT usEngineClockLow;343UCHAR ucEngineClockHigh;344345USHORT usMemoryClockLow;346UCHAR ucMemoryClockHigh;347348USHORT usVDDC;349USHORT usUnused1;350USHORT usUnused2;351352ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*353354} ATOM_PPLIB_R600_CLOCK_INFO;355356// ulFlags in ATOM_PPLIB_R600_CLOCK_INFO357#define ATOM_PPLIB_R600_FLAGS_PCIEGEN2 1358#define ATOM_PPLIB_R600_FLAGS_UVDSAFE 2359#define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE 4360#define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF 8361#define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF 16362#define ATOM_PPLIB_R600_FLAGS_LOWPOWER 32 // On the RV770 use 'low power' setting (sequencer S0).363364typedef struct _ATOM_PPLIB_RS780_CLOCK_INFO365366{367USHORT usLowEngineClockLow; // Low Engine clock in MHz (the same way as on the R600).368UCHAR ucLowEngineClockHigh;369USHORT usHighEngineClockLow; // High Engine clock in MHz.370UCHAR ucHighEngineClockHigh;371USHORT usMemoryClockLow; // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants.372UCHAR ucMemoryClockHigh; // Currentyl unused.373UCHAR ucPadding; // For proper alignment and size.374USHORT usVDDC; // For the 780, use: None, Low, High, Variable375UCHAR ucMaxHTLinkWidth; // From SBIOS - {2, 4, 8, 16}376UCHAR ucMinHTLinkWidth; // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could377USHORT usHTLinkFreq; // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200).378ULONG ulFlags;379} ATOM_PPLIB_RS780_CLOCK_INFO;380381#define ATOM_PPLIB_RS780_VOLTAGE_NONE 0382#define ATOM_PPLIB_RS780_VOLTAGE_LOW 1383#define ATOM_PPLIB_RS780_VOLTAGE_HIGH 2384#define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE 3385386#define ATOM_PPLIB_RS780_SPMCLK_NONE 0 // We cannot change the side port memory clock, leave it as it is.387#define ATOM_PPLIB_RS780_SPMCLK_LOW 1388#define ATOM_PPLIB_RS780_SPMCLK_HIGH 2389390#define ATOM_PPLIB_RS780_HTLINKFREQ_NONE 0391#define ATOM_PPLIB_RS780_HTLINKFREQ_LOW 1392#define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH 2393394typedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO395{396USHORT usEngineClockLow;397UCHAR ucEngineClockHigh;398399USHORT usMemoryClockLow;400UCHAR ucMemoryClockHigh;401402USHORT usVDDC;403USHORT usVDDCI;404USHORT usUnused;405406ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*407408} ATOM_PPLIB_EVERGREEN_CLOCK_INFO;409410typedef struct _ATOM_PPLIB_SI_CLOCK_INFO411{412USHORT usEngineClockLow;413UCHAR ucEngineClockHigh;414415USHORT usMemoryClockLow;416UCHAR ucMemoryClockHigh;417418USHORT usVDDC;419USHORT usVDDCI;420UCHAR ucPCIEGen;421UCHAR ucUnused1;422423ULONG ulFlags; // ATOM_PPLIB_SI_FLAGS_*, no flag is necessary for now424425} ATOM_PPLIB_SI_CLOCK_INFO;426427typedef struct _ATOM_PPLIB_CI_CLOCK_INFO428{429USHORT usEngineClockLow;430UCHAR ucEngineClockHigh;431432USHORT usMemoryClockLow;433UCHAR ucMemoryClockHigh;434435UCHAR ucPCIEGen;436USHORT usPCIELane;437} ATOM_PPLIB_CI_CLOCK_INFO;438439typedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{440USHORT usEngineClockLow; //clockfrequency & 0xFFFF. The unit is in 10khz441UCHAR ucEngineClockHigh; //clockfrequency >> 16.442UCHAR vddcIndex; //2-bit vddc index;443USHORT tdpLimit;444//please initalize to 0445USHORT rsv1;446//please initialize to 0s447ULONG rsv2[2];448}ATOM_PPLIB_SUMO_CLOCK_INFO;449450typedef struct _ATOM_PPLIB_KV_CLOCK_INFO {451USHORT usEngineClockLow;452UCHAR ucEngineClockHigh;453UCHAR vddcIndex;454USHORT tdpLimit;455USHORT rsv1;456ULONG rsv2[2];457} ATOM_PPLIB_KV_CLOCK_INFO;458459typedef struct _ATOM_PPLIB_CZ_CLOCK_INFO {460UCHAR index;461UCHAR rsv[3];462} ATOM_PPLIB_CZ_CLOCK_INFO;463464typedef struct _ATOM_PPLIB_STATE_V2465{466//number of valid dpm levels in this state; Driver uses it to calculate the whole467//size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR)468UCHAR ucNumDPMLevels;469470//a index to the array of nonClockInfos471UCHAR nonClockInfoIndex;472/**473* Driver will read the first ucNumDPMLevels in this array474*/475UCHAR clockInfoIndex[];476} ATOM_PPLIB_STATE_V2;477478typedef struct _StateArray{479//how many states we have480UCHAR ucNumEntries;481482ATOM_PPLIB_STATE_V2 states[] /* __counted_by(ucNumEntries) */;483}StateArray;484485486typedef struct _ClockInfoArray{487//how many clock levels we have488UCHAR ucNumEntries;489490//sizeof(ATOM_PPLIB_CLOCK_INFO)491UCHAR ucEntrySize;492493UCHAR clockInfo[];494}ClockInfoArray;495496typedef struct _NonClockInfoArray{497//how many non-clock levels we have. normally should be same as number of states498UCHAR ucNumEntries;499//sizeof(ATOM_PPLIB_NONCLOCK_INFO)500UCHAR ucEntrySize;501502ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[] __counted_by(ucNumEntries);503}NonClockInfoArray;504505typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record506{507USHORT usClockLow;508UCHAR ucClockHigh;509USHORT usVoltage;510}ATOM_PPLIB_Clock_Voltage_Dependency_Record;511512typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table513{514// Number of entries.515UCHAR ucNumEntries;516// Dynamically allocate entries.517ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[] __counted_by(ucNumEntries);518}ATOM_PPLIB_Clock_Voltage_Dependency_Table;519520typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record521{522USHORT usSclkLow;523UCHAR ucSclkHigh;524USHORT usMclkLow;525UCHAR ucMclkHigh;526USHORT usVddc;527USHORT usVddci;528}ATOM_PPLIB_Clock_Voltage_Limit_Record;529530typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table531{532// Number of entries.533UCHAR ucNumEntries;534// Dynamically allocate entries.535ATOM_PPLIB_Clock_Voltage_Limit_Record entries[] __counted_by(ucNumEntries);536}ATOM_PPLIB_Clock_Voltage_Limit_Table;537538union _ATOM_PPLIB_CAC_Leakage_Record539{540struct541{542USHORT 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 StdVoltageHiSidd543ULONG ulLeakageValue; // For CI and newer we use this as the "fake" standar VDDC value. in CI we read it as StdVoltageLoSidd544545};546struct547{548USHORT usVddc1;549USHORT usVddc2;550USHORT usVddc3;551};552};553554typedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record;555556typedef struct _ATOM_PPLIB_CAC_Leakage_Table557{558// Number of entries.559UCHAR ucNumEntries;560// Dynamically allocate entries.561ATOM_PPLIB_CAC_Leakage_Record entries[] __counted_by(ucNumEntries);562}ATOM_PPLIB_CAC_Leakage_Table;563564typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record565{566USHORT usVoltage;567USHORT usSclkLow;568UCHAR ucSclkHigh;569USHORT usMclkLow;570UCHAR ucMclkHigh;571}ATOM_PPLIB_PhaseSheddingLimits_Record;572573typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table574{575// Number of entries.576UCHAR ucNumEntries;577// Dynamically allocate entries.578ATOM_PPLIB_PhaseSheddingLimits_Record entries[] __counted_by(ucNumEntries);579}ATOM_PPLIB_PhaseSheddingLimits_Table;580581typedef struct _VCEClockInfo{582USHORT usEVClkLow;583UCHAR ucEVClkHigh;584USHORT usECClkLow;585UCHAR ucECClkHigh;586}VCEClockInfo;587588typedef struct _VCEClockInfoArray{589UCHAR ucNumEntries;590VCEClockInfo entries[] __counted_by(ucNumEntries);591}VCEClockInfoArray;592593typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record594{595USHORT usVoltage;596UCHAR ucVCEClockInfoIndex;597}ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record;598599typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table600{601UCHAR numEntries;602ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[] __counted_by(numEntries);603}ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table;604605typedef struct _ATOM_PPLIB_VCE_State_Record606{607UCHAR ucVCEClockInfoIndex;608UCHAR ucClockInfoIndex; //highest 2 bits indicates memory p-states, lower 6bits indicates index to ClockInfoArrary609}ATOM_PPLIB_VCE_State_Record;610611typedef struct _ATOM_PPLIB_VCE_State_Table612{613UCHAR numEntries;614ATOM_PPLIB_VCE_State_Record entries[] __counted_by(numEntries);615}ATOM_PPLIB_VCE_State_Table;616617618typedef struct _ATOM_PPLIB_VCE_Table619{620UCHAR revid;621// VCEClockInfoArray array;622// ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table limits;623// ATOM_PPLIB_VCE_State_Table states;624}ATOM_PPLIB_VCE_Table;625626627typedef struct _UVDClockInfo{628USHORT usVClkLow;629UCHAR ucVClkHigh;630USHORT usDClkLow;631UCHAR ucDClkHigh;632}UVDClockInfo;633634typedef struct _UVDClockInfoArray{635UCHAR ucNumEntries;636UVDClockInfo entries[] __counted_by(ucNumEntries);637}UVDClockInfoArray;638639typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record640{641USHORT usVoltage;642UCHAR ucUVDClockInfoIndex;643}ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record;644645typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table646{647UCHAR numEntries;648ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[] __counted_by(numEntries);649}ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table;650651typedef struct _ATOM_PPLIB_UVD_Table652{653UCHAR revid;654// UVDClockInfoArray array;655// ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table limits;656}ATOM_PPLIB_UVD_Table;657658typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record659{660USHORT usVoltage;661USHORT usSAMClockLow;662UCHAR ucSAMClockHigh;663}ATOM_PPLIB_SAMClk_Voltage_Limit_Record;664665typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{666UCHAR numEntries;667ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[] __counted_by(numEntries);668}ATOM_PPLIB_SAMClk_Voltage_Limit_Table;669670typedef struct _ATOM_PPLIB_SAMU_Table671{672UCHAR revid;673ATOM_PPLIB_SAMClk_Voltage_Limit_Table limits;674}ATOM_PPLIB_SAMU_Table;675676typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record677{678USHORT usVoltage;679USHORT usACPClockLow;680UCHAR ucACPClockHigh;681}ATOM_PPLIB_ACPClk_Voltage_Limit_Record;682683typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{684UCHAR numEntries;685ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[] __counted_by(numEntries);686}ATOM_PPLIB_ACPClk_Voltage_Limit_Table;687688typedef struct _ATOM_PPLIB_ACP_Table689{690UCHAR revid;691ATOM_PPLIB_ACPClk_Voltage_Limit_Table limits;692}ATOM_PPLIB_ACP_Table;693694typedef struct _ATOM_PowerTune_Table{695USHORT usTDP;696USHORT usConfigurableTDP;697USHORT usTDC;698USHORT usBatteryPowerLimit;699USHORT usSmallPowerLimit;700USHORT usLowCACLeakage;701USHORT usHighCACLeakage;702}ATOM_PowerTune_Table;703704typedef struct _ATOM_PPLIB_POWERTUNE_Table705{706UCHAR revid;707ATOM_PowerTune_Table power_tune_table;708}ATOM_PPLIB_POWERTUNE_Table;709710typedef struct _ATOM_PPLIB_POWERTUNE_Table_V1711{712UCHAR revid;713ATOM_PowerTune_Table power_tune_table;714USHORT usMaximumPowerDeliveryLimit;715USHORT usTjMax;716USHORT usReserve[6];717} ATOM_PPLIB_POWERTUNE_Table_V1;718719#define ATOM_PPM_A_A 1720#define ATOM_PPM_A_I 2721typedef struct _ATOM_PPLIB_PPM_Table722{723UCHAR ucRevId;724UCHAR ucPpmDesign; //A+I or A+A725USHORT usCpuCoreNumber;726ULONG ulPlatformTDP;727ULONG ulSmallACPlatformTDP;728ULONG ulPlatformTDC;729ULONG ulSmallACPlatformTDC;730ULONG ulApuTDP;731ULONG ulDGpuTDP;732ULONG ulDGpuUlvPower;733ULONG ulTjmax;734} ATOM_PPLIB_PPM_Table;735736#define VQ_DisplayConfig_NoneAWD 1737#define VQ_DisplayConfig_AWD 2738739typedef struct ATOM_PPLIB_VQ_Budgeting_Record{740ULONG ulDeviceID;741ULONG ulSustainableSOCPowerLimitLow; /* in mW */742ULONG ulSustainableSOCPowerLimitHigh; /* in mW */743744ULONG ulDClk;745ULONG ulEClk;746ULONG ulDispSclk;747UCHAR ucDispConfig;748749} ATOM_PPLIB_VQ_Budgeting_Record;750751typedef struct ATOM_PPLIB_VQ_Budgeting_Table {752UCHAR revid;753UCHAR numEntries;754ATOM_PPLIB_VQ_Budgeting_Record entries[] __counted_by(numEntries);755} ATOM_PPLIB_VQ_Budgeting_Table;756757#pragma pack()758759#endif760761762