162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright 2013 Advanced Micro Devices, Inc. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 562306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 662306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation 762306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 862306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 962306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 1062306a36Sopenharmony_ci * 1162306a36Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 1262306a36Sopenharmony_ci * all copies or substantial portions of the Software. 1362306a36Sopenharmony_ci * 1462306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1562306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1662306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1762306a36Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 1862306a36Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1962306a36Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2062306a36Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 2162306a36Sopenharmony_ci */ 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci#ifndef _PPTABLE_H 2462306a36Sopenharmony_ci#define _PPTABLE_H 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci#pragma pack(1) 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_THERMALCONTROLLER 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci{ 3162306a36Sopenharmony_ci UCHAR ucType; // one of ATOM_PP_THERMALCONTROLLER_* 3262306a36Sopenharmony_ci UCHAR ucI2cLine; // as interpreted by DAL I2C 3362306a36Sopenharmony_ci UCHAR ucI2cAddress; 3462306a36Sopenharmony_ci UCHAR ucFanParameters; // Fan Control Parameters. 3562306a36Sopenharmony_ci UCHAR ucFanMinRPM; // Fan Minimum RPM (hundreds) -- for display purposes only. 3662306a36Sopenharmony_ci UCHAR ucFanMaxRPM; // Fan Maximum RPM (hundreds) -- for display purposes only. 3762306a36Sopenharmony_ci UCHAR ucReserved; // ---- 3862306a36Sopenharmony_ci UCHAR ucFlags; // to be defined 3962306a36Sopenharmony_ci} ATOM_PPLIB_THERMALCONTROLLER; 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci#define ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f 4262306a36Sopenharmony_ci#define ATOM_PP_FANPARAMETERS_NOFAN 0x80 // No fan is connected to this controller. 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_NONE 0 4562306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_LM63 1 // Not used by PPLib 4662306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ADM1032 2 // Not used by PPLib 4762306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ADM1030 3 // Not used by PPLib 4862306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_MUA6649 4 // Not used by PPLib 4962306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_LM64 5 5062306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_F75375 6 // Not used by PPLib 5162306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_RV6xx 7 5262306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_RV770 8 5362306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ADT7473 9 5462306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_KONG 10 5562306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO 11 5662306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_EVERGREEN 12 5762306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_EMC2103 13 /* 0x0D */ // Only fan control will be implemented, do NOT show this in PPGen. 5862306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_SUMO 14 /* 0x0E */ // Sumo type, used internally 5962306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_NISLANDS 15 6062306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_SISLANDS 16 6162306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_LM96163 17 6262306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_CISLANDS 18 6362306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_KAVERI 19 6462306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ICELAND 20 6562306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_TONGA 21 6662306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_FIJI 22 6762306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_POLARIS10 23 6862306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_VEGA10 24 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci// Thermal controller 'combo type' to use an external controller for Fan control and an internal controller for thermal. 7262306a36Sopenharmony_ci// We probably should reserve the bit 0x80 for this use. 7362306a36Sopenharmony_ci// 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). 7462306a36Sopenharmony_ci// The driver can pick the correct internal controller based on the ASIC. 7562306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL 0x89 // ADT7473 Fan Control + Internal Thermal Controller 7662306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL 0x8D // EMC2103 Fan Control + Internal Thermal Controller 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_STATE 7962306a36Sopenharmony_ci{ 8062306a36Sopenharmony_ci UCHAR ucNonClockStateIndex; 8162306a36Sopenharmony_ci UCHAR ucClockStateIndices[]; // variable-sized 8262306a36Sopenharmony_ci} ATOM_PPLIB_STATE; 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE 8662306a36Sopenharmony_ci{ 8762306a36Sopenharmony_ci UCHAR ucFanTableFormat; // Change this if the table format changes or version changes so that the other fields are not the same. 8862306a36Sopenharmony_ci UCHAR ucTHyst; // Temperature hysteresis. Integer. 8962306a36Sopenharmony_ci USHORT usTMin; // The temperature, in 0.01 centigrades, below which we just run at a minimal PWM. 9062306a36Sopenharmony_ci USHORT usTMed; // The middle temperature where we change slopes. 9162306a36Sopenharmony_ci USHORT usTHigh; // The high point above TMed for adjusting the second slope. 9262306a36Sopenharmony_ci USHORT usPWMMin; // The minimum PWM value in percent (0.01% increments). 9362306a36Sopenharmony_ci USHORT usPWMMed; // The PWM value (in percent) at TMed. 9462306a36Sopenharmony_ci USHORT usPWMHigh; // The PWM value at THigh. 9562306a36Sopenharmony_ci} ATOM_PPLIB_FANTABLE; 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE2 9862306a36Sopenharmony_ci{ 9962306a36Sopenharmony_ci ATOM_PPLIB_FANTABLE basicTable; 10062306a36Sopenharmony_ci USHORT usTMax; // The max temperature 10162306a36Sopenharmony_ci} ATOM_PPLIB_FANTABLE2; 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE3 10462306a36Sopenharmony_ci{ 10562306a36Sopenharmony_ci ATOM_PPLIB_FANTABLE2 basicTable2; 10662306a36Sopenharmony_ci UCHAR ucFanControlMode; 10762306a36Sopenharmony_ci USHORT usFanPWMMax; 10862306a36Sopenharmony_ci USHORT usFanOutputSensitivity; 10962306a36Sopenharmony_ci} ATOM_PPLIB_FANTABLE3; 11062306a36Sopenharmony_ci 11162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE4 11262306a36Sopenharmony_ci{ 11362306a36Sopenharmony_ci ATOM_PPLIB_FANTABLE3 basicTable3; 11462306a36Sopenharmony_ci USHORT usFanRPMMax; 11562306a36Sopenharmony_ci} ATOM_PPLIB_FANTABLE4; 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE5 11862306a36Sopenharmony_ci{ 11962306a36Sopenharmony_ci ATOM_PPLIB_FANTABLE4 basicTable4; 12062306a36Sopenharmony_ci USHORT usFanCurrentLow; 12162306a36Sopenharmony_ci USHORT usFanCurrentHigh; 12262306a36Sopenharmony_ci USHORT usFanRPMLow; 12362306a36Sopenharmony_ci USHORT usFanRPMHigh; 12462306a36Sopenharmony_ci} ATOM_PPLIB_FANTABLE5; 12562306a36Sopenharmony_ci 12662306a36Sopenharmony_citypedef struct _ATOM_PPLIB_EXTENDEDHEADER 12762306a36Sopenharmony_ci{ 12862306a36Sopenharmony_ci USHORT usSize; 12962306a36Sopenharmony_ci ULONG ulMaxEngineClock; // For Overdrive. 13062306a36Sopenharmony_ci ULONG ulMaxMemoryClock; // For Overdrive. 13162306a36Sopenharmony_ci // Add extra system parameters here, always adjust size to include all fields. 13262306a36Sopenharmony_ci USHORT usVCETableOffset; //points to ATOM_PPLIB_VCE_Table 13362306a36Sopenharmony_ci USHORT usUVDTableOffset; //points to ATOM_PPLIB_UVD_Table 13462306a36Sopenharmony_ci USHORT usSAMUTableOffset; //points to ATOM_PPLIB_SAMU_Table 13562306a36Sopenharmony_ci USHORT usPPMTableOffset; //points to ATOM_PPLIB_PPM_Table 13662306a36Sopenharmony_ci USHORT usACPTableOffset; //points to ATOM_PPLIB_ACP_Table 13762306a36Sopenharmony_ci /* points to ATOM_PPLIB_POWERTUNE_Table */ 13862306a36Sopenharmony_ci USHORT usPowerTuneTableOffset; 13962306a36Sopenharmony_ci /* points to ATOM_PPLIB_CLOCK_Voltage_Dependency_Table for sclkVddgfxTable */ 14062306a36Sopenharmony_ci USHORT usSclkVddgfxTableOffset; 14162306a36Sopenharmony_ci USHORT usVQBudgetingTableOffset; /* points to the vqBudgetingTable; */ 14262306a36Sopenharmony_ci} ATOM_PPLIB_EXTENDEDHEADER; 14362306a36Sopenharmony_ci 14462306a36Sopenharmony_ci//// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps 14562306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_BACKBIAS 1 14662306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_POWERPLAY 2 14762306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4 14862306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8 14962306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_ASPM_L1 16 15062306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32 15162306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64 15262306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_STEPVDDC 128 15362306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256 15462306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512 15562306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024 15662306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048 15762306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096 15862306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000 // Go to boot state on alerts, e.g. on an AC->DC transition. 15962306a36Sopenharmony_ci#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). 16062306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000 // Does the driver control VDDCI independently from VDDC. 16162306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000 // Enable the 'regulator hot' feature. 16262306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_BACO 0x00020000 // Does the driver supports BACO state. 16362306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_NEW_CAC_VOLTAGE 0x00040000 // Does the driver supports new CAC voltage table. 16462306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY 0x00080000 // Does the driver supports revert GPIO5 polarity. 16562306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_OUTPUT_THERMAL2GPIO17 0x00100000 // Does the driver supports thermal2GPIO17. 16662306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VRHOT_GPIO_CONFIGURABLE 0x00200000 // Does the driver supports VR HOT GPIO Configurable. 16762306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_TEMP_INVERSION 0x00400000 // Does the driver supports Temp Inversion feature. 16862306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_EVV 0x00800000 16962306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_COMBINE_PCC_WITH_THERMAL_SIGNAL 0x01000000 17062306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_LOAD_POST_PRODUCTION_FIRMWARE 0x02000000 17162306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_DISABLE_USING_ACTUAL_TEMPERATURE_FOR_POWER_CALC 0x04000000 17262306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VRHOT_POLARITY_HIGH 0x08000000 17362306a36Sopenharmony_ci 17462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE 17562306a36Sopenharmony_ci{ 17662306a36Sopenharmony_ci ATOM_COMMON_TABLE_HEADER sHeader; 17762306a36Sopenharmony_ci 17862306a36Sopenharmony_ci UCHAR ucDataRevision; 17962306a36Sopenharmony_ci 18062306a36Sopenharmony_ci UCHAR ucNumStates; 18162306a36Sopenharmony_ci UCHAR ucStateEntrySize; 18262306a36Sopenharmony_ci UCHAR ucClockInfoSize; 18362306a36Sopenharmony_ci UCHAR ucNonClockSize; 18462306a36Sopenharmony_ci 18562306a36Sopenharmony_ci // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures 18662306a36Sopenharmony_ci USHORT usStateArrayOffset; 18762306a36Sopenharmony_ci 18862306a36Sopenharmony_ci // offset from start of this table to array of ASIC-specific structures, 18962306a36Sopenharmony_ci // currently ATOM_PPLIB_CLOCK_INFO. 19062306a36Sopenharmony_ci USHORT usClockInfoArrayOffset; 19162306a36Sopenharmony_ci 19262306a36Sopenharmony_ci // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO 19362306a36Sopenharmony_ci USHORT usNonClockInfoArrayOffset; 19462306a36Sopenharmony_ci 19562306a36Sopenharmony_ci USHORT usBackbiasTime; // in microseconds 19662306a36Sopenharmony_ci USHORT usVoltageTime; // in microseconds 19762306a36Sopenharmony_ci USHORT usTableSize; //the size of this structure, or the extended structure 19862306a36Sopenharmony_ci 19962306a36Sopenharmony_ci ULONG ulPlatformCaps; // See ATOM_PPLIB_CAPS_* 20062306a36Sopenharmony_ci 20162306a36Sopenharmony_ci ATOM_PPLIB_THERMALCONTROLLER sThermalController; 20262306a36Sopenharmony_ci 20362306a36Sopenharmony_ci USHORT usBootClockInfoOffset; 20462306a36Sopenharmony_ci USHORT usBootNonClockInfoOffset; 20562306a36Sopenharmony_ci 20662306a36Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE; 20762306a36Sopenharmony_ci 20862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE2 20962306a36Sopenharmony_ci{ 21062306a36Sopenharmony_ci ATOM_PPLIB_POWERPLAYTABLE basicTable; 21162306a36Sopenharmony_ci UCHAR ucNumCustomThermalPolicy; 21262306a36Sopenharmony_ci USHORT usCustomThermalPolicyArrayOffset; 21362306a36Sopenharmony_ci}ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2; 21462306a36Sopenharmony_ci 21562306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE3 21662306a36Sopenharmony_ci{ 21762306a36Sopenharmony_ci ATOM_PPLIB_POWERPLAYTABLE2 basicTable2; 21862306a36Sopenharmony_ci USHORT usFormatID; // To be used ONLY by PPGen. 21962306a36Sopenharmony_ci USHORT usFanTableOffset; 22062306a36Sopenharmony_ci USHORT usExtendendedHeaderOffset; 22162306a36Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3; 22262306a36Sopenharmony_ci 22362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE4 22462306a36Sopenharmony_ci{ 22562306a36Sopenharmony_ci ATOM_PPLIB_POWERPLAYTABLE3 basicTable3; 22662306a36Sopenharmony_ci ULONG ulGoldenPPID; // PPGen use only 22762306a36Sopenharmony_ci ULONG ulGoldenRevision; // PPGen use only 22862306a36Sopenharmony_ci USHORT usVddcDependencyOnSCLKOffset; 22962306a36Sopenharmony_ci USHORT usVddciDependencyOnMCLKOffset; 23062306a36Sopenharmony_ci USHORT usVddcDependencyOnMCLKOffset; 23162306a36Sopenharmony_ci USHORT usMaxClockVoltageOnDCOffset; 23262306a36Sopenharmony_ci USHORT usVddcPhaseShedLimitsTableOffset; // Points to ATOM_PPLIB_PhaseSheddingLimits_Table 23362306a36Sopenharmony_ci USHORT usMvddDependencyOnMCLKOffset; 23462306a36Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4; 23562306a36Sopenharmony_ci 23662306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE5 23762306a36Sopenharmony_ci{ 23862306a36Sopenharmony_ci ATOM_PPLIB_POWERPLAYTABLE4 basicTable4; 23962306a36Sopenharmony_ci ULONG ulTDPLimit; 24062306a36Sopenharmony_ci ULONG ulNearTDPLimit; 24162306a36Sopenharmony_ci ULONG ulSQRampingThreshold; 24262306a36Sopenharmony_ci USHORT usCACLeakageTableOffset; // Points to ATOM_PPLIB_CAC_Leakage_Table 24362306a36Sopenharmony_ci ULONG ulCACLeakage; // The iLeakage for driver calculated CAC leakage table 24462306a36Sopenharmony_ci USHORT usTDPODLimit; 24562306a36Sopenharmony_ci USHORT usLoadLineSlope; // in milliOhms * 100 24662306a36Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5; 24762306a36Sopenharmony_ci 24862306a36Sopenharmony_ci//// ATOM_PPLIB_NONCLOCK_INFO::usClassification 24962306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_MASK 0x0007 25062306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT 0 25162306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_NONE 0 25262306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY 1 25362306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED 3 25462306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE 5 25562306a36Sopenharmony_ci// 2, 4, 6, 7 are reserved 25662306a36Sopenharmony_ci 25762306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_BOOT 0x0008 25862306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_THERMAL 0x0010 25962306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE 0x0020 26062306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_REST 0x0040 26162306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_FORCED 0x0080 26262306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE 0x0100 26362306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE 0x0200 26462306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UVDSTATE 0x0400 26562306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_3DLOW 0x0800 26662306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_ACPI 0x1000 26762306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_HD2STATE 0x2000 26862306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_HDSTATE 0x4000 26962306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_SDSTATE 0x8000 27062306a36Sopenharmony_ci 27162306a36Sopenharmony_ci//// ATOM_PPLIB_NONCLOCK_INFO::usClassification2 27262306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2 0x0001 27362306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION2_ULV 0x0002 27462306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION2_MVC 0x0004 //Multi-View Codec (BD-3D) 27562306a36Sopenharmony_ci 27662306a36Sopenharmony_ci//// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings 27762306a36Sopenharmony_ci#define ATOM_PPLIB_SINGLE_DISPLAY_ONLY 0x00000001 27862306a36Sopenharmony_ci#define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK 0x00000002 27962306a36Sopenharmony_ci 28062306a36Sopenharmony_ci// 0 is 2.5Gb/s, 1 is 5Gb/s 28162306a36Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_SPEED_MASK 0x00000004 28262306a36Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT 2 28362306a36Sopenharmony_ci 28462306a36Sopenharmony_ci// lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec 28562306a36Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK 0x000000F8 28662306a36Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT 3 28762306a36Sopenharmony_ci 28862306a36Sopenharmony_ci// lookup into reduced refresh-rate table 28962306a36Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK 0x00000F00 29062306a36Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8 29162306a36Sopenharmony_ci 29262306a36Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED 0 29362306a36Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ 1 29462306a36Sopenharmony_ci// 2-15 TBD as needed. 29562306a36Sopenharmony_ci 29662306a36Sopenharmony_ci#define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING 0x00001000 29762306a36Sopenharmony_ci#define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS 0x00002000 29862306a36Sopenharmony_ci 29962306a36Sopenharmony_ci#define ATOM_PPLIB_DISALLOW_ON_DC 0x00004000 30062306a36Sopenharmony_ci 30162306a36Sopenharmony_ci#define ATOM_PPLIB_ENABLE_VARIBRIGHT 0x00008000 30262306a36Sopenharmony_ci 30362306a36Sopenharmony_ci//memory related flags 30462306a36Sopenharmony_ci#define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF 0x000010000 30562306a36Sopenharmony_ci 30662306a36Sopenharmony_ci//M3 Arb //2bits, current 3 sets of parameters in total 30762306a36Sopenharmony_ci#define ATOM_PPLIB_M3ARB_MASK 0x00060000 30862306a36Sopenharmony_ci#define ATOM_PPLIB_M3ARB_SHIFT 17 30962306a36Sopenharmony_ci 31062306a36Sopenharmony_ci#define ATOM_PPLIB_ENABLE_DRR 0x00080000 31162306a36Sopenharmony_ci 31262306a36Sopenharmony_ci// remaining 16 bits are reserved 31362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_THERMAL_STATE 31462306a36Sopenharmony_ci{ 31562306a36Sopenharmony_ci UCHAR ucMinTemperature; 31662306a36Sopenharmony_ci UCHAR ucMaxTemperature; 31762306a36Sopenharmony_ci UCHAR ucThermalAction; 31862306a36Sopenharmony_ci}ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE; 31962306a36Sopenharmony_ci 32062306a36Sopenharmony_ci// Contained in an array starting at the offset 32162306a36Sopenharmony_ci// in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset. 32262306a36Sopenharmony_ci// referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex 32362306a36Sopenharmony_ci#define ATOM_PPLIB_NONCLOCKINFO_VER1 12 32462306a36Sopenharmony_ci#define ATOM_PPLIB_NONCLOCKINFO_VER2 24 32562306a36Sopenharmony_citypedef struct _ATOM_PPLIB_NONCLOCK_INFO 32662306a36Sopenharmony_ci{ 32762306a36Sopenharmony_ci USHORT usClassification; 32862306a36Sopenharmony_ci UCHAR ucMinTemperature; 32962306a36Sopenharmony_ci UCHAR ucMaxTemperature; 33062306a36Sopenharmony_ci ULONG ulCapsAndSettings; 33162306a36Sopenharmony_ci UCHAR ucRequiredPower; 33262306a36Sopenharmony_ci USHORT usClassification2; 33362306a36Sopenharmony_ci ULONG ulVCLK; 33462306a36Sopenharmony_ci ULONG ulDCLK; 33562306a36Sopenharmony_ci UCHAR ucUnused[5]; 33662306a36Sopenharmony_ci} ATOM_PPLIB_NONCLOCK_INFO; 33762306a36Sopenharmony_ci 33862306a36Sopenharmony_ci// Contained in an array starting at the offset 33962306a36Sopenharmony_ci// in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset. 34062306a36Sopenharmony_ci// referenced from ATOM_PPLIB_STATE::ucClockStateIndices 34162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_R600_CLOCK_INFO 34262306a36Sopenharmony_ci{ 34362306a36Sopenharmony_ci USHORT usEngineClockLow; 34462306a36Sopenharmony_ci UCHAR ucEngineClockHigh; 34562306a36Sopenharmony_ci 34662306a36Sopenharmony_ci USHORT usMemoryClockLow; 34762306a36Sopenharmony_ci UCHAR ucMemoryClockHigh; 34862306a36Sopenharmony_ci 34962306a36Sopenharmony_ci USHORT usVDDC; 35062306a36Sopenharmony_ci USHORT usUnused1; 35162306a36Sopenharmony_ci USHORT usUnused2; 35262306a36Sopenharmony_ci 35362306a36Sopenharmony_ci ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_* 35462306a36Sopenharmony_ci 35562306a36Sopenharmony_ci} ATOM_PPLIB_R600_CLOCK_INFO; 35662306a36Sopenharmony_ci 35762306a36Sopenharmony_ci// ulFlags in ATOM_PPLIB_R600_CLOCK_INFO 35862306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_PCIEGEN2 1 35962306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_UVDSAFE 2 36062306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE 4 36162306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF 8 36262306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF 16 36362306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_LOWPOWER 32 // On the RV770 use 'low power' setting (sequencer S0). 36462306a36Sopenharmony_ci 36562306a36Sopenharmony_citypedef struct _ATOM_PPLIB_RS780_CLOCK_INFO 36662306a36Sopenharmony_ci 36762306a36Sopenharmony_ci{ 36862306a36Sopenharmony_ci USHORT usLowEngineClockLow; // Low Engine clock in MHz (the same way as on the R600). 36962306a36Sopenharmony_ci UCHAR ucLowEngineClockHigh; 37062306a36Sopenharmony_ci USHORT usHighEngineClockLow; // High Engine clock in MHz. 37162306a36Sopenharmony_ci UCHAR ucHighEngineClockHigh; 37262306a36Sopenharmony_ci USHORT usMemoryClockLow; // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants. 37362306a36Sopenharmony_ci UCHAR ucMemoryClockHigh; // Currentyl unused. 37462306a36Sopenharmony_ci UCHAR ucPadding; // For proper alignment and size. 37562306a36Sopenharmony_ci USHORT usVDDC; // For the 780, use: None, Low, High, Variable 37662306a36Sopenharmony_ci UCHAR ucMaxHTLinkWidth; // From SBIOS - {2, 4, 8, 16} 37762306a36Sopenharmony_ci UCHAR ucMinHTLinkWidth; // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could 37862306a36Sopenharmony_ci USHORT usHTLinkFreq; // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200). 37962306a36Sopenharmony_ci ULONG ulFlags; 38062306a36Sopenharmony_ci} ATOM_PPLIB_RS780_CLOCK_INFO; 38162306a36Sopenharmony_ci 38262306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_NONE 0 38362306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_LOW 1 38462306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_HIGH 2 38562306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE 3 38662306a36Sopenharmony_ci 38762306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_SPMCLK_NONE 0 // We cannot change the side port memory clock, leave it as it is. 38862306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_SPMCLK_LOW 1 38962306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_SPMCLK_HIGH 2 39062306a36Sopenharmony_ci 39162306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_HTLINKFREQ_NONE 0 39262306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_HTLINKFREQ_LOW 1 39362306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH 2 39462306a36Sopenharmony_ci 39562306a36Sopenharmony_citypedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO 39662306a36Sopenharmony_ci{ 39762306a36Sopenharmony_ci USHORT usEngineClockLow; 39862306a36Sopenharmony_ci UCHAR ucEngineClockHigh; 39962306a36Sopenharmony_ci 40062306a36Sopenharmony_ci USHORT usMemoryClockLow; 40162306a36Sopenharmony_ci UCHAR ucMemoryClockHigh; 40262306a36Sopenharmony_ci 40362306a36Sopenharmony_ci USHORT usVDDC; 40462306a36Sopenharmony_ci USHORT usVDDCI; 40562306a36Sopenharmony_ci USHORT usUnused; 40662306a36Sopenharmony_ci 40762306a36Sopenharmony_ci ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_* 40862306a36Sopenharmony_ci 40962306a36Sopenharmony_ci} ATOM_PPLIB_EVERGREEN_CLOCK_INFO; 41062306a36Sopenharmony_ci 41162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SI_CLOCK_INFO 41262306a36Sopenharmony_ci{ 41362306a36Sopenharmony_ci USHORT usEngineClockLow; 41462306a36Sopenharmony_ci UCHAR ucEngineClockHigh; 41562306a36Sopenharmony_ci 41662306a36Sopenharmony_ci USHORT usMemoryClockLow; 41762306a36Sopenharmony_ci UCHAR ucMemoryClockHigh; 41862306a36Sopenharmony_ci 41962306a36Sopenharmony_ci USHORT usVDDC; 42062306a36Sopenharmony_ci USHORT usVDDCI; 42162306a36Sopenharmony_ci UCHAR ucPCIEGen; 42262306a36Sopenharmony_ci UCHAR ucUnused1; 42362306a36Sopenharmony_ci 42462306a36Sopenharmony_ci ULONG ulFlags; // ATOM_PPLIB_SI_FLAGS_*, no flag is necessary for now 42562306a36Sopenharmony_ci 42662306a36Sopenharmony_ci} ATOM_PPLIB_SI_CLOCK_INFO; 42762306a36Sopenharmony_ci 42862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_CI_CLOCK_INFO 42962306a36Sopenharmony_ci{ 43062306a36Sopenharmony_ci USHORT usEngineClockLow; 43162306a36Sopenharmony_ci UCHAR ucEngineClockHigh; 43262306a36Sopenharmony_ci 43362306a36Sopenharmony_ci USHORT usMemoryClockLow; 43462306a36Sopenharmony_ci UCHAR ucMemoryClockHigh; 43562306a36Sopenharmony_ci 43662306a36Sopenharmony_ci UCHAR ucPCIEGen; 43762306a36Sopenharmony_ci USHORT usPCIELane; 43862306a36Sopenharmony_ci} ATOM_PPLIB_CI_CLOCK_INFO; 43962306a36Sopenharmony_ci 44062306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{ 44162306a36Sopenharmony_ci USHORT usEngineClockLow; //clockfrequency & 0xFFFF. The unit is in 10khz 44262306a36Sopenharmony_ci UCHAR ucEngineClockHigh; //clockfrequency >> 16. 44362306a36Sopenharmony_ci UCHAR vddcIndex; //2-bit vddc index; 44462306a36Sopenharmony_ci USHORT tdpLimit; 44562306a36Sopenharmony_ci //please initalize to 0 44662306a36Sopenharmony_ci USHORT rsv1; 44762306a36Sopenharmony_ci //please initialize to 0s 44862306a36Sopenharmony_ci ULONG rsv2[2]; 44962306a36Sopenharmony_ci}ATOM_PPLIB_SUMO_CLOCK_INFO; 45062306a36Sopenharmony_ci 45162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_KV_CLOCK_INFO { 45262306a36Sopenharmony_ci USHORT usEngineClockLow; 45362306a36Sopenharmony_ci UCHAR ucEngineClockHigh; 45462306a36Sopenharmony_ci UCHAR vddcIndex; 45562306a36Sopenharmony_ci USHORT tdpLimit; 45662306a36Sopenharmony_ci USHORT rsv1; 45762306a36Sopenharmony_ci ULONG rsv2[2]; 45862306a36Sopenharmony_ci} ATOM_PPLIB_KV_CLOCK_INFO; 45962306a36Sopenharmony_ci 46062306a36Sopenharmony_citypedef struct _ATOM_PPLIB_CZ_CLOCK_INFO { 46162306a36Sopenharmony_ci UCHAR index; 46262306a36Sopenharmony_ci UCHAR rsv[3]; 46362306a36Sopenharmony_ci} ATOM_PPLIB_CZ_CLOCK_INFO; 46462306a36Sopenharmony_ci 46562306a36Sopenharmony_citypedef struct _ATOM_PPLIB_STATE_V2 46662306a36Sopenharmony_ci{ 46762306a36Sopenharmony_ci //number of valid dpm levels in this state; Driver uses it to calculate the whole 46862306a36Sopenharmony_ci //size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR) 46962306a36Sopenharmony_ci UCHAR ucNumDPMLevels; 47062306a36Sopenharmony_ci 47162306a36Sopenharmony_ci //a index to the array of nonClockInfos 47262306a36Sopenharmony_ci UCHAR nonClockInfoIndex; 47362306a36Sopenharmony_ci /** 47462306a36Sopenharmony_ci * Driver will read the first ucNumDPMLevels in this array 47562306a36Sopenharmony_ci */ 47662306a36Sopenharmony_ci UCHAR clockInfoIndex[]; 47762306a36Sopenharmony_ci} ATOM_PPLIB_STATE_V2; 47862306a36Sopenharmony_ci 47962306a36Sopenharmony_citypedef struct _StateArray{ 48062306a36Sopenharmony_ci //how many states we have 48162306a36Sopenharmony_ci UCHAR ucNumEntries; 48262306a36Sopenharmony_ci 48362306a36Sopenharmony_ci ATOM_PPLIB_STATE_V2 states[1]; 48462306a36Sopenharmony_ci}StateArray; 48562306a36Sopenharmony_ci 48662306a36Sopenharmony_ci 48762306a36Sopenharmony_citypedef struct _ClockInfoArray{ 48862306a36Sopenharmony_ci //how many clock levels we have 48962306a36Sopenharmony_ci UCHAR ucNumEntries; 49062306a36Sopenharmony_ci 49162306a36Sopenharmony_ci //sizeof(ATOM_PPLIB_CLOCK_INFO) 49262306a36Sopenharmony_ci UCHAR ucEntrySize; 49362306a36Sopenharmony_ci 49462306a36Sopenharmony_ci UCHAR clockInfo[1]; 49562306a36Sopenharmony_ci}ClockInfoArray; 49662306a36Sopenharmony_ci 49762306a36Sopenharmony_citypedef struct _NonClockInfoArray{ 49862306a36Sopenharmony_ci 49962306a36Sopenharmony_ci //how many non-clock levels we have. normally should be same as number of states 50062306a36Sopenharmony_ci UCHAR ucNumEntries; 50162306a36Sopenharmony_ci //sizeof(ATOM_PPLIB_NONCLOCK_INFO) 50262306a36Sopenharmony_ci UCHAR ucEntrySize; 50362306a36Sopenharmony_ci 50462306a36Sopenharmony_ci ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1]; 50562306a36Sopenharmony_ci}NonClockInfoArray; 50662306a36Sopenharmony_ci 50762306a36Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record 50862306a36Sopenharmony_ci{ 50962306a36Sopenharmony_ci USHORT usClockLow; 51062306a36Sopenharmony_ci UCHAR ucClockHigh; 51162306a36Sopenharmony_ci USHORT usVoltage; 51262306a36Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Dependency_Record; 51362306a36Sopenharmony_ci 51462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table 51562306a36Sopenharmony_ci{ 51662306a36Sopenharmony_ci UCHAR ucNumEntries; // Number of entries. 51762306a36Sopenharmony_ci ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1]; // Dynamically allocate entries. 51862306a36Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Dependency_Table; 51962306a36Sopenharmony_ci 52062306a36Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record 52162306a36Sopenharmony_ci{ 52262306a36Sopenharmony_ci USHORT usSclkLow; 52362306a36Sopenharmony_ci UCHAR ucSclkHigh; 52462306a36Sopenharmony_ci USHORT usMclkLow; 52562306a36Sopenharmony_ci UCHAR ucMclkHigh; 52662306a36Sopenharmony_ci USHORT usVddc; 52762306a36Sopenharmony_ci USHORT usVddci; 52862306a36Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Limit_Record; 52962306a36Sopenharmony_ci 53062306a36Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table 53162306a36Sopenharmony_ci{ 53262306a36Sopenharmony_ci UCHAR ucNumEntries; // Number of entries. 53362306a36Sopenharmony_ci ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1]; // Dynamically allocate entries. 53462306a36Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Limit_Table; 53562306a36Sopenharmony_ci 53662306a36Sopenharmony_ciunion _ATOM_PPLIB_CAC_Leakage_Record 53762306a36Sopenharmony_ci{ 53862306a36Sopenharmony_ci struct 53962306a36Sopenharmony_ci { 54062306a36Sopenharmony_ci 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 54162306a36Sopenharmony_ci ULONG ulLeakageValue; // For CI and newer we use this as the "fake" standar VDDC value. in CI we read it as StdVoltageLoSidd 54262306a36Sopenharmony_ci 54362306a36Sopenharmony_ci }; 54462306a36Sopenharmony_ci struct 54562306a36Sopenharmony_ci { 54662306a36Sopenharmony_ci USHORT usVddc1; 54762306a36Sopenharmony_ci USHORT usVddc2; 54862306a36Sopenharmony_ci USHORT usVddc3; 54962306a36Sopenharmony_ci }; 55062306a36Sopenharmony_ci}; 55162306a36Sopenharmony_ci 55262306a36Sopenharmony_citypedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record; 55362306a36Sopenharmony_ci 55462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_CAC_Leakage_Table 55562306a36Sopenharmony_ci{ 55662306a36Sopenharmony_ci UCHAR ucNumEntries; // Number of entries. 55762306a36Sopenharmony_ci ATOM_PPLIB_CAC_Leakage_Record entries[1]; // Dynamically allocate entries. 55862306a36Sopenharmony_ci}ATOM_PPLIB_CAC_Leakage_Table; 55962306a36Sopenharmony_ci 56062306a36Sopenharmony_citypedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record 56162306a36Sopenharmony_ci{ 56262306a36Sopenharmony_ci USHORT usVoltage; 56362306a36Sopenharmony_ci USHORT usSclkLow; 56462306a36Sopenharmony_ci UCHAR ucSclkHigh; 56562306a36Sopenharmony_ci USHORT usMclkLow; 56662306a36Sopenharmony_ci UCHAR ucMclkHigh; 56762306a36Sopenharmony_ci}ATOM_PPLIB_PhaseSheddingLimits_Record; 56862306a36Sopenharmony_ci 56962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table 57062306a36Sopenharmony_ci{ 57162306a36Sopenharmony_ci UCHAR ucNumEntries; // Number of entries. 57262306a36Sopenharmony_ci ATOM_PPLIB_PhaseSheddingLimits_Record entries[1]; // Dynamically allocate entries. 57362306a36Sopenharmony_ci}ATOM_PPLIB_PhaseSheddingLimits_Table; 57462306a36Sopenharmony_ci 57562306a36Sopenharmony_citypedef struct _VCEClockInfo{ 57662306a36Sopenharmony_ci USHORT usEVClkLow; 57762306a36Sopenharmony_ci UCHAR ucEVClkHigh; 57862306a36Sopenharmony_ci USHORT usECClkLow; 57962306a36Sopenharmony_ci UCHAR ucECClkHigh; 58062306a36Sopenharmony_ci}VCEClockInfo; 58162306a36Sopenharmony_ci 58262306a36Sopenharmony_citypedef struct _VCEClockInfoArray{ 58362306a36Sopenharmony_ci UCHAR ucNumEntries; 58462306a36Sopenharmony_ci VCEClockInfo entries[1]; 58562306a36Sopenharmony_ci}VCEClockInfoArray; 58662306a36Sopenharmony_ci 58762306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record 58862306a36Sopenharmony_ci{ 58962306a36Sopenharmony_ci USHORT usVoltage; 59062306a36Sopenharmony_ci UCHAR ucVCEClockInfoIndex; 59162306a36Sopenharmony_ci}ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record; 59262306a36Sopenharmony_ci 59362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table 59462306a36Sopenharmony_ci{ 59562306a36Sopenharmony_ci UCHAR numEntries; 59662306a36Sopenharmony_ci ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[1]; 59762306a36Sopenharmony_ci}ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table; 59862306a36Sopenharmony_ci 59962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_State_Record 60062306a36Sopenharmony_ci{ 60162306a36Sopenharmony_ci UCHAR ucVCEClockInfoIndex; 60262306a36Sopenharmony_ci UCHAR ucClockInfoIndex; //highest 2 bits indicates memory p-states, lower 6bits indicates index to ClockInfoArrary 60362306a36Sopenharmony_ci}ATOM_PPLIB_VCE_State_Record; 60462306a36Sopenharmony_ci 60562306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_State_Table 60662306a36Sopenharmony_ci{ 60762306a36Sopenharmony_ci UCHAR numEntries; 60862306a36Sopenharmony_ci ATOM_PPLIB_VCE_State_Record entries[1]; 60962306a36Sopenharmony_ci}ATOM_PPLIB_VCE_State_Table; 61062306a36Sopenharmony_ci 61162306a36Sopenharmony_ci 61262306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_Table 61362306a36Sopenharmony_ci{ 61462306a36Sopenharmony_ci UCHAR revid; 61562306a36Sopenharmony_ci// VCEClockInfoArray array; 61662306a36Sopenharmony_ci// ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table limits; 61762306a36Sopenharmony_ci// ATOM_PPLIB_VCE_State_Table states; 61862306a36Sopenharmony_ci}ATOM_PPLIB_VCE_Table; 61962306a36Sopenharmony_ci 62062306a36Sopenharmony_ci 62162306a36Sopenharmony_citypedef struct _UVDClockInfo{ 62262306a36Sopenharmony_ci USHORT usVClkLow; 62362306a36Sopenharmony_ci UCHAR ucVClkHigh; 62462306a36Sopenharmony_ci USHORT usDClkLow; 62562306a36Sopenharmony_ci UCHAR ucDClkHigh; 62662306a36Sopenharmony_ci}UVDClockInfo; 62762306a36Sopenharmony_ci 62862306a36Sopenharmony_citypedef struct _UVDClockInfoArray{ 62962306a36Sopenharmony_ci UCHAR ucNumEntries; 63062306a36Sopenharmony_ci UVDClockInfo entries[1]; 63162306a36Sopenharmony_ci}UVDClockInfoArray; 63262306a36Sopenharmony_ci 63362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record 63462306a36Sopenharmony_ci{ 63562306a36Sopenharmony_ci USHORT usVoltage; 63662306a36Sopenharmony_ci UCHAR ucUVDClockInfoIndex; 63762306a36Sopenharmony_ci}ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record; 63862306a36Sopenharmony_ci 63962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table 64062306a36Sopenharmony_ci{ 64162306a36Sopenharmony_ci UCHAR numEntries; 64262306a36Sopenharmony_ci ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[1]; 64362306a36Sopenharmony_ci}ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table; 64462306a36Sopenharmony_ci 64562306a36Sopenharmony_citypedef struct _ATOM_PPLIB_UVD_Table 64662306a36Sopenharmony_ci{ 64762306a36Sopenharmony_ci UCHAR revid; 64862306a36Sopenharmony_ci// UVDClockInfoArray array; 64962306a36Sopenharmony_ci// ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table limits; 65062306a36Sopenharmony_ci}ATOM_PPLIB_UVD_Table; 65162306a36Sopenharmony_ci 65262306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record 65362306a36Sopenharmony_ci{ 65462306a36Sopenharmony_ci USHORT usVoltage; 65562306a36Sopenharmony_ci USHORT usSAMClockLow; 65662306a36Sopenharmony_ci UCHAR ucSAMClockHigh; 65762306a36Sopenharmony_ci}ATOM_PPLIB_SAMClk_Voltage_Limit_Record; 65862306a36Sopenharmony_ci 65962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{ 66062306a36Sopenharmony_ci UCHAR numEntries; 66162306a36Sopenharmony_ci ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[1]; 66262306a36Sopenharmony_ci}ATOM_PPLIB_SAMClk_Voltage_Limit_Table; 66362306a36Sopenharmony_ci 66462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SAMU_Table 66562306a36Sopenharmony_ci{ 66662306a36Sopenharmony_ci UCHAR revid; 66762306a36Sopenharmony_ci ATOM_PPLIB_SAMClk_Voltage_Limit_Table limits; 66862306a36Sopenharmony_ci}ATOM_PPLIB_SAMU_Table; 66962306a36Sopenharmony_ci 67062306a36Sopenharmony_citypedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record 67162306a36Sopenharmony_ci{ 67262306a36Sopenharmony_ci USHORT usVoltage; 67362306a36Sopenharmony_ci USHORT usACPClockLow; 67462306a36Sopenharmony_ci UCHAR ucACPClockHigh; 67562306a36Sopenharmony_ci}ATOM_PPLIB_ACPClk_Voltage_Limit_Record; 67662306a36Sopenharmony_ci 67762306a36Sopenharmony_citypedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{ 67862306a36Sopenharmony_ci UCHAR numEntries; 67962306a36Sopenharmony_ci ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[1]; 68062306a36Sopenharmony_ci}ATOM_PPLIB_ACPClk_Voltage_Limit_Table; 68162306a36Sopenharmony_ci 68262306a36Sopenharmony_citypedef struct _ATOM_PPLIB_ACP_Table 68362306a36Sopenharmony_ci{ 68462306a36Sopenharmony_ci UCHAR revid; 68562306a36Sopenharmony_ci ATOM_PPLIB_ACPClk_Voltage_Limit_Table limits; 68662306a36Sopenharmony_ci}ATOM_PPLIB_ACP_Table; 68762306a36Sopenharmony_ci 68862306a36Sopenharmony_citypedef struct _ATOM_PowerTune_Table{ 68962306a36Sopenharmony_ci USHORT usTDP; 69062306a36Sopenharmony_ci USHORT usConfigurableTDP; 69162306a36Sopenharmony_ci USHORT usTDC; 69262306a36Sopenharmony_ci USHORT usBatteryPowerLimit; 69362306a36Sopenharmony_ci USHORT usSmallPowerLimit; 69462306a36Sopenharmony_ci USHORT usLowCACLeakage; 69562306a36Sopenharmony_ci USHORT usHighCACLeakage; 69662306a36Sopenharmony_ci}ATOM_PowerTune_Table; 69762306a36Sopenharmony_ci 69862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERTUNE_Table 69962306a36Sopenharmony_ci{ 70062306a36Sopenharmony_ci UCHAR revid; 70162306a36Sopenharmony_ci ATOM_PowerTune_Table power_tune_table; 70262306a36Sopenharmony_ci}ATOM_PPLIB_POWERTUNE_Table; 70362306a36Sopenharmony_ci 70462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERTUNE_Table_V1 70562306a36Sopenharmony_ci{ 70662306a36Sopenharmony_ci UCHAR revid; 70762306a36Sopenharmony_ci ATOM_PowerTune_Table power_tune_table; 70862306a36Sopenharmony_ci USHORT usMaximumPowerDeliveryLimit; 70962306a36Sopenharmony_ci USHORT usTjMax; 71062306a36Sopenharmony_ci USHORT usReserve[6]; 71162306a36Sopenharmony_ci} ATOM_PPLIB_POWERTUNE_Table_V1; 71262306a36Sopenharmony_ci 71362306a36Sopenharmony_ci#define ATOM_PPM_A_A 1 71462306a36Sopenharmony_ci#define ATOM_PPM_A_I 2 71562306a36Sopenharmony_citypedef struct _ATOM_PPLIB_PPM_Table 71662306a36Sopenharmony_ci{ 71762306a36Sopenharmony_ci UCHAR ucRevId; 71862306a36Sopenharmony_ci UCHAR ucPpmDesign; //A+I or A+A 71962306a36Sopenharmony_ci USHORT usCpuCoreNumber; 72062306a36Sopenharmony_ci ULONG ulPlatformTDP; 72162306a36Sopenharmony_ci ULONG ulSmallACPlatformTDP; 72262306a36Sopenharmony_ci ULONG ulPlatformTDC; 72362306a36Sopenharmony_ci ULONG ulSmallACPlatformTDC; 72462306a36Sopenharmony_ci ULONG ulApuTDP; 72562306a36Sopenharmony_ci ULONG ulDGpuTDP; 72662306a36Sopenharmony_ci ULONG ulDGpuUlvPower; 72762306a36Sopenharmony_ci ULONG ulTjmax; 72862306a36Sopenharmony_ci} ATOM_PPLIB_PPM_Table; 72962306a36Sopenharmony_ci 73062306a36Sopenharmony_ci#define VQ_DisplayConfig_NoneAWD 1 73162306a36Sopenharmony_ci#define VQ_DisplayConfig_AWD 2 73262306a36Sopenharmony_ci 73362306a36Sopenharmony_citypedef struct ATOM_PPLIB_VQ_Budgeting_Record{ 73462306a36Sopenharmony_ci ULONG ulDeviceID; 73562306a36Sopenharmony_ci ULONG ulSustainableSOCPowerLimitLow; /* in mW */ 73662306a36Sopenharmony_ci ULONG ulSustainableSOCPowerLimitHigh; /* in mW */ 73762306a36Sopenharmony_ci 73862306a36Sopenharmony_ci ULONG ulDClk; 73962306a36Sopenharmony_ci ULONG ulEClk; 74062306a36Sopenharmony_ci ULONG ulDispSclk; 74162306a36Sopenharmony_ci UCHAR ucDispConfig; 74262306a36Sopenharmony_ci 74362306a36Sopenharmony_ci} ATOM_PPLIB_VQ_Budgeting_Record; 74462306a36Sopenharmony_ci 74562306a36Sopenharmony_citypedef struct ATOM_PPLIB_VQ_Budgeting_Table { 74662306a36Sopenharmony_ci UCHAR revid; 74762306a36Sopenharmony_ci UCHAR numEntries; 74862306a36Sopenharmony_ci ATOM_PPLIB_VQ_Budgeting_Record entries[1]; 74962306a36Sopenharmony_ci} ATOM_PPLIB_VQ_Budgeting_Table; 75062306a36Sopenharmony_ci 75162306a36Sopenharmony_ci#pragma pack() 75262306a36Sopenharmony_ci 75362306a36Sopenharmony_ci#endif 754