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
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci// Thermal controller 'combo type' to use an external controller for Fan control and an internal controller for thermal.
6762306a36Sopenharmony_ci// We probably should reserve the bit 0x80 for this use.
6862306a36Sopenharmony_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).
6962306a36Sopenharmony_ci// The driver can pick the correct internal controller based on the ASIC.
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL   0x89    // ADT7473 Fan Control + Internal Thermal Controller
7262306a36Sopenharmony_ci#define ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL   0x8D    // EMC2103 Fan Control + Internal Thermal Controller
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_STATE
7562306a36Sopenharmony_ci{
7662306a36Sopenharmony_ci    UCHAR ucNonClockStateIndex;
7762306a36Sopenharmony_ci    UCHAR ucClockStateIndices[1]; // variable-sized
7862306a36Sopenharmony_ci} ATOM_PPLIB_STATE;
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE
8262306a36Sopenharmony_ci{
8362306a36Sopenharmony_ci    UCHAR   ucFanTableFormat;                // Change this if the table format changes or version changes so that the other fields are not the same.
8462306a36Sopenharmony_ci    UCHAR   ucTHyst;                         // Temperature hysteresis. Integer.
8562306a36Sopenharmony_ci    USHORT  usTMin;                          // The temperature, in 0.01 centigrades, below which we just run at a minimal PWM.
8662306a36Sopenharmony_ci    USHORT  usTMed;                          // The middle temperature where we change slopes.
8762306a36Sopenharmony_ci    USHORT  usTHigh;                         // The high point above TMed for adjusting the second slope.
8862306a36Sopenharmony_ci    USHORT  usPWMMin;                        // The minimum PWM value in percent (0.01% increments).
8962306a36Sopenharmony_ci    USHORT  usPWMMed;                        // The PWM value (in percent) at TMed.
9062306a36Sopenharmony_ci    USHORT  usPWMHigh;                       // The PWM value at THigh.
9162306a36Sopenharmony_ci} ATOM_PPLIB_FANTABLE;
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE2
9462306a36Sopenharmony_ci{
9562306a36Sopenharmony_ci    ATOM_PPLIB_FANTABLE basicTable;
9662306a36Sopenharmony_ci    USHORT  usTMax;                          // The max temperature
9762306a36Sopenharmony_ci} ATOM_PPLIB_FANTABLE2;
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_FANTABLE3
10062306a36Sopenharmony_ci{
10162306a36Sopenharmony_ci	ATOM_PPLIB_FANTABLE2 basicTable2;
10262306a36Sopenharmony_ci	UCHAR ucFanControlMode;
10362306a36Sopenharmony_ci	USHORT usFanPWMMax;
10462306a36Sopenharmony_ci	USHORT usFanOutputSensitivity;
10562306a36Sopenharmony_ci} ATOM_PPLIB_FANTABLE3;
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_citypedef struct _ATOM_PPLIB_EXTENDEDHEADER
10862306a36Sopenharmony_ci{
10962306a36Sopenharmony_ci    USHORT  usSize;
11062306a36Sopenharmony_ci    ULONG   ulMaxEngineClock;   // For Overdrive.
11162306a36Sopenharmony_ci    ULONG   ulMaxMemoryClock;   // For Overdrive.
11262306a36Sopenharmony_ci    // Add extra system parameters here, always adjust size to include all fields.
11362306a36Sopenharmony_ci    USHORT  usVCETableOffset; //points to ATOM_PPLIB_VCE_Table
11462306a36Sopenharmony_ci    USHORT  usUVDTableOffset;   //points to ATOM_PPLIB_UVD_Table
11562306a36Sopenharmony_ci    USHORT  usSAMUTableOffset;  //points to ATOM_PPLIB_SAMU_Table
11662306a36Sopenharmony_ci    USHORT  usPPMTableOffset;   //points to ATOM_PPLIB_PPM_Table
11762306a36Sopenharmony_ci    USHORT  usACPTableOffset;  //points to ATOM_PPLIB_ACP_Table
11862306a36Sopenharmony_ci    USHORT  usPowerTuneTableOffset; //points to ATOM_PPLIB_POWERTUNE_Table
11962306a36Sopenharmony_ci} ATOM_PPLIB_EXTENDEDHEADER;
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci//// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps
12262306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_BACKBIAS 1
12362306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_POWERPLAY 2
12462306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4
12562306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8
12662306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_ASPM_L1 16
12762306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32
12862306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64
12962306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_STEPVDDC 128
13062306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256
13162306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512
13262306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024
13362306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048
13462306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096
13562306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000              // Go to boot state on alerts, e.g. on an AC->DC transition.
13662306a36Sopenharmony_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).
13762306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000                   // Does the driver control VDDCI independently from VDDC.
13862306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000               // Enable the 'regulator hot' feature.
13962306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_BACO          0x00020000               // Does the driver supports BACO state.
14062306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_NEW_CAC_VOLTAGE   0x00040000           // Does the driver supports new CAC voltage table.
14162306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY   0x00080000     // Does the driver supports revert GPIO5 polarity.
14262306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_OUTPUT_THERMAL2GPIO17   0x00100000     // Does the driver supports thermal2GPIO17.
14362306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_VRHOT_GPIO_CONFIGURABLE   0x00200000   // Does the driver supports VR HOT GPIO Configurable.
14462306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_TEMP_INVERSION   0x00400000            // Does the driver supports Temp Inversion feature.
14562306a36Sopenharmony_ci#define ATOM_PP_PLATFORM_CAP_EVV    0x00800000
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE
14862306a36Sopenharmony_ci{
14962306a36Sopenharmony_ci      ATOM_COMMON_TABLE_HEADER sHeader;
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci      UCHAR ucDataRevision;
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci      UCHAR ucNumStates;
15462306a36Sopenharmony_ci      UCHAR ucStateEntrySize;
15562306a36Sopenharmony_ci      UCHAR ucClockInfoSize;
15662306a36Sopenharmony_ci      UCHAR ucNonClockSize;
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci      // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures
15962306a36Sopenharmony_ci      USHORT usStateArrayOffset;
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci      // offset from start of this table to array of ASIC-specific structures,
16262306a36Sopenharmony_ci      // currently ATOM_PPLIB_CLOCK_INFO.
16362306a36Sopenharmony_ci      USHORT usClockInfoArrayOffset;
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ci      // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO
16662306a36Sopenharmony_ci      USHORT usNonClockInfoArrayOffset;
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci      USHORT usBackbiasTime;    // in microseconds
16962306a36Sopenharmony_ci      USHORT usVoltageTime;     // in microseconds
17062306a36Sopenharmony_ci      USHORT usTableSize;       //the size of this structure, or the extended structure
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci      ULONG ulPlatformCaps;            // See ATOM_PPLIB_CAPS_*
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ci      ATOM_PPLIB_THERMALCONTROLLER    sThermalController;
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ci      USHORT usBootClockInfoOffset;
17762306a36Sopenharmony_ci      USHORT usBootNonClockInfoOffset;
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE;
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE2
18262306a36Sopenharmony_ci{
18362306a36Sopenharmony_ci    ATOM_PPLIB_POWERPLAYTABLE basicTable;
18462306a36Sopenharmony_ci    UCHAR   ucNumCustomThermalPolicy;
18562306a36Sopenharmony_ci    USHORT  usCustomThermalPolicyArrayOffset;
18662306a36Sopenharmony_ci}ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2;
18762306a36Sopenharmony_ci
18862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE3
18962306a36Sopenharmony_ci{
19062306a36Sopenharmony_ci    ATOM_PPLIB_POWERPLAYTABLE2 basicTable2;
19162306a36Sopenharmony_ci    USHORT                     usFormatID;                      // To be used ONLY by PPGen.
19262306a36Sopenharmony_ci    USHORT                     usFanTableOffset;
19362306a36Sopenharmony_ci    USHORT                     usExtendendedHeaderOffset;
19462306a36Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3;
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE4
19762306a36Sopenharmony_ci{
19862306a36Sopenharmony_ci    ATOM_PPLIB_POWERPLAYTABLE3 basicTable3;
19962306a36Sopenharmony_ci    ULONG                      ulGoldenPPID;                    // PPGen use only
20062306a36Sopenharmony_ci    ULONG                      ulGoldenRevision;                // PPGen use only
20162306a36Sopenharmony_ci    USHORT                     usVddcDependencyOnSCLKOffset;
20262306a36Sopenharmony_ci    USHORT                     usVddciDependencyOnMCLKOffset;
20362306a36Sopenharmony_ci    USHORT                     usVddcDependencyOnMCLKOffset;
20462306a36Sopenharmony_ci    USHORT                     usMaxClockVoltageOnDCOffset;
20562306a36Sopenharmony_ci    USHORT                     usVddcPhaseShedLimitsTableOffset;    // Points to ATOM_PPLIB_PhaseSheddingLimits_Table
20662306a36Sopenharmony_ci    USHORT                     usMvddDependencyOnMCLKOffset;
20762306a36Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4;
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERPLAYTABLE5
21062306a36Sopenharmony_ci{
21162306a36Sopenharmony_ci    ATOM_PPLIB_POWERPLAYTABLE4 basicTable4;
21262306a36Sopenharmony_ci    ULONG                      ulTDPLimit;
21362306a36Sopenharmony_ci    ULONG                      ulNearTDPLimit;
21462306a36Sopenharmony_ci    ULONG                      ulSQRampingThreshold;
21562306a36Sopenharmony_ci    USHORT                     usCACLeakageTableOffset;         // Points to ATOM_PPLIB_CAC_Leakage_Table
21662306a36Sopenharmony_ci    ULONG                      ulCACLeakage;                    // The iLeakage for driver calculated CAC leakage table
21762306a36Sopenharmony_ci    USHORT                     usTDPODLimit;
21862306a36Sopenharmony_ci    USHORT                     usLoadLineSlope;                 // in milliOhms * 100
21962306a36Sopenharmony_ci} ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5;
22062306a36Sopenharmony_ci
22162306a36Sopenharmony_ci//// ATOM_PPLIB_NONCLOCK_INFO::usClassification
22262306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_MASK          0x0007
22362306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT         0
22462306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_NONE          0
22562306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY       1
22662306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED      3
22762306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE   5
22862306a36Sopenharmony_ci// 2, 4, 6, 7 are reserved
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_BOOT                   0x0008
23162306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_THERMAL                0x0010
23262306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE     0x0020
23362306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_REST                   0x0040
23462306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_FORCED                 0x0080
23562306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE          0x0100
23662306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE      0x0200
23762306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_UVDSTATE               0x0400
23862306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_3DLOW                  0x0800
23962306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_ACPI                   0x1000
24062306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_HD2STATE               0x2000
24162306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_HDSTATE                0x4000
24262306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION_SDSTATE                0x8000
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_ci//// ATOM_PPLIB_NONCLOCK_INFO::usClassification2
24562306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2     0x0001
24662306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION2_ULV                      0x0002
24762306a36Sopenharmony_ci#define ATOM_PPLIB_CLASSIFICATION2_MVC                      0x0004   //Multi-View Codec (BD-3D)
24862306a36Sopenharmony_ci
24962306a36Sopenharmony_ci//// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings
25062306a36Sopenharmony_ci#define ATOM_PPLIB_SINGLE_DISPLAY_ONLY           0x00000001
25162306a36Sopenharmony_ci#define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK         0x00000002
25262306a36Sopenharmony_ci
25362306a36Sopenharmony_ci// 0 is 2.5Gb/s, 1 is 5Gb/s
25462306a36Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_SPEED_MASK            0x00000004
25562306a36Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT           2
25662306a36Sopenharmony_ci
25762306a36Sopenharmony_ci// lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec
25862306a36Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK            0x000000F8
25962306a36Sopenharmony_ci#define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT           3
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ci// lookup into reduced refresh-rate table
26262306a36Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK  0x00000F00
26362306a36Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED    0
26662306a36Sopenharmony_ci#define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ         1
26762306a36Sopenharmony_ci// 2-15 TBD as needed.
26862306a36Sopenharmony_ci
26962306a36Sopenharmony_ci#define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING        0x00001000
27062306a36Sopenharmony_ci#define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS  0x00002000
27162306a36Sopenharmony_ci
27262306a36Sopenharmony_ci#define ATOM_PPLIB_DISALLOW_ON_DC                       0x00004000
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_ci#define ATOM_PPLIB_ENABLE_VARIBRIGHT                     0x00008000
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci//memory related flags
27762306a36Sopenharmony_ci#define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF               0x000010000
27862306a36Sopenharmony_ci
27962306a36Sopenharmony_ci//M3 Arb    //2bits, current 3 sets of parameters in total
28062306a36Sopenharmony_ci#define ATOM_PPLIB_M3ARB_MASK                       0x00060000
28162306a36Sopenharmony_ci#define ATOM_PPLIB_M3ARB_SHIFT                      17
28262306a36Sopenharmony_ci
28362306a36Sopenharmony_ci#define ATOM_PPLIB_ENABLE_DRR                       0x00080000
28462306a36Sopenharmony_ci
28562306a36Sopenharmony_ci// remaining 16 bits are reserved
28662306a36Sopenharmony_citypedef struct _ATOM_PPLIB_THERMAL_STATE
28762306a36Sopenharmony_ci{
28862306a36Sopenharmony_ci    UCHAR   ucMinTemperature;
28962306a36Sopenharmony_ci    UCHAR   ucMaxTemperature;
29062306a36Sopenharmony_ci    UCHAR   ucThermalAction;
29162306a36Sopenharmony_ci}ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE;
29262306a36Sopenharmony_ci
29362306a36Sopenharmony_ci// Contained in an array starting at the offset
29462306a36Sopenharmony_ci// in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset.
29562306a36Sopenharmony_ci// referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex
29662306a36Sopenharmony_ci#define ATOM_PPLIB_NONCLOCKINFO_VER1      12
29762306a36Sopenharmony_ci#define ATOM_PPLIB_NONCLOCKINFO_VER2      24
29862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_NONCLOCK_INFO
29962306a36Sopenharmony_ci{
30062306a36Sopenharmony_ci      USHORT usClassification;
30162306a36Sopenharmony_ci      UCHAR  ucMinTemperature;
30262306a36Sopenharmony_ci      UCHAR  ucMaxTemperature;
30362306a36Sopenharmony_ci      ULONG  ulCapsAndSettings;
30462306a36Sopenharmony_ci      UCHAR  ucRequiredPower;
30562306a36Sopenharmony_ci      USHORT usClassification2;
30662306a36Sopenharmony_ci      ULONG  ulVCLK;
30762306a36Sopenharmony_ci      ULONG  ulDCLK;
30862306a36Sopenharmony_ci      UCHAR  ucUnused[5];
30962306a36Sopenharmony_ci} ATOM_PPLIB_NONCLOCK_INFO;
31062306a36Sopenharmony_ci
31162306a36Sopenharmony_ci// Contained in an array starting at the offset
31262306a36Sopenharmony_ci// in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset.
31362306a36Sopenharmony_ci// referenced from ATOM_PPLIB_STATE::ucClockStateIndices
31462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_R600_CLOCK_INFO
31562306a36Sopenharmony_ci{
31662306a36Sopenharmony_ci      USHORT usEngineClockLow;
31762306a36Sopenharmony_ci      UCHAR ucEngineClockHigh;
31862306a36Sopenharmony_ci
31962306a36Sopenharmony_ci      USHORT usMemoryClockLow;
32062306a36Sopenharmony_ci      UCHAR ucMemoryClockHigh;
32162306a36Sopenharmony_ci
32262306a36Sopenharmony_ci      USHORT usVDDC;
32362306a36Sopenharmony_ci      USHORT usUnused1;
32462306a36Sopenharmony_ci      USHORT usUnused2;
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_ci      ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
32762306a36Sopenharmony_ci
32862306a36Sopenharmony_ci} ATOM_PPLIB_R600_CLOCK_INFO;
32962306a36Sopenharmony_ci
33062306a36Sopenharmony_ci// ulFlags in ATOM_PPLIB_R600_CLOCK_INFO
33162306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_PCIEGEN2          1
33262306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_UVDSAFE           2
33362306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE    4
33462306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF    8
33562306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF   16
33662306a36Sopenharmony_ci#define ATOM_PPLIB_R600_FLAGS_LOWPOWER         32   // On the RV770 use 'low power' setting (sequencer S0).
33762306a36Sopenharmony_ci
33862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_RS780_CLOCK_INFO
33962306a36Sopenharmony_ci
34062306a36Sopenharmony_ci{
34162306a36Sopenharmony_ci      USHORT usLowEngineClockLow;         // Low Engine clock in MHz (the same way as on the R600).
34262306a36Sopenharmony_ci      UCHAR  ucLowEngineClockHigh;
34362306a36Sopenharmony_ci      USHORT usHighEngineClockLow;        // High Engine clock in MHz.
34462306a36Sopenharmony_ci      UCHAR  ucHighEngineClockHigh;
34562306a36Sopenharmony_ci      USHORT usMemoryClockLow;            // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants.
34662306a36Sopenharmony_ci      UCHAR  ucMemoryClockHigh;           // Currentyl unused.
34762306a36Sopenharmony_ci      UCHAR  ucPadding;                   // For proper alignment and size.
34862306a36Sopenharmony_ci      USHORT usVDDC;                      // For the 780, use: None, Low, High, Variable
34962306a36Sopenharmony_ci      UCHAR  ucMaxHTLinkWidth;            // From SBIOS - {2, 4, 8, 16}
35062306a36Sopenharmony_ci      UCHAR  ucMinHTLinkWidth;            // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could
35162306a36Sopenharmony_ci      USHORT usHTLinkFreq;                // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200).
35262306a36Sopenharmony_ci      ULONG  ulFlags;
35362306a36Sopenharmony_ci} ATOM_PPLIB_RS780_CLOCK_INFO;
35462306a36Sopenharmony_ci
35562306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_NONE       0
35662306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_LOW        1
35762306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_HIGH       2
35862306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE   3
35962306a36Sopenharmony_ci
36062306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_SPMCLK_NONE        0   // We cannot change the side port memory clock, leave it as it is.
36162306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_SPMCLK_LOW         1
36262306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_SPMCLK_HIGH        2
36362306a36Sopenharmony_ci
36462306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_HTLINKFREQ_NONE       0
36562306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_HTLINKFREQ_LOW        1
36662306a36Sopenharmony_ci#define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH       2
36762306a36Sopenharmony_ci
36862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO
36962306a36Sopenharmony_ci{
37062306a36Sopenharmony_ci      USHORT usEngineClockLow;
37162306a36Sopenharmony_ci      UCHAR  ucEngineClockHigh;
37262306a36Sopenharmony_ci
37362306a36Sopenharmony_ci      USHORT usMemoryClockLow;
37462306a36Sopenharmony_ci      UCHAR  ucMemoryClockHigh;
37562306a36Sopenharmony_ci
37662306a36Sopenharmony_ci      USHORT usVDDC;
37762306a36Sopenharmony_ci      USHORT usVDDCI;
37862306a36Sopenharmony_ci      USHORT usUnused;
37962306a36Sopenharmony_ci
38062306a36Sopenharmony_ci      ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_*
38162306a36Sopenharmony_ci
38262306a36Sopenharmony_ci} ATOM_PPLIB_EVERGREEN_CLOCK_INFO;
38362306a36Sopenharmony_ci
38462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SI_CLOCK_INFO
38562306a36Sopenharmony_ci{
38662306a36Sopenharmony_ci      USHORT usEngineClockLow;
38762306a36Sopenharmony_ci      UCHAR  ucEngineClockHigh;
38862306a36Sopenharmony_ci
38962306a36Sopenharmony_ci      USHORT usMemoryClockLow;
39062306a36Sopenharmony_ci      UCHAR  ucMemoryClockHigh;
39162306a36Sopenharmony_ci
39262306a36Sopenharmony_ci      USHORT usVDDC;
39362306a36Sopenharmony_ci      USHORT usVDDCI;
39462306a36Sopenharmony_ci      UCHAR  ucPCIEGen;
39562306a36Sopenharmony_ci      UCHAR  ucUnused1;
39662306a36Sopenharmony_ci
39762306a36Sopenharmony_ci      ULONG ulFlags; // ATOM_PPLIB_SI_FLAGS_*, no flag is necessary for now
39862306a36Sopenharmony_ci
39962306a36Sopenharmony_ci} ATOM_PPLIB_SI_CLOCK_INFO;
40062306a36Sopenharmony_ci
40162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_CI_CLOCK_INFO
40262306a36Sopenharmony_ci{
40362306a36Sopenharmony_ci      USHORT usEngineClockLow;
40462306a36Sopenharmony_ci      UCHAR  ucEngineClockHigh;
40562306a36Sopenharmony_ci
40662306a36Sopenharmony_ci      USHORT usMemoryClockLow;
40762306a36Sopenharmony_ci      UCHAR  ucMemoryClockHigh;
40862306a36Sopenharmony_ci
40962306a36Sopenharmony_ci      UCHAR  ucPCIEGen;
41062306a36Sopenharmony_ci      USHORT usPCIELane;
41162306a36Sopenharmony_ci} ATOM_PPLIB_CI_CLOCK_INFO;
41262306a36Sopenharmony_ci
41362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{
41462306a36Sopenharmony_ci      USHORT usEngineClockLow;  //clockfrequency & 0xFFFF. The unit is in 10khz
41562306a36Sopenharmony_ci      UCHAR  ucEngineClockHigh; //clockfrequency >> 16.
41662306a36Sopenharmony_ci      UCHAR  vddcIndex;         //2-bit vddc index;
41762306a36Sopenharmony_ci      USHORT tdpLimit;
41862306a36Sopenharmony_ci      //please initalize to 0
41962306a36Sopenharmony_ci      USHORT rsv1;
42062306a36Sopenharmony_ci      //please initialize to 0s
42162306a36Sopenharmony_ci      ULONG rsv2[2];
42262306a36Sopenharmony_ci}ATOM_PPLIB_SUMO_CLOCK_INFO;
42362306a36Sopenharmony_ci
42462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_STATE_V2
42562306a36Sopenharmony_ci{
42662306a36Sopenharmony_ci      //number of valid dpm levels in this state; Driver uses it to calculate the whole
42762306a36Sopenharmony_ci      //size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR)
42862306a36Sopenharmony_ci      UCHAR ucNumDPMLevels;
42962306a36Sopenharmony_ci
43062306a36Sopenharmony_ci      //a index to the array of nonClockInfos
43162306a36Sopenharmony_ci      UCHAR nonClockInfoIndex;
43262306a36Sopenharmony_ci      /**
43362306a36Sopenharmony_ci      * Driver will read the first ucNumDPMLevels in this array
43462306a36Sopenharmony_ci      */
43562306a36Sopenharmony_ci      UCHAR clockInfoIndex[1];
43662306a36Sopenharmony_ci} ATOM_PPLIB_STATE_V2;
43762306a36Sopenharmony_ci
43862306a36Sopenharmony_citypedef struct _StateArray{
43962306a36Sopenharmony_ci    //how many states we have
44062306a36Sopenharmony_ci    UCHAR ucNumEntries;
44162306a36Sopenharmony_ci
44262306a36Sopenharmony_ci    ATOM_PPLIB_STATE_V2 states[1];
44362306a36Sopenharmony_ci}StateArray;
44462306a36Sopenharmony_ci
44562306a36Sopenharmony_ci
44662306a36Sopenharmony_citypedef struct _ClockInfoArray{
44762306a36Sopenharmony_ci    //how many clock levels we have
44862306a36Sopenharmony_ci    UCHAR ucNumEntries;
44962306a36Sopenharmony_ci
45062306a36Sopenharmony_ci    //sizeof(ATOM_PPLIB_CLOCK_INFO)
45162306a36Sopenharmony_ci    UCHAR ucEntrySize;
45262306a36Sopenharmony_ci
45362306a36Sopenharmony_ci    UCHAR clockInfo[1];
45462306a36Sopenharmony_ci}ClockInfoArray;
45562306a36Sopenharmony_ci
45662306a36Sopenharmony_citypedef struct _NonClockInfoArray{
45762306a36Sopenharmony_ci
45862306a36Sopenharmony_ci    //how many non-clock levels we have. normally should be same as number of states
45962306a36Sopenharmony_ci    UCHAR ucNumEntries;
46062306a36Sopenharmony_ci    //sizeof(ATOM_PPLIB_NONCLOCK_INFO)
46162306a36Sopenharmony_ci    UCHAR ucEntrySize;
46262306a36Sopenharmony_ci
46362306a36Sopenharmony_ci    ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1];
46462306a36Sopenharmony_ci}NonClockInfoArray;
46562306a36Sopenharmony_ci
46662306a36Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record
46762306a36Sopenharmony_ci{
46862306a36Sopenharmony_ci    USHORT usClockLow;
46962306a36Sopenharmony_ci    UCHAR  ucClockHigh;
47062306a36Sopenharmony_ci    USHORT usVoltage;
47162306a36Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Dependency_Record;
47262306a36Sopenharmony_ci
47362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table
47462306a36Sopenharmony_ci{
47562306a36Sopenharmony_ci    UCHAR ucNumEntries;                                                // Number of entries.
47662306a36Sopenharmony_ci    ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1];             // Dynamically allocate entries.
47762306a36Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Dependency_Table;
47862306a36Sopenharmony_ci
47962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record
48062306a36Sopenharmony_ci{
48162306a36Sopenharmony_ci    USHORT usSclkLow;
48262306a36Sopenharmony_ci    UCHAR  ucSclkHigh;
48362306a36Sopenharmony_ci    USHORT usMclkLow;
48462306a36Sopenharmony_ci    UCHAR  ucMclkHigh;
48562306a36Sopenharmony_ci    USHORT usVddc;
48662306a36Sopenharmony_ci    USHORT usVddci;
48762306a36Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Limit_Record;
48862306a36Sopenharmony_ci
48962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table
49062306a36Sopenharmony_ci{
49162306a36Sopenharmony_ci    UCHAR ucNumEntries;                                                // Number of entries.
49262306a36Sopenharmony_ci    ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1];                  // Dynamically allocate entries.
49362306a36Sopenharmony_ci}ATOM_PPLIB_Clock_Voltage_Limit_Table;
49462306a36Sopenharmony_ci
49562306a36Sopenharmony_ciunion _ATOM_PPLIB_CAC_Leakage_Record
49662306a36Sopenharmony_ci{
49762306a36Sopenharmony_ci    struct
49862306a36Sopenharmony_ci    {
49962306a36Sopenharmony_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
50062306a36Sopenharmony_ci        ULONG  ulLeakageValue;  // For CI and newer we use this as the "fake" standar VDDC value. in CI we read it as StdVoltageLoSidd
50162306a36Sopenharmony_ci
50262306a36Sopenharmony_ci    };
50362306a36Sopenharmony_ci    struct
50462306a36Sopenharmony_ci     {
50562306a36Sopenharmony_ci        USHORT usVddc1;
50662306a36Sopenharmony_ci        USHORT usVddc2;
50762306a36Sopenharmony_ci        USHORT usVddc3;
50862306a36Sopenharmony_ci     };
50962306a36Sopenharmony_ci};
51062306a36Sopenharmony_ci
51162306a36Sopenharmony_citypedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record;
51262306a36Sopenharmony_ci
51362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_CAC_Leakage_Table
51462306a36Sopenharmony_ci{
51562306a36Sopenharmony_ci    UCHAR ucNumEntries;                                                 // Number of entries.
51662306a36Sopenharmony_ci    ATOM_PPLIB_CAC_Leakage_Record entries[1];                           // Dynamically allocate entries.
51762306a36Sopenharmony_ci}ATOM_PPLIB_CAC_Leakage_Table;
51862306a36Sopenharmony_ci
51962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record
52062306a36Sopenharmony_ci{
52162306a36Sopenharmony_ci    USHORT usVoltage;
52262306a36Sopenharmony_ci    USHORT usSclkLow;
52362306a36Sopenharmony_ci    UCHAR  ucSclkHigh;
52462306a36Sopenharmony_ci    USHORT usMclkLow;
52562306a36Sopenharmony_ci    UCHAR  ucMclkHigh;
52662306a36Sopenharmony_ci}ATOM_PPLIB_PhaseSheddingLimits_Record;
52762306a36Sopenharmony_ci
52862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table
52962306a36Sopenharmony_ci{
53062306a36Sopenharmony_ci    UCHAR ucNumEntries;                                                 // Number of entries.
53162306a36Sopenharmony_ci    ATOM_PPLIB_PhaseSheddingLimits_Record entries[1];                   // Dynamically allocate entries.
53262306a36Sopenharmony_ci}ATOM_PPLIB_PhaseSheddingLimits_Table;
53362306a36Sopenharmony_ci
53462306a36Sopenharmony_citypedef struct _VCEClockInfo{
53562306a36Sopenharmony_ci    USHORT usEVClkLow;
53662306a36Sopenharmony_ci    UCHAR  ucEVClkHigh;
53762306a36Sopenharmony_ci    USHORT usECClkLow;
53862306a36Sopenharmony_ci    UCHAR  ucECClkHigh;
53962306a36Sopenharmony_ci}VCEClockInfo;
54062306a36Sopenharmony_ci
54162306a36Sopenharmony_citypedef struct _VCEClockInfoArray{
54262306a36Sopenharmony_ci    UCHAR ucNumEntries;
54362306a36Sopenharmony_ci    VCEClockInfo entries[1];
54462306a36Sopenharmony_ci}VCEClockInfoArray;
54562306a36Sopenharmony_ci
54662306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record
54762306a36Sopenharmony_ci{
54862306a36Sopenharmony_ci    USHORT usVoltage;
54962306a36Sopenharmony_ci    UCHAR  ucVCEClockInfoIndex;
55062306a36Sopenharmony_ci}ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record;
55162306a36Sopenharmony_ci
55262306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table
55362306a36Sopenharmony_ci{
55462306a36Sopenharmony_ci    UCHAR numEntries;
55562306a36Sopenharmony_ci    ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[1];
55662306a36Sopenharmony_ci}ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table;
55762306a36Sopenharmony_ci
55862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_State_Record
55962306a36Sopenharmony_ci{
56062306a36Sopenharmony_ci    UCHAR  ucVCEClockInfoIndex;
56162306a36Sopenharmony_ci    UCHAR  ucClockInfoIndex; //highest 2 bits indicates memory p-states, lower 6bits indicates index to ClockInfoArrary
56262306a36Sopenharmony_ci}ATOM_PPLIB_VCE_State_Record;
56362306a36Sopenharmony_ci
56462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_State_Table
56562306a36Sopenharmony_ci{
56662306a36Sopenharmony_ci    UCHAR numEntries;
56762306a36Sopenharmony_ci    ATOM_PPLIB_VCE_State_Record entries[1];
56862306a36Sopenharmony_ci}ATOM_PPLIB_VCE_State_Table;
56962306a36Sopenharmony_ci
57062306a36Sopenharmony_ci
57162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_VCE_Table
57262306a36Sopenharmony_ci{
57362306a36Sopenharmony_ci      UCHAR revid;
57462306a36Sopenharmony_ci//    VCEClockInfoArray array;
57562306a36Sopenharmony_ci//    ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table limits;
57662306a36Sopenharmony_ci//    ATOM_PPLIB_VCE_State_Table states;
57762306a36Sopenharmony_ci}ATOM_PPLIB_VCE_Table;
57862306a36Sopenharmony_ci
57962306a36Sopenharmony_ci
58062306a36Sopenharmony_citypedef struct _UVDClockInfo{
58162306a36Sopenharmony_ci    USHORT usVClkLow;
58262306a36Sopenharmony_ci    UCHAR  ucVClkHigh;
58362306a36Sopenharmony_ci    USHORT usDClkLow;
58462306a36Sopenharmony_ci    UCHAR  ucDClkHigh;
58562306a36Sopenharmony_ci}UVDClockInfo;
58662306a36Sopenharmony_ci
58762306a36Sopenharmony_citypedef struct _UVDClockInfoArray{
58862306a36Sopenharmony_ci    UCHAR ucNumEntries;
58962306a36Sopenharmony_ci    UVDClockInfo entries[1];
59062306a36Sopenharmony_ci}UVDClockInfoArray;
59162306a36Sopenharmony_ci
59262306a36Sopenharmony_citypedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record
59362306a36Sopenharmony_ci{
59462306a36Sopenharmony_ci    USHORT usVoltage;
59562306a36Sopenharmony_ci    UCHAR  ucUVDClockInfoIndex;
59662306a36Sopenharmony_ci}ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record;
59762306a36Sopenharmony_ci
59862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table
59962306a36Sopenharmony_ci{
60062306a36Sopenharmony_ci    UCHAR numEntries;
60162306a36Sopenharmony_ci    ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[1];
60262306a36Sopenharmony_ci}ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table;
60362306a36Sopenharmony_ci
60462306a36Sopenharmony_citypedef struct _ATOM_PPLIB_UVD_Table
60562306a36Sopenharmony_ci{
60662306a36Sopenharmony_ci      UCHAR revid;
60762306a36Sopenharmony_ci//    UVDClockInfoArray array;
60862306a36Sopenharmony_ci//    ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table limits;
60962306a36Sopenharmony_ci}ATOM_PPLIB_UVD_Table;
61062306a36Sopenharmony_ci
61162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record
61262306a36Sopenharmony_ci{
61362306a36Sopenharmony_ci      USHORT usVoltage;
61462306a36Sopenharmony_ci      USHORT usSAMClockLow;
61562306a36Sopenharmony_ci      UCHAR  ucSAMClockHigh;
61662306a36Sopenharmony_ci}ATOM_PPLIB_SAMClk_Voltage_Limit_Record;
61762306a36Sopenharmony_ci
61862306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{
61962306a36Sopenharmony_ci    UCHAR numEntries;
62062306a36Sopenharmony_ci    ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[1];
62162306a36Sopenharmony_ci}ATOM_PPLIB_SAMClk_Voltage_Limit_Table;
62262306a36Sopenharmony_ci
62362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_SAMU_Table
62462306a36Sopenharmony_ci{
62562306a36Sopenharmony_ci      UCHAR revid;
62662306a36Sopenharmony_ci      ATOM_PPLIB_SAMClk_Voltage_Limit_Table limits;
62762306a36Sopenharmony_ci}ATOM_PPLIB_SAMU_Table;
62862306a36Sopenharmony_ci
62962306a36Sopenharmony_citypedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record
63062306a36Sopenharmony_ci{
63162306a36Sopenharmony_ci      USHORT usVoltage;
63262306a36Sopenharmony_ci      USHORT usACPClockLow;
63362306a36Sopenharmony_ci      UCHAR  ucACPClockHigh;
63462306a36Sopenharmony_ci}ATOM_PPLIB_ACPClk_Voltage_Limit_Record;
63562306a36Sopenharmony_ci
63662306a36Sopenharmony_citypedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{
63762306a36Sopenharmony_ci    UCHAR numEntries;
63862306a36Sopenharmony_ci    ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[1];
63962306a36Sopenharmony_ci}ATOM_PPLIB_ACPClk_Voltage_Limit_Table;
64062306a36Sopenharmony_ci
64162306a36Sopenharmony_citypedef struct _ATOM_PPLIB_ACP_Table
64262306a36Sopenharmony_ci{
64362306a36Sopenharmony_ci      UCHAR revid;
64462306a36Sopenharmony_ci      ATOM_PPLIB_ACPClk_Voltage_Limit_Table limits;
64562306a36Sopenharmony_ci}ATOM_PPLIB_ACP_Table;
64662306a36Sopenharmony_ci
64762306a36Sopenharmony_citypedef struct _ATOM_PowerTune_Table{
64862306a36Sopenharmony_ci    USHORT usTDP;
64962306a36Sopenharmony_ci    USHORT usConfigurableTDP;
65062306a36Sopenharmony_ci    USHORT usTDC;
65162306a36Sopenharmony_ci    USHORT usBatteryPowerLimit;
65262306a36Sopenharmony_ci    USHORT usSmallPowerLimit;
65362306a36Sopenharmony_ci    USHORT usLowCACLeakage;
65462306a36Sopenharmony_ci    USHORT usHighCACLeakage;
65562306a36Sopenharmony_ci}ATOM_PowerTune_Table;
65662306a36Sopenharmony_ci
65762306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERTUNE_Table
65862306a36Sopenharmony_ci{
65962306a36Sopenharmony_ci      UCHAR revid;
66062306a36Sopenharmony_ci      ATOM_PowerTune_Table power_tune_table;
66162306a36Sopenharmony_ci}ATOM_PPLIB_POWERTUNE_Table;
66262306a36Sopenharmony_ci
66362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_POWERTUNE_Table_V1
66462306a36Sopenharmony_ci{
66562306a36Sopenharmony_ci      UCHAR revid;
66662306a36Sopenharmony_ci      ATOM_PowerTune_Table power_tune_table;
66762306a36Sopenharmony_ci      USHORT usMaximumPowerDeliveryLimit;
66862306a36Sopenharmony_ci      USHORT usReserve[7];
66962306a36Sopenharmony_ci} ATOM_PPLIB_POWERTUNE_Table_V1;
67062306a36Sopenharmony_ci
67162306a36Sopenharmony_ci#define ATOM_PPM_A_A    1
67262306a36Sopenharmony_ci#define ATOM_PPM_A_I    2
67362306a36Sopenharmony_citypedef struct _ATOM_PPLIB_PPM_Table
67462306a36Sopenharmony_ci{
67562306a36Sopenharmony_ci      UCHAR  ucRevId;
67662306a36Sopenharmony_ci      UCHAR  ucPpmDesign;          //A+I or A+A
67762306a36Sopenharmony_ci      USHORT usCpuCoreNumber;
67862306a36Sopenharmony_ci      ULONG  ulPlatformTDP;
67962306a36Sopenharmony_ci      ULONG  ulSmallACPlatformTDP;
68062306a36Sopenharmony_ci      ULONG  ulPlatformTDC;
68162306a36Sopenharmony_ci      ULONG  ulSmallACPlatformTDC;
68262306a36Sopenharmony_ci      ULONG  ulApuTDP;
68362306a36Sopenharmony_ci      ULONG  ulDGpuTDP;
68462306a36Sopenharmony_ci      ULONG  ulDGpuUlvPower;
68562306a36Sopenharmony_ci      ULONG  ulTjmax;
68662306a36Sopenharmony_ci} ATOM_PPLIB_PPM_Table;
68762306a36Sopenharmony_ci
68862306a36Sopenharmony_ci#pragma pack()
68962306a36Sopenharmony_ci
69062306a36Sopenharmony_ci#endif
691