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