18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2013 Advanced Micro Devices, Inc.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
58c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
68c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation
78c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
88c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
98c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
128c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
168c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
178c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
188c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
198c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
208c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
218c2ecf20Sopenharmony_ci */
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#ifndef _PPTABLE_H
248c2ecf20Sopenharmony_ci#define _PPTABLE_H
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#pragma pack(1)
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_THERMALCONTROLLER
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci{
318c2ecf20Sopenharmony_ci    UCHAR ucType;           // one of ATOM_PP_THERMALCONTROLLER_*
328c2ecf20Sopenharmony_ci    UCHAR ucI2cLine;        // as interpreted by DAL I2C
338c2ecf20Sopenharmony_ci    UCHAR ucI2cAddress;
348c2ecf20Sopenharmony_ci    UCHAR ucFanParameters;  // Fan Control Parameters.
358c2ecf20Sopenharmony_ci    UCHAR ucFanMinRPM;      // Fan Minimum RPM (hundreds) -- for display purposes only.
368c2ecf20Sopenharmony_ci    UCHAR ucFanMaxRPM;      // Fan Maximum RPM (hundreds) -- for display purposes only.
378c2ecf20Sopenharmony_ci    UCHAR ucReserved;       // ----
388c2ecf20Sopenharmony_ci    UCHAR ucFlags;          // to be defined
398c2ecf20Sopenharmony_ci} ATOM_PPLIB_THERMALCONTROLLER;
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#define ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f
428c2ecf20Sopenharmony_ci#define ATOM_PP_FANPARAMETERS_NOFAN                                 0x80    // No fan is connected to this controller.
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_NONE      0
458c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_LM63      1  // Not used by PPLib
468c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ADM1032   2  // Not used by PPLib
478c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ADM1030   3  // Not used by PPLib
488c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_MUA6649   4  // Not used by PPLib
498c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_LM64      5
508c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_F75375    6  // Not used by PPLib
518c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_RV6xx     7
528c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_RV770     8
538c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ADT7473   9
548c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_KONG      10
558c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO     11
568c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_EVERGREEN 12
578c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_EMC2103   13  /* 0x0D */ // Only fan control will be implemented, do NOT show this in PPGen.
588c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_SUMO      14  /* 0x0E */ // Sumo type, used internally
598c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_NISLANDS  15
608c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_SISLANDS  16
618c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_LM96163   17
628c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_CISLANDS  18
638c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_KAVERI    19
648c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ICELAND   20
658c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_TONGA     21
668c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_FIJI      22
678c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_POLARIS10 23
688c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_VEGA10    24
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci// Thermal controller 'combo type' to use an external controller for Fan control and an internal controller for thermal.
728c2ecf20Sopenharmony_ci// We probably should reserve the bit 0x80 for this use.
738c2ecf20Sopenharmony_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).
748c2ecf20Sopenharmony_ci// The driver can pick the correct internal controller based on the ASIC.
758c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL   0x89    // ADT7473 Fan Control + Internal Thermal Controller
768c2ecf20Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL   0x8D    // EMC2103 Fan Control + Internal Thermal Controller
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_STATE
798c2ecf20Sopenharmony_ci{
808c2ecf20Sopenharmony_ci    UCHAR ucNonClockStateIndex;
818c2ecf20Sopenharmony_ci    UCHAR ucClockStateIndices[]; // variable-sized
828c2ecf20Sopenharmony_ci} ATOM_PPLIB_STATE;
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE
868c2ecf20Sopenharmony_ci{
878c2ecf20Sopenharmony_ci    UCHAR   ucFanTableFormat;                // Change this if the table format changes or version changes so that the other fields are not the same.
888c2ecf20Sopenharmony_ci    UCHAR   ucTHyst;                         // Temperature hysteresis. Integer.
898c2ecf20Sopenharmony_ci    USHORT  usTMin;                          // The temperature, in 0.01 centigrades, below which we just run at a minimal PWM.
908c2ecf20Sopenharmony_ci    USHORT  usTMed;                          // The middle temperature where we change slopes.
918c2ecf20Sopenharmony_ci    USHORT  usTHigh;                         // The high point above TMed for adjusting the second slope.
928c2ecf20Sopenharmony_ci    USHORT  usPWMMin;                        // The minimum PWM value in percent (0.01% increments).
938c2ecf20Sopenharmony_ci    USHORT  usPWMMed;                        // The PWM value (in percent) at TMed.
948c2ecf20Sopenharmony_ci    USHORT  usPWMHigh;                       // The PWM value at THigh.
958c2ecf20Sopenharmony_ci} ATOM_PPLIB_FANTABLE;
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE2
988c2ecf20Sopenharmony_ci{
998c2ecf20Sopenharmony_ci    ATOM_PPLIB_FANTABLE basicTable;
1008c2ecf20Sopenharmony_ci    USHORT  usTMax;                          // The max temperature
1018c2ecf20Sopenharmony_ci} ATOM_PPLIB_FANTABLE2;
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE3
1048c2ecf20Sopenharmony_ci{
1058c2ecf20Sopenharmony_ci	ATOM_PPLIB_FANTABLE2 basicTable2;
1068c2ecf20Sopenharmony_ci	UCHAR ucFanControlMode;
1078c2ecf20Sopenharmony_ci	USHORT usFanPWMMax;
1088c2ecf20Sopenharmony_ci	USHORT usFanOutputSensitivity;
1098c2ecf20Sopenharmony_ci} ATOM_PPLIB_FANTABLE3;
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE4
1128c2ecf20Sopenharmony_ci{
1138c2ecf20Sopenharmony_ci    ATOM_PPLIB_FANTABLE3 basicTable3;
1148c2ecf20Sopenharmony_ci    USHORT  usFanRPMMax;
1158c2ecf20Sopenharmony_ci} ATOM_PPLIB_FANTABLE4;
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE5
1188c2ecf20Sopenharmony_ci{
1198c2ecf20Sopenharmony_ci    ATOM_PPLIB_FANTABLE4 basicTable4;
1208c2ecf20Sopenharmony_ci    USHORT  usFanCurrentLow;
1218c2ecf20Sopenharmony_ci    USHORT  usFanCurrentHigh;
1228c2ecf20Sopenharmony_ci    USHORT  usFanRPMLow;
1238c2ecf20Sopenharmony_ci    USHORT  usFanRPMHigh;
1248c2ecf20Sopenharmony_ci} ATOM_PPLIB_FANTABLE5;
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_EXTENDEDHEADER
1278c2ecf20Sopenharmony_ci{
1288c2ecf20Sopenharmony_ci    USHORT  usSize;
1298c2ecf20Sopenharmony_ci    ULONG   ulMaxEngineClock;   // For Overdrive.
1308c2ecf20Sopenharmony_ci    ULONG   ulMaxMemoryClock;   // For Overdrive.
1318c2ecf20Sopenharmony_ci    // Add extra system parameters here, always adjust size to include all fields.
1328c2ecf20Sopenharmony_ci    USHORT  usVCETableOffset; //points to ATOM_PPLIB_VCE_Table
1338c2ecf20Sopenharmony_ci    USHORT  usUVDTableOffset;   //points to ATOM_PPLIB_UVD_Table
1348c2ecf20Sopenharmony_ci    USHORT  usSAMUTableOffset;  //points to ATOM_PPLIB_SAMU_Table
1358c2ecf20Sopenharmony_ci    USHORT  usPPMTableOffset;   //points to ATOM_PPLIB_PPM_Table
1368c2ecf20Sopenharmony_ci    USHORT  usACPTableOffset;  //points to ATOM_PPLIB_ACP_Table
1378c2ecf20Sopenharmony_ci    /* points to ATOM_PPLIB_POWERTUNE_Table */
1388c2ecf20Sopenharmony_ci    USHORT  usPowerTuneTableOffset;
1398c2ecf20Sopenharmony_ci    /* points to ATOM_PPLIB_CLOCK_Voltage_Dependency_Table for sclkVddgfxTable */
1408c2ecf20Sopenharmony_ci    USHORT  usSclkVddgfxTableOffset;
1418c2ecf20Sopenharmony_ci    USHORT  usVQBudgetingTableOffset; /* points to the vqBudgetingTable; */
1428c2ecf20Sopenharmony_ci} ATOM_PPLIB_EXTENDEDHEADER;
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci//// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps
1458c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_BACKBIAS 1
1468c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_POWERPLAY 2
1478c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4
1488c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8
1498c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_ASPM_L1 16
1508c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32
1518c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64
1528c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_STEPVDDC 128
1538c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256
1548c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512
1558c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024
1568c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048
1578c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096
1588c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000              // Go to boot state on alerts, e.g. on an AC->DC transition.
1598c2ecf20Sopenharmony_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).
1608c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000                   // Does the driver control VDDCI independently from VDDC.
1618c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000               // Enable the 'regulator hot' feature.
1628c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_BACO          0x00020000               // Does the driver supports BACO state.
1638c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_NEW_CAC_VOLTAGE   0x00040000           // Does the driver supports new CAC voltage table.
1648c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY   0x00080000     // Does the driver supports revert GPIO5 polarity.
1658c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_OUTPUT_THERMAL2GPIO17   0x00100000     // Does the driver supports thermal2GPIO17.
1668c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VRHOT_GPIO_CONFIGURABLE   0x00200000   // Does the driver supports VR HOT GPIO Configurable.
1678c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_TEMP_INVERSION   0x00400000            // Does the driver supports Temp Inversion feature.
1688c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_EVV    0x00800000
1698c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_COMBINE_PCC_WITH_THERMAL_SIGNAL    0x01000000
1708c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_LOAD_POST_PRODUCTION_FIRMWARE    0x02000000
1718c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_DISABLE_USING_ACTUAL_TEMPERATURE_FOR_POWER_CALC   0x04000000
1728c2ecf20Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VRHOT_POLARITY_HIGH   0x08000000
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE
1758c2ecf20Sopenharmony_ci{
1768c2ecf20Sopenharmony_ci      ATOM_COMMON_TABLE_HEADER sHeader;
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci      UCHAR ucDataRevision;
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci      UCHAR ucNumStates;
1818c2ecf20Sopenharmony_ci      UCHAR ucStateEntrySize;
1828c2ecf20Sopenharmony_ci      UCHAR ucClockInfoSize;
1838c2ecf20Sopenharmony_ci      UCHAR ucNonClockSize;
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci      // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures
1868c2ecf20Sopenharmony_ci      USHORT usStateArrayOffset;
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci      // offset from start of this table to array of ASIC-specific structures,
1898c2ecf20Sopenharmony_ci      // currently ATOM_PPLIB_CLOCK_INFO.
1908c2ecf20Sopenharmony_ci      USHORT usClockInfoArrayOffset;
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci      // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO
1938c2ecf20Sopenharmony_ci      USHORT usNonClockInfoArrayOffset;
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci      USHORT usBackbiasTime;    // in microseconds
1968c2ecf20Sopenharmony_ci      USHORT usVoltageTime;     // in microseconds
1978c2ecf20Sopenharmony_ci      USHORT usTableSize;       //the size of this structure, or the extended structure
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci      ULONG ulPlatformCaps;            // See ATOM_PPLIB_CAPS_*
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci      ATOM_PPLIB_THERMALCONTROLLER    sThermalController;
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci      USHORT usBootClockInfoOffset;
2048c2ecf20Sopenharmony_ci      USHORT usBootNonClockInfoOffset;
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE;
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE2
2098c2ecf20Sopenharmony_ci{
2108c2ecf20Sopenharmony_ci    ATOM_PPLIB_POWERPLAYTABLE basicTable;
2118c2ecf20Sopenharmony_ci    UCHAR   ucNumCustomThermalPolicy;
2128c2ecf20Sopenharmony_ci    USHORT  usCustomThermalPolicyArrayOffset;
2138c2ecf20Sopenharmony_ci}ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2;
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE3
2168c2ecf20Sopenharmony_ci{
2178c2ecf20Sopenharmony_ci    ATOM_PPLIB_POWERPLAYTABLE2 basicTable2;
2188c2ecf20Sopenharmony_ci    USHORT                     usFormatID;                      // To be used ONLY by PPGen.
2198c2ecf20Sopenharmony_ci    USHORT                     usFanTableOffset;
2208c2ecf20Sopenharmony_ci    USHORT                     usExtendendedHeaderOffset;
2218c2ecf20Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3;
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE4
2248c2ecf20Sopenharmony_ci{
2258c2ecf20Sopenharmony_ci    ATOM_PPLIB_POWERPLAYTABLE3 basicTable3;
2268c2ecf20Sopenharmony_ci    ULONG                      ulGoldenPPID;                    // PPGen use only
2278c2ecf20Sopenharmony_ci    ULONG                      ulGoldenRevision;                // PPGen use only
2288c2ecf20Sopenharmony_ci    USHORT                     usVddcDependencyOnSCLKOffset;
2298c2ecf20Sopenharmony_ci    USHORT                     usVddciDependencyOnMCLKOffset;
2308c2ecf20Sopenharmony_ci    USHORT                     usVddcDependencyOnMCLKOffset;
2318c2ecf20Sopenharmony_ci    USHORT                     usMaxClockVoltageOnDCOffset;
2328c2ecf20Sopenharmony_ci    USHORT                     usVddcPhaseShedLimitsTableOffset;    // Points to ATOM_PPLIB_PhaseSheddingLimits_Table
2338c2ecf20Sopenharmony_ci    USHORT                     usMvddDependencyOnMCLKOffset;
2348c2ecf20Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4;
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE5
2378c2ecf20Sopenharmony_ci{
2388c2ecf20Sopenharmony_ci    ATOM_PPLIB_POWERPLAYTABLE4 basicTable4;
2398c2ecf20Sopenharmony_ci    ULONG                      ulTDPLimit;
2408c2ecf20Sopenharmony_ci    ULONG                      ulNearTDPLimit;
2418c2ecf20Sopenharmony_ci    ULONG                      ulSQRampingThreshold;
2428c2ecf20Sopenharmony_ci    USHORT                     usCACLeakageTableOffset;         // Points to ATOM_PPLIB_CAC_Leakage_Table
2438c2ecf20Sopenharmony_ci    ULONG                      ulCACLeakage;                    // The iLeakage for driver calculated CAC leakage table
2448c2ecf20Sopenharmony_ci    USHORT                     usTDPODLimit;
2458c2ecf20Sopenharmony_ci    USHORT                     usLoadLineSlope;                 // in milliOhms * 100
2468c2ecf20Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5;
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_ci//// ATOM_PPLIB_NONCLOCK_INFO::usClassification
2498c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_MASK          0x0007
2508c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT         0
2518c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_NONE          0
2528c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY       1
2538c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED      3
2548c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE   5
2558c2ecf20Sopenharmony_ci// 2, 4, 6, 7 are reserved
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_BOOT                   0x0008
2588c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_THERMAL                0x0010
2598c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE     0x0020
2608c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_REST                   0x0040
2618c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_FORCED                 0x0080
2628c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE          0x0100
2638c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE      0x0200
2648c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UVDSTATE               0x0400
2658c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_3DLOW                  0x0800
2668c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_ACPI                   0x1000
2678c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_HD2STATE               0x2000
2688c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_HDSTATE                0x4000
2698c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_SDSTATE                0x8000
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci//// ATOM_PPLIB_NONCLOCK_INFO::usClassification2
2728c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2     0x0001
2738c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION2_ULV                      0x0002
2748c2ecf20Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION2_MVC                      0x0004   //Multi-View Codec (BD-3D)
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci//// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings
2778c2ecf20Sopenharmony_ci#define ATOM_PPLIB_SINGLE_DISPLAY_ONLY           0x00000001
2788c2ecf20Sopenharmony_ci#define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK         0x00000002
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci// 0 is 2.5Gb/s, 1 is 5Gb/s
2818c2ecf20Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_SPEED_MASK            0x00000004
2828c2ecf20Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT           2
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_ci// lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec
2858c2ecf20Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK            0x000000F8
2868c2ecf20Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT           3
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci// lookup into reduced refresh-rate table
2898c2ecf20Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK  0x00000F00
2908c2ecf20Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED    0
2938c2ecf20Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ         1
2948c2ecf20Sopenharmony_ci// 2-15 TBD as needed.
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_ci#define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING        0x00001000
2978c2ecf20Sopenharmony_ci#define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS  0x00002000
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci#define ATOM_PPLIB_DISALLOW_ON_DC                       0x00004000
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci#define ATOM_PPLIB_ENABLE_VARIBRIGHT                     0x00008000
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci//memory related flags
3048c2ecf20Sopenharmony_ci#define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF               0x000010000
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci//M3 Arb    //2bits, current 3 sets of parameters in total
3078c2ecf20Sopenharmony_ci#define ATOM_PPLIB_M3ARB_MASK                       0x00060000
3088c2ecf20Sopenharmony_ci#define ATOM_PPLIB_M3ARB_SHIFT                      17
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_ci#define ATOM_PPLIB_ENABLE_DRR                       0x00080000
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci// remaining 16 bits are reserved
3138c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_THERMAL_STATE
3148c2ecf20Sopenharmony_ci{
3158c2ecf20Sopenharmony_ci    UCHAR   ucMinTemperature;
3168c2ecf20Sopenharmony_ci    UCHAR   ucMaxTemperature;
3178c2ecf20Sopenharmony_ci    UCHAR   ucThermalAction;
3188c2ecf20Sopenharmony_ci}ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE;
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_ci// Contained in an array starting at the offset
3218c2ecf20Sopenharmony_ci// in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset.
3228c2ecf20Sopenharmony_ci// referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex
3238c2ecf20Sopenharmony_ci#define ATOM_PPLIB_NONCLOCKINFO_VER1      12
3248c2ecf20Sopenharmony_ci#define ATOM_PPLIB_NONCLOCKINFO_VER2      24
3258c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_NONCLOCK_INFO
3268c2ecf20Sopenharmony_ci{
3278c2ecf20Sopenharmony_ci      USHORT usClassification;
3288c2ecf20Sopenharmony_ci      UCHAR  ucMinTemperature;
3298c2ecf20Sopenharmony_ci      UCHAR  ucMaxTemperature;
3308c2ecf20Sopenharmony_ci      ULONG  ulCapsAndSettings;
3318c2ecf20Sopenharmony_ci      UCHAR  ucRequiredPower;
3328c2ecf20Sopenharmony_ci      USHORT usClassification2;
3338c2ecf20Sopenharmony_ci      ULONG  ulVCLK;
3348c2ecf20Sopenharmony_ci      ULONG  ulDCLK;
3358c2ecf20Sopenharmony_ci      UCHAR  ucUnused[5];
3368c2ecf20Sopenharmony_ci} ATOM_PPLIB_NONCLOCK_INFO;
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci// Contained in an array starting at the offset
3398c2ecf20Sopenharmony_ci// in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset.
3408c2ecf20Sopenharmony_ci// referenced from ATOM_PPLIB_STATE::ucClockStateIndices
3418c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_R600_CLOCK_INFO
3428c2ecf20Sopenharmony_ci{
3438c2ecf20Sopenharmony_ci      USHORT usEngineClockLow;
3448c2ecf20Sopenharmony_ci      UCHAR ucEngineClockHigh;
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_ci      USHORT usMemoryClockLow;
3478c2ecf20Sopenharmony_ci      UCHAR ucMemoryClockHigh;
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ci      USHORT usVDDC;
3508c2ecf20Sopenharmony_ci      USHORT usUnused1;
3518c2ecf20Sopenharmony_ci      USHORT usUnused2;
3528c2ecf20Sopenharmony_ci
3538c2ecf20Sopenharmony_ci      ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci} ATOM_PPLIB_R600_CLOCK_INFO;
3568c2ecf20Sopenharmony_ci
3578c2ecf20Sopenharmony_ci// ulFlags in ATOM_PPLIB_R600_CLOCK_INFO
3588c2ecf20Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_PCIEGEN2          1
3598c2ecf20Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_UVDSAFE           2
3608c2ecf20Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE    4
3618c2ecf20Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF    8
3628c2ecf20Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF   16
3638c2ecf20Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_LOWPOWER         32   // On the RV770 use 'low power' setting (sequencer S0).
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_RS780_CLOCK_INFO
3668c2ecf20Sopenharmony_ci
3678c2ecf20Sopenharmony_ci{
3688c2ecf20Sopenharmony_ci      USHORT usLowEngineClockLow;         // Low Engine clock in MHz (the same way as on the R600).
3698c2ecf20Sopenharmony_ci      UCHAR  ucLowEngineClockHigh;
3708c2ecf20Sopenharmony_ci      USHORT usHighEngineClockLow;        // High Engine clock in MHz.
3718c2ecf20Sopenharmony_ci      UCHAR  ucHighEngineClockHigh;
3728c2ecf20Sopenharmony_ci      USHORT usMemoryClockLow;            // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants.
3738c2ecf20Sopenharmony_ci      UCHAR  ucMemoryClockHigh;           // Currentyl unused.
3748c2ecf20Sopenharmony_ci      UCHAR  ucPadding;                   // For proper alignment and size.
3758c2ecf20Sopenharmony_ci      USHORT usVDDC;                      // For the 780, use: None, Low, High, Variable
3768c2ecf20Sopenharmony_ci      UCHAR  ucMaxHTLinkWidth;            // From SBIOS - {2, 4, 8, 16}
3778c2ecf20Sopenharmony_ci      UCHAR  ucMinHTLinkWidth;            // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could
3788c2ecf20Sopenharmony_ci      USHORT usHTLinkFreq;                // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200).
3798c2ecf20Sopenharmony_ci      ULONG  ulFlags;
3808c2ecf20Sopenharmony_ci} ATOM_PPLIB_RS780_CLOCK_INFO;
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_NONE       0
3838c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_LOW        1
3848c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_HIGH       2
3858c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE   3
3868c2ecf20Sopenharmony_ci
3878c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_SPMCLK_NONE        0   // We cannot change the side port memory clock, leave it as it is.
3888c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_SPMCLK_LOW         1
3898c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_SPMCLK_HIGH        2
3908c2ecf20Sopenharmony_ci
3918c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_HTLINKFREQ_NONE       0
3928c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_HTLINKFREQ_LOW        1
3938c2ecf20Sopenharmony_ci#define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH       2
3948c2ecf20Sopenharmony_ci
3958c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO
3968c2ecf20Sopenharmony_ci{
3978c2ecf20Sopenharmony_ci      USHORT usEngineClockLow;
3988c2ecf20Sopenharmony_ci      UCHAR  ucEngineClockHigh;
3998c2ecf20Sopenharmony_ci
4008c2ecf20Sopenharmony_ci      USHORT usMemoryClockLow;
4018c2ecf20Sopenharmony_ci      UCHAR  ucMemoryClockHigh;
4028c2ecf20Sopenharmony_ci
4038c2ecf20Sopenharmony_ci      USHORT usVDDC;
4048c2ecf20Sopenharmony_ci      USHORT usVDDCI;
4058c2ecf20Sopenharmony_ci      USHORT usUnused;
4068c2ecf20Sopenharmony_ci
4078c2ecf20Sopenharmony_ci      ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
4088c2ecf20Sopenharmony_ci
4098c2ecf20Sopenharmony_ci} ATOM_PPLIB_EVERGREEN_CLOCK_INFO;
4108c2ecf20Sopenharmony_ci
4118c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_SI_CLOCK_INFO
4128c2ecf20Sopenharmony_ci{
4138c2ecf20Sopenharmony_ci      USHORT usEngineClockLow;
4148c2ecf20Sopenharmony_ci      UCHAR  ucEngineClockHigh;
4158c2ecf20Sopenharmony_ci
4168c2ecf20Sopenharmony_ci      USHORT usMemoryClockLow;
4178c2ecf20Sopenharmony_ci      UCHAR  ucMemoryClockHigh;
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_ci      USHORT usVDDC;
4208c2ecf20Sopenharmony_ci      USHORT usVDDCI;
4218c2ecf20Sopenharmony_ci      UCHAR  ucPCIEGen;
4228c2ecf20Sopenharmony_ci      UCHAR  ucUnused1;
4238c2ecf20Sopenharmony_ci
4248c2ecf20Sopenharmony_ci      ULONG ulFlags; // ATOM_PPLIB_SI_FLAGS_*, no flag is necessary for now
4258c2ecf20Sopenharmony_ci
4268c2ecf20Sopenharmony_ci} ATOM_PPLIB_SI_CLOCK_INFO;
4278c2ecf20Sopenharmony_ci
4288c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_CI_CLOCK_INFO
4298c2ecf20Sopenharmony_ci{
4308c2ecf20Sopenharmony_ci      USHORT usEngineClockLow;
4318c2ecf20Sopenharmony_ci      UCHAR  ucEngineClockHigh;
4328c2ecf20Sopenharmony_ci
4338c2ecf20Sopenharmony_ci      USHORT usMemoryClockLow;
4348c2ecf20Sopenharmony_ci      UCHAR  ucMemoryClockHigh;
4358c2ecf20Sopenharmony_ci
4368c2ecf20Sopenharmony_ci      UCHAR  ucPCIEGen;
4378c2ecf20Sopenharmony_ci      USHORT usPCIELane;
4388c2ecf20Sopenharmony_ci} ATOM_PPLIB_CI_CLOCK_INFO;
4398c2ecf20Sopenharmony_ci
4408c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{
4418c2ecf20Sopenharmony_ci      USHORT usEngineClockLow;  //clockfrequency & 0xFFFF. The unit is in 10khz
4428c2ecf20Sopenharmony_ci      UCHAR  ucEngineClockHigh; //clockfrequency >> 16.
4438c2ecf20Sopenharmony_ci      UCHAR  vddcIndex;         //2-bit vddc index;
4448c2ecf20Sopenharmony_ci      USHORT tdpLimit;
4458c2ecf20Sopenharmony_ci      //please initalize to 0
4468c2ecf20Sopenharmony_ci      USHORT rsv1;
4478c2ecf20Sopenharmony_ci      //please initialize to 0s
4488c2ecf20Sopenharmony_ci      ULONG rsv2[2];
4498c2ecf20Sopenharmony_ci}ATOM_PPLIB_SUMO_CLOCK_INFO;
4508c2ecf20Sopenharmony_ci
4518c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_KV_CLOCK_INFO {
4528c2ecf20Sopenharmony_ci      USHORT usEngineClockLow;
4538c2ecf20Sopenharmony_ci      UCHAR  ucEngineClockHigh;
4548c2ecf20Sopenharmony_ci      UCHAR  vddcIndex;
4558c2ecf20Sopenharmony_ci      USHORT tdpLimit;
4568c2ecf20Sopenharmony_ci      USHORT rsv1;
4578c2ecf20Sopenharmony_ci      ULONG rsv2[2];
4588c2ecf20Sopenharmony_ci} ATOM_PPLIB_KV_CLOCK_INFO;
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_CZ_CLOCK_INFO {
4618c2ecf20Sopenharmony_ci      UCHAR index;
4628c2ecf20Sopenharmony_ci      UCHAR rsv[3];
4638c2ecf20Sopenharmony_ci} ATOM_PPLIB_CZ_CLOCK_INFO;
4648c2ecf20Sopenharmony_ci
4658c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_STATE_V2
4668c2ecf20Sopenharmony_ci{
4678c2ecf20Sopenharmony_ci      //number of valid dpm levels in this state; Driver uses it to calculate the whole
4688c2ecf20Sopenharmony_ci      //size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR)
4698c2ecf20Sopenharmony_ci      UCHAR ucNumDPMLevels;
4708c2ecf20Sopenharmony_ci
4718c2ecf20Sopenharmony_ci      //a index to the array of nonClockInfos
4728c2ecf20Sopenharmony_ci      UCHAR nonClockInfoIndex;
4738c2ecf20Sopenharmony_ci      /**
4748c2ecf20Sopenharmony_ci      * Driver will read the first ucNumDPMLevels in this array
4758c2ecf20Sopenharmony_ci      */
4768c2ecf20Sopenharmony_ci      UCHAR clockInfoIndex[];
4778c2ecf20Sopenharmony_ci} ATOM_PPLIB_STATE_V2;
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_citypedef struct _StateArray{
4808c2ecf20Sopenharmony_ci    //how many states we have
4818c2ecf20Sopenharmony_ci    UCHAR ucNumEntries;
4828c2ecf20Sopenharmony_ci
4838c2ecf20Sopenharmony_ci    ATOM_PPLIB_STATE_V2 states[1];
4848c2ecf20Sopenharmony_ci}StateArray;
4858c2ecf20Sopenharmony_ci
4868c2ecf20Sopenharmony_ci
4878c2ecf20Sopenharmony_citypedef struct _ClockInfoArray{
4888c2ecf20Sopenharmony_ci    //how many clock levels we have
4898c2ecf20Sopenharmony_ci    UCHAR ucNumEntries;
4908c2ecf20Sopenharmony_ci
4918c2ecf20Sopenharmony_ci    //sizeof(ATOM_PPLIB_CLOCK_INFO)
4928c2ecf20Sopenharmony_ci    UCHAR ucEntrySize;
4938c2ecf20Sopenharmony_ci
4948c2ecf20Sopenharmony_ci    UCHAR clockInfo[1];
4958c2ecf20Sopenharmony_ci}ClockInfoArray;
4968c2ecf20Sopenharmony_ci
4978c2ecf20Sopenharmony_citypedef struct _NonClockInfoArray{
4988c2ecf20Sopenharmony_ci
4998c2ecf20Sopenharmony_ci    //how many non-clock levels we have. normally should be same as number of states
5008c2ecf20Sopenharmony_ci    UCHAR ucNumEntries;
5018c2ecf20Sopenharmony_ci    //sizeof(ATOM_PPLIB_NONCLOCK_INFO)
5028c2ecf20Sopenharmony_ci    UCHAR ucEntrySize;
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci    ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1];
5058c2ecf20Sopenharmony_ci}NonClockInfoArray;
5068c2ecf20Sopenharmony_ci
5078c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record
5088c2ecf20Sopenharmony_ci{
5098c2ecf20Sopenharmony_ci    USHORT usClockLow;
5108c2ecf20Sopenharmony_ci    UCHAR  ucClockHigh;
5118c2ecf20Sopenharmony_ci    USHORT usVoltage;
5128c2ecf20Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Dependency_Record;
5138c2ecf20Sopenharmony_ci
5148c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table
5158c2ecf20Sopenharmony_ci{
5168c2ecf20Sopenharmony_ci    UCHAR ucNumEntries;                                                // Number of entries.
5178c2ecf20Sopenharmony_ci    ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1];             // Dynamically allocate entries.
5188c2ecf20Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Dependency_Table;
5198c2ecf20Sopenharmony_ci
5208c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record
5218c2ecf20Sopenharmony_ci{
5228c2ecf20Sopenharmony_ci    USHORT usSclkLow;
5238c2ecf20Sopenharmony_ci    UCHAR  ucSclkHigh;
5248c2ecf20Sopenharmony_ci    USHORT usMclkLow;
5258c2ecf20Sopenharmony_ci    UCHAR  ucMclkHigh;
5268c2ecf20Sopenharmony_ci    USHORT usVddc;
5278c2ecf20Sopenharmony_ci    USHORT usVddci;
5288c2ecf20Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Limit_Record;
5298c2ecf20Sopenharmony_ci
5308c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table
5318c2ecf20Sopenharmony_ci{
5328c2ecf20Sopenharmony_ci    UCHAR ucNumEntries;                                                // Number of entries.
5338c2ecf20Sopenharmony_ci    ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1];                  // Dynamically allocate entries.
5348c2ecf20Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Limit_Table;
5358c2ecf20Sopenharmony_ci
5368c2ecf20Sopenharmony_ciunion _ATOM_PPLIB_CAC_Leakage_Record
5378c2ecf20Sopenharmony_ci{
5388c2ecf20Sopenharmony_ci    struct
5398c2ecf20Sopenharmony_ci    {
5408c2ecf20Sopenharmony_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
5418c2ecf20Sopenharmony_ci        ULONG  ulLeakageValue;  // For CI and newer we use this as the "fake" standar VDDC value. in CI we read it as StdVoltageLoSidd
5428c2ecf20Sopenharmony_ci
5438c2ecf20Sopenharmony_ci    };
5448c2ecf20Sopenharmony_ci    struct
5458c2ecf20Sopenharmony_ci     {
5468c2ecf20Sopenharmony_ci        USHORT usVddc1;
5478c2ecf20Sopenharmony_ci        USHORT usVddc2;
5488c2ecf20Sopenharmony_ci        USHORT usVddc3;
5498c2ecf20Sopenharmony_ci     };
5508c2ecf20Sopenharmony_ci};
5518c2ecf20Sopenharmony_ci
5528c2ecf20Sopenharmony_citypedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record;
5538c2ecf20Sopenharmony_ci
5548c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_CAC_Leakage_Table
5558c2ecf20Sopenharmony_ci{
5568c2ecf20Sopenharmony_ci    UCHAR ucNumEntries;                                                 // Number of entries.
5578c2ecf20Sopenharmony_ci    ATOM_PPLIB_CAC_Leakage_Record entries[1];                           // Dynamically allocate entries.
5588c2ecf20Sopenharmony_ci}ATOM_PPLIB_CAC_Leakage_Table;
5598c2ecf20Sopenharmony_ci
5608c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record
5618c2ecf20Sopenharmony_ci{
5628c2ecf20Sopenharmony_ci    USHORT usVoltage;
5638c2ecf20Sopenharmony_ci    USHORT usSclkLow;
5648c2ecf20Sopenharmony_ci    UCHAR  ucSclkHigh;
5658c2ecf20Sopenharmony_ci    USHORT usMclkLow;
5668c2ecf20Sopenharmony_ci    UCHAR  ucMclkHigh;
5678c2ecf20Sopenharmony_ci}ATOM_PPLIB_PhaseSheddingLimits_Record;
5688c2ecf20Sopenharmony_ci
5698c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table
5708c2ecf20Sopenharmony_ci{
5718c2ecf20Sopenharmony_ci    UCHAR ucNumEntries;                                                 // Number of entries.
5728c2ecf20Sopenharmony_ci    ATOM_PPLIB_PhaseSheddingLimits_Record entries[1];                   // Dynamically allocate entries.
5738c2ecf20Sopenharmony_ci}ATOM_PPLIB_PhaseSheddingLimits_Table;
5748c2ecf20Sopenharmony_ci
5758c2ecf20Sopenharmony_citypedef struct _VCEClockInfo{
5768c2ecf20Sopenharmony_ci    USHORT usEVClkLow;
5778c2ecf20Sopenharmony_ci    UCHAR  ucEVClkHigh;
5788c2ecf20Sopenharmony_ci    USHORT usECClkLow;
5798c2ecf20Sopenharmony_ci    UCHAR  ucECClkHigh;
5808c2ecf20Sopenharmony_ci}VCEClockInfo;
5818c2ecf20Sopenharmony_ci
5828c2ecf20Sopenharmony_citypedef struct _VCEClockInfoArray{
5838c2ecf20Sopenharmony_ci    UCHAR ucNumEntries;
5848c2ecf20Sopenharmony_ci    VCEClockInfo entries[1];
5858c2ecf20Sopenharmony_ci}VCEClockInfoArray;
5868c2ecf20Sopenharmony_ci
5878c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record
5888c2ecf20Sopenharmony_ci{
5898c2ecf20Sopenharmony_ci    USHORT usVoltage;
5908c2ecf20Sopenharmony_ci    UCHAR  ucVCEClockInfoIndex;
5918c2ecf20Sopenharmony_ci}ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record;
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table
5948c2ecf20Sopenharmony_ci{
5958c2ecf20Sopenharmony_ci    UCHAR numEntries;
5968c2ecf20Sopenharmony_ci    ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[1];
5978c2ecf20Sopenharmony_ci}ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table;
5988c2ecf20Sopenharmony_ci
5998c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_State_Record
6008c2ecf20Sopenharmony_ci{
6018c2ecf20Sopenharmony_ci    UCHAR  ucVCEClockInfoIndex;
6028c2ecf20Sopenharmony_ci    UCHAR  ucClockInfoIndex; //highest 2 bits indicates memory p-states, lower 6bits indicates index to ClockInfoArrary
6038c2ecf20Sopenharmony_ci}ATOM_PPLIB_VCE_State_Record;
6048c2ecf20Sopenharmony_ci
6058c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_State_Table
6068c2ecf20Sopenharmony_ci{
6078c2ecf20Sopenharmony_ci    UCHAR numEntries;
6088c2ecf20Sopenharmony_ci    ATOM_PPLIB_VCE_State_Record entries[1];
6098c2ecf20Sopenharmony_ci}ATOM_PPLIB_VCE_State_Table;
6108c2ecf20Sopenharmony_ci
6118c2ecf20Sopenharmony_ci
6128c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_Table
6138c2ecf20Sopenharmony_ci{
6148c2ecf20Sopenharmony_ci      UCHAR revid;
6158c2ecf20Sopenharmony_ci//    VCEClockInfoArray array;
6168c2ecf20Sopenharmony_ci//    ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table limits;
6178c2ecf20Sopenharmony_ci//    ATOM_PPLIB_VCE_State_Table states;
6188c2ecf20Sopenharmony_ci}ATOM_PPLIB_VCE_Table;
6198c2ecf20Sopenharmony_ci
6208c2ecf20Sopenharmony_ci
6218c2ecf20Sopenharmony_citypedef struct _UVDClockInfo{
6228c2ecf20Sopenharmony_ci    USHORT usVClkLow;
6238c2ecf20Sopenharmony_ci    UCHAR  ucVClkHigh;
6248c2ecf20Sopenharmony_ci    USHORT usDClkLow;
6258c2ecf20Sopenharmony_ci    UCHAR  ucDClkHigh;
6268c2ecf20Sopenharmony_ci}UVDClockInfo;
6278c2ecf20Sopenharmony_ci
6288c2ecf20Sopenharmony_citypedef struct _UVDClockInfoArray{
6298c2ecf20Sopenharmony_ci    UCHAR ucNumEntries;
6308c2ecf20Sopenharmony_ci    UVDClockInfo entries[1];
6318c2ecf20Sopenharmony_ci}UVDClockInfoArray;
6328c2ecf20Sopenharmony_ci
6338c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record
6348c2ecf20Sopenharmony_ci{
6358c2ecf20Sopenharmony_ci    USHORT usVoltage;
6368c2ecf20Sopenharmony_ci    UCHAR  ucUVDClockInfoIndex;
6378c2ecf20Sopenharmony_ci}ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record;
6388c2ecf20Sopenharmony_ci
6398c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table
6408c2ecf20Sopenharmony_ci{
6418c2ecf20Sopenharmony_ci    UCHAR numEntries;
6428c2ecf20Sopenharmony_ci    ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[1];
6438c2ecf20Sopenharmony_ci}ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table;
6448c2ecf20Sopenharmony_ci
6458c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_UVD_Table
6468c2ecf20Sopenharmony_ci{
6478c2ecf20Sopenharmony_ci      UCHAR revid;
6488c2ecf20Sopenharmony_ci//    UVDClockInfoArray array;
6498c2ecf20Sopenharmony_ci//    ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table limits;
6508c2ecf20Sopenharmony_ci}ATOM_PPLIB_UVD_Table;
6518c2ecf20Sopenharmony_ci
6528c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record
6538c2ecf20Sopenharmony_ci{
6548c2ecf20Sopenharmony_ci      USHORT usVoltage;
6558c2ecf20Sopenharmony_ci      USHORT usSAMClockLow;
6568c2ecf20Sopenharmony_ci      UCHAR  ucSAMClockHigh;
6578c2ecf20Sopenharmony_ci}ATOM_PPLIB_SAMClk_Voltage_Limit_Record;
6588c2ecf20Sopenharmony_ci
6598c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{
6608c2ecf20Sopenharmony_ci    UCHAR numEntries;
6618c2ecf20Sopenharmony_ci    ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[1];
6628c2ecf20Sopenharmony_ci}ATOM_PPLIB_SAMClk_Voltage_Limit_Table;
6638c2ecf20Sopenharmony_ci
6648c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_SAMU_Table
6658c2ecf20Sopenharmony_ci{
6668c2ecf20Sopenharmony_ci      UCHAR revid;
6678c2ecf20Sopenharmony_ci      ATOM_PPLIB_SAMClk_Voltage_Limit_Table limits;
6688c2ecf20Sopenharmony_ci}ATOM_PPLIB_SAMU_Table;
6698c2ecf20Sopenharmony_ci
6708c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record
6718c2ecf20Sopenharmony_ci{
6728c2ecf20Sopenharmony_ci      USHORT usVoltage;
6738c2ecf20Sopenharmony_ci      USHORT usACPClockLow;
6748c2ecf20Sopenharmony_ci      UCHAR  ucACPClockHigh;
6758c2ecf20Sopenharmony_ci}ATOM_PPLIB_ACPClk_Voltage_Limit_Record;
6768c2ecf20Sopenharmony_ci
6778c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{
6788c2ecf20Sopenharmony_ci    UCHAR numEntries;
6798c2ecf20Sopenharmony_ci    ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[1];
6808c2ecf20Sopenharmony_ci}ATOM_PPLIB_ACPClk_Voltage_Limit_Table;
6818c2ecf20Sopenharmony_ci
6828c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_ACP_Table
6838c2ecf20Sopenharmony_ci{
6848c2ecf20Sopenharmony_ci      UCHAR revid;
6858c2ecf20Sopenharmony_ci      ATOM_PPLIB_ACPClk_Voltage_Limit_Table limits;
6868c2ecf20Sopenharmony_ci}ATOM_PPLIB_ACP_Table;
6878c2ecf20Sopenharmony_ci
6888c2ecf20Sopenharmony_citypedef struct _ATOM_PowerTune_Table{
6898c2ecf20Sopenharmony_ci    USHORT usTDP;
6908c2ecf20Sopenharmony_ci    USHORT usConfigurableTDP;
6918c2ecf20Sopenharmony_ci    USHORT usTDC;
6928c2ecf20Sopenharmony_ci    USHORT usBatteryPowerLimit;
6938c2ecf20Sopenharmony_ci    USHORT usSmallPowerLimit;
6948c2ecf20Sopenharmony_ci    USHORT usLowCACLeakage;
6958c2ecf20Sopenharmony_ci    USHORT usHighCACLeakage;
6968c2ecf20Sopenharmony_ci}ATOM_PowerTune_Table;
6978c2ecf20Sopenharmony_ci
6988c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_POWERTUNE_Table
6998c2ecf20Sopenharmony_ci{
7008c2ecf20Sopenharmony_ci      UCHAR revid;
7018c2ecf20Sopenharmony_ci      ATOM_PowerTune_Table power_tune_table;
7028c2ecf20Sopenharmony_ci}ATOM_PPLIB_POWERTUNE_Table;
7038c2ecf20Sopenharmony_ci
7048c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_POWERTUNE_Table_V1
7058c2ecf20Sopenharmony_ci{
7068c2ecf20Sopenharmony_ci      UCHAR revid;
7078c2ecf20Sopenharmony_ci      ATOM_PowerTune_Table power_tune_table;
7088c2ecf20Sopenharmony_ci      USHORT usMaximumPowerDeliveryLimit;
7098c2ecf20Sopenharmony_ci      USHORT usTjMax;
7108c2ecf20Sopenharmony_ci      USHORT usReserve[6];
7118c2ecf20Sopenharmony_ci} ATOM_PPLIB_POWERTUNE_Table_V1;
7128c2ecf20Sopenharmony_ci
7138c2ecf20Sopenharmony_ci#define ATOM_PPM_A_A    1
7148c2ecf20Sopenharmony_ci#define ATOM_PPM_A_I    2
7158c2ecf20Sopenharmony_citypedef struct _ATOM_PPLIB_PPM_Table
7168c2ecf20Sopenharmony_ci{
7178c2ecf20Sopenharmony_ci      UCHAR  ucRevId;
7188c2ecf20Sopenharmony_ci      UCHAR  ucPpmDesign;          //A+I or A+A
7198c2ecf20Sopenharmony_ci      USHORT usCpuCoreNumber;
7208c2ecf20Sopenharmony_ci      ULONG  ulPlatformTDP;
7218c2ecf20Sopenharmony_ci      ULONG  ulSmallACPlatformTDP;
7228c2ecf20Sopenharmony_ci      ULONG  ulPlatformTDC;
7238c2ecf20Sopenharmony_ci      ULONG  ulSmallACPlatformTDC;
7248c2ecf20Sopenharmony_ci      ULONG  ulApuTDP;
7258c2ecf20Sopenharmony_ci      ULONG  ulDGpuTDP;
7268c2ecf20Sopenharmony_ci      ULONG  ulDGpuUlvPower;
7278c2ecf20Sopenharmony_ci      ULONG  ulTjmax;
7288c2ecf20Sopenharmony_ci} ATOM_PPLIB_PPM_Table;
7298c2ecf20Sopenharmony_ci
7308c2ecf20Sopenharmony_ci#define    VQ_DisplayConfig_NoneAWD   1
7318c2ecf20Sopenharmony_ci#define    VQ_DisplayConfig_AWD       2
7328c2ecf20Sopenharmony_ci
7338c2ecf20Sopenharmony_citypedef struct ATOM_PPLIB_VQ_Budgeting_Record{
7348c2ecf20Sopenharmony_ci    ULONG ulDeviceID;
7358c2ecf20Sopenharmony_ci    ULONG ulSustainableSOCPowerLimitLow; /* in mW */
7368c2ecf20Sopenharmony_ci    ULONG ulSustainableSOCPowerLimitHigh; /* in mW */
7378c2ecf20Sopenharmony_ci
7388c2ecf20Sopenharmony_ci    ULONG ulDClk;
7398c2ecf20Sopenharmony_ci    ULONG ulEClk;
7408c2ecf20Sopenharmony_ci    ULONG ulDispSclk;
7418c2ecf20Sopenharmony_ci    UCHAR ucDispConfig;
7428c2ecf20Sopenharmony_ci
7438c2ecf20Sopenharmony_ci} ATOM_PPLIB_VQ_Budgeting_Record;
7448c2ecf20Sopenharmony_ci
7458c2ecf20Sopenharmony_citypedef struct ATOM_PPLIB_VQ_Budgeting_Table {
7468c2ecf20Sopenharmony_ci    UCHAR revid;
7478c2ecf20Sopenharmony_ci    UCHAR numEntries;
7488c2ecf20Sopenharmony_ci    ATOM_PPLIB_VQ_Budgeting_Record         entries[1];
7498c2ecf20Sopenharmony_ci} ATOM_PPLIB_VQ_Budgeting_Table;
7508c2ecf20Sopenharmony_ci
7518c2ecf20Sopenharmony_ci#pragma pack()
7528c2ecf20Sopenharmony_ci
7538c2ecf20Sopenharmony_ci#endif
754