1c59a5c48SFrançois Tigeot /* 2c59a5c48SFrançois Tigeot * Copyright 2013 Advanced Micro Devices, Inc. 3c59a5c48SFrançois Tigeot * 4c59a5c48SFrançois Tigeot * Permission is hereby granted, free of charge, to any person obtaining a 5c59a5c48SFrançois Tigeot * copy of this software and associated documentation files (the "Software"), 6c59a5c48SFrançois Tigeot * to deal in the Software without restriction, including without limitation 7c59a5c48SFrançois Tigeot * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8c59a5c48SFrançois Tigeot * and/or sell copies of the Software, and to permit persons to whom the 9c59a5c48SFrançois Tigeot * Software is furnished to do so, subject to the following conditions: 10c59a5c48SFrançois Tigeot * 11c59a5c48SFrançois Tigeot * The above copyright notice and this permission notice shall be included in 12c59a5c48SFrançois Tigeot * all copies or substantial portions of the Software. 13c59a5c48SFrançois Tigeot * 14c59a5c48SFrançois Tigeot * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15c59a5c48SFrançois Tigeot * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16c59a5c48SFrançois Tigeot * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17c59a5c48SFrançois Tigeot * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18c59a5c48SFrançois Tigeot * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19c59a5c48SFrançois Tigeot * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20c59a5c48SFrançois Tigeot * OTHER DEALINGS IN THE SOFTWARE. 21c59a5c48SFrançois Tigeot */ 22c59a5c48SFrançois Tigeot 23c59a5c48SFrançois Tigeot #ifndef _PPTABLE_H 24c59a5c48SFrançois Tigeot #define _PPTABLE_H 25c59a5c48SFrançois Tigeot 26c59a5c48SFrançois Tigeot #pragma pack(1) 27c59a5c48SFrançois Tigeot 28c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_THERMALCONTROLLER 29c59a5c48SFrançois Tigeot 30c59a5c48SFrançois Tigeot { 31c59a5c48SFrançois Tigeot UCHAR ucType; // one of ATOM_PP_THERMALCONTROLLER_* 32c59a5c48SFrançois Tigeot UCHAR ucI2cLine; // as interpreted by DAL I2C 33c59a5c48SFrançois Tigeot UCHAR ucI2cAddress; 34c59a5c48SFrançois Tigeot UCHAR ucFanParameters; // Fan Control Parameters. 35c59a5c48SFrançois Tigeot UCHAR ucFanMinRPM; // Fan Minimum RPM (hundreds) -- for display purposes only. 36c59a5c48SFrançois Tigeot UCHAR ucFanMaxRPM; // Fan Maximum RPM (hundreds) -- for display purposes only. 37c59a5c48SFrançois Tigeot UCHAR ucReserved; // ---- 38c59a5c48SFrançois Tigeot UCHAR ucFlags; // to be defined 39c59a5c48SFrançois Tigeot } ATOM_PPLIB_THERMALCONTROLLER; 40c59a5c48SFrançois Tigeot 41c59a5c48SFrançois Tigeot #define ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f 42c59a5c48SFrançois Tigeot #define ATOM_PP_FANPARAMETERS_NOFAN 0x80 // No fan is connected to this controller. 43c59a5c48SFrançois Tigeot 44c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_NONE 0 45c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_LM63 1 // Not used by PPLib 46c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_ADM1032 2 // Not used by PPLib 47c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_ADM1030 3 // Not used by PPLib 48c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_MUA6649 4 // Not used by PPLib 49c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_LM64 5 50c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_F75375 6 // Not used by PPLib 51c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_RV6xx 7 52c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_RV770 8 53c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_ADT7473 9 54c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_KONG 10 55c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO 11 56c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_EVERGREEN 12 57c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_EMC2103 13 /* 0x0D */ // Only fan control will be implemented, do NOT show this in PPGen. 58c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_SUMO 14 /* 0x0E */ // Sumo type, used internally 59c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_NISLANDS 15 60c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_SISLANDS 16 61c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_LM96163 17 62c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_CISLANDS 18 63c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_KAVERI 19 64*b843c749SSergey Zigachev #define ATOM_PP_THERMALCONTROLLER_ICELAND 20 65*b843c749SSergey Zigachev #define ATOM_PP_THERMALCONTROLLER_TONGA 21 66*b843c749SSergey Zigachev #define ATOM_PP_THERMALCONTROLLER_FIJI 22 67*b843c749SSergey Zigachev #define ATOM_PP_THERMALCONTROLLER_POLARIS10 23 68*b843c749SSergey Zigachev #define ATOM_PP_THERMALCONTROLLER_VEGA10 24 69c59a5c48SFrançois Tigeot 70c59a5c48SFrançois Tigeot 71c59a5c48SFrançois Tigeot // Thermal controller 'combo type' to use an external controller for Fan control and an internal controller for thermal. 72c59a5c48SFrançois Tigeot // We probably should reserve the bit 0x80 for this use. 73c59a5c48SFrançois Tigeot // 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). 74c59a5c48SFrançois Tigeot // The driver can pick the correct internal controller based on the ASIC. 75c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL 0x89 // ADT7473 Fan Control + Internal Thermal Controller 76c59a5c48SFrançois Tigeot #define ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL 0x8D // EMC2103 Fan Control + Internal Thermal Controller 77c59a5c48SFrançois Tigeot 78c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_STATE 79c59a5c48SFrançois Tigeot { 80c59a5c48SFrançois Tigeot UCHAR ucNonClockStateIndex; 81c59a5c48SFrançois Tigeot UCHAR ucClockStateIndices[1]; // variable-sized 82c59a5c48SFrançois Tigeot } ATOM_PPLIB_STATE; 83c59a5c48SFrançois Tigeot 84c59a5c48SFrançois Tigeot 85c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_FANTABLE 86c59a5c48SFrançois Tigeot { 87c59a5c48SFrançois Tigeot UCHAR ucFanTableFormat; // Change this if the table format changes or version changes so that the other fields are not the same. 88c59a5c48SFrançois Tigeot UCHAR ucTHyst; // Temperature hysteresis. Integer. 89c59a5c48SFrançois Tigeot USHORT usTMin; // The temperature, in 0.01 centigrades, below which we just run at a minimal PWM. 90c59a5c48SFrançois Tigeot USHORT usTMed; // The middle temperature where we change slopes. 91c59a5c48SFrançois Tigeot USHORT usTHigh; // The high point above TMed for adjusting the second slope. 92c59a5c48SFrançois Tigeot USHORT usPWMMin; // The minimum PWM value in percent (0.01% increments). 93c59a5c48SFrançois Tigeot USHORT usPWMMed; // The PWM value (in percent) at TMed. 94c59a5c48SFrançois Tigeot USHORT usPWMHigh; // The PWM value at THigh. 95c59a5c48SFrançois Tigeot } ATOM_PPLIB_FANTABLE; 96c59a5c48SFrançois Tigeot 97c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_FANTABLE2 98c59a5c48SFrançois Tigeot { 99c59a5c48SFrançois Tigeot ATOM_PPLIB_FANTABLE basicTable; 100c59a5c48SFrançois Tigeot USHORT usTMax; // The max temperature 101c59a5c48SFrançois Tigeot } ATOM_PPLIB_FANTABLE2; 102c59a5c48SFrançois Tigeot 103c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_FANTABLE3 104c59a5c48SFrançois Tigeot { 105c59a5c48SFrançois Tigeot ATOM_PPLIB_FANTABLE2 basicTable2; 106c59a5c48SFrançois Tigeot UCHAR ucFanControlMode; 107c59a5c48SFrançois Tigeot USHORT usFanPWMMax; 108c59a5c48SFrançois Tigeot USHORT usFanOutputSensitivity; 109c59a5c48SFrançois Tigeot } ATOM_PPLIB_FANTABLE3; 110c59a5c48SFrançois Tigeot 111*b843c749SSergey Zigachev typedef struct _ATOM_PPLIB_FANTABLE4 112*b843c749SSergey Zigachev { 113*b843c749SSergey Zigachev ATOM_PPLIB_FANTABLE3 basicTable3; 114*b843c749SSergey Zigachev USHORT usFanRPMMax; 115*b843c749SSergey Zigachev } ATOM_PPLIB_FANTABLE4; 116*b843c749SSergey Zigachev 117*b843c749SSergey Zigachev typedef struct _ATOM_PPLIB_FANTABLE5 118*b843c749SSergey Zigachev { 119*b843c749SSergey Zigachev ATOM_PPLIB_FANTABLE4 basicTable4; 120*b843c749SSergey Zigachev USHORT usFanCurrentLow; 121*b843c749SSergey Zigachev USHORT usFanCurrentHigh; 122*b843c749SSergey Zigachev USHORT usFanRPMLow; 123*b843c749SSergey Zigachev USHORT usFanRPMHigh; 124*b843c749SSergey Zigachev } ATOM_PPLIB_FANTABLE5; 125*b843c749SSergey Zigachev 126c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_EXTENDEDHEADER 127c59a5c48SFrançois Tigeot { 128c59a5c48SFrançois Tigeot USHORT usSize; 129c59a5c48SFrançois Tigeot ULONG ulMaxEngineClock; // For Overdrive. 130c59a5c48SFrançois Tigeot ULONG ulMaxMemoryClock; // For Overdrive. 131c59a5c48SFrançois Tigeot // Add extra system parameters here, always adjust size to include all fields. 132c59a5c48SFrançois Tigeot USHORT usVCETableOffset; //points to ATOM_PPLIB_VCE_Table 133c59a5c48SFrançois Tigeot USHORT usUVDTableOffset; //points to ATOM_PPLIB_UVD_Table 134c59a5c48SFrançois Tigeot USHORT usSAMUTableOffset; //points to ATOM_PPLIB_SAMU_Table 135c59a5c48SFrançois Tigeot USHORT usPPMTableOffset; //points to ATOM_PPLIB_PPM_Table 136c59a5c48SFrançois Tigeot USHORT usACPTableOffset; //points to ATOM_PPLIB_ACP_Table 137c59a5c48SFrançois Tigeot /* points to ATOM_PPLIB_POWERTUNE_Table */ 138c59a5c48SFrançois Tigeot USHORT usPowerTuneTableOffset; 139c59a5c48SFrançois Tigeot /* points to ATOM_PPLIB_CLOCK_Voltage_Dependency_Table for sclkVddgfxTable */ 140c59a5c48SFrançois Tigeot USHORT usSclkVddgfxTableOffset; 141*b843c749SSergey Zigachev USHORT usVQBudgetingTableOffset; /* points to the vqBudgetingTable; */ 142c59a5c48SFrançois Tigeot } ATOM_PPLIB_EXTENDEDHEADER; 143c59a5c48SFrançois Tigeot 144c59a5c48SFrançois Tigeot //// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps 145c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_BACKBIAS 1 146c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_POWERPLAY 2 147c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4 148c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8 149c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_ASPM_L1 16 150c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32 151c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64 152c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_STEPVDDC 128 153c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256 154c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512 155c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024 156c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048 157c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096 158c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000 // Go to boot state on alerts, e.g. on an AC->DC transition. 159c59a5c48SFrançois Tigeot #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). 160c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000 // Does the driver control VDDCI independently from VDDC. 161c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x00010000 // Enable the 'regulator hot' feature. 162c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_BACO 0x00020000 // Does the driver supports BACO state. 163c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_NEW_CAC_VOLTAGE 0x00040000 // Does the driver supports new CAC voltage table. 164c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_REVERT_GPIO5_POLARITY 0x00080000 // Does the driver supports revert GPIO5 polarity. 165c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_OUTPUT_THERMAL2GPIO17 0x00100000 // Does the driver supports thermal2GPIO17. 166c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_VRHOT_GPIO_CONFIGURABLE 0x00200000 // Does the driver supports VR HOT GPIO Configurable. 167c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_TEMP_INVERSION 0x00400000 // Does the driver supports Temp Inversion feature. 168c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_EVV 0x00800000 169c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_COMBINE_PCC_WITH_THERMAL_SIGNAL 0x01000000 170c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_LOAD_POST_PRODUCTION_FIRMWARE 0x02000000 171c59a5c48SFrançois Tigeot #define ATOM_PP_PLATFORM_CAP_DISABLE_USING_ACTUAL_TEMPERATURE_FOR_POWER_CALC 0x04000000 172*b843c749SSergey Zigachev #define ATOM_PP_PLATFORM_CAP_VRHOT_POLARITY_HIGH 0x08000000 173c59a5c48SFrançois Tigeot 174c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_POWERPLAYTABLE 175c59a5c48SFrançois Tigeot { 176c59a5c48SFrançois Tigeot ATOM_COMMON_TABLE_HEADER sHeader; 177c59a5c48SFrançois Tigeot 178c59a5c48SFrançois Tigeot UCHAR ucDataRevision; 179c59a5c48SFrançois Tigeot 180c59a5c48SFrançois Tigeot UCHAR ucNumStates; 181c59a5c48SFrançois Tigeot UCHAR ucStateEntrySize; 182c59a5c48SFrançois Tigeot UCHAR ucClockInfoSize; 183c59a5c48SFrançois Tigeot UCHAR ucNonClockSize; 184c59a5c48SFrançois Tigeot 185c59a5c48SFrançois Tigeot // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures 186c59a5c48SFrançois Tigeot USHORT usStateArrayOffset; 187c59a5c48SFrançois Tigeot 188c59a5c48SFrançois Tigeot // offset from start of this table to array of ASIC-specific structures, 189c59a5c48SFrançois Tigeot // currently ATOM_PPLIB_CLOCK_INFO. 190c59a5c48SFrançois Tigeot USHORT usClockInfoArrayOffset; 191c59a5c48SFrançois Tigeot 192c59a5c48SFrançois Tigeot // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO 193c59a5c48SFrançois Tigeot USHORT usNonClockInfoArrayOffset; 194c59a5c48SFrançois Tigeot 195c59a5c48SFrançois Tigeot USHORT usBackbiasTime; // in microseconds 196c59a5c48SFrançois Tigeot USHORT usVoltageTime; // in microseconds 197c59a5c48SFrançois Tigeot USHORT usTableSize; //the size of this structure, or the extended structure 198c59a5c48SFrançois Tigeot 199c59a5c48SFrançois Tigeot ULONG ulPlatformCaps; // See ATOM_PPLIB_CAPS_* 200c59a5c48SFrançois Tigeot 201c59a5c48SFrançois Tigeot ATOM_PPLIB_THERMALCONTROLLER sThermalController; 202c59a5c48SFrançois Tigeot 203c59a5c48SFrançois Tigeot USHORT usBootClockInfoOffset; 204c59a5c48SFrançois Tigeot USHORT usBootNonClockInfoOffset; 205c59a5c48SFrançois Tigeot 206c59a5c48SFrançois Tigeot } ATOM_PPLIB_POWERPLAYTABLE; 207c59a5c48SFrançois Tigeot 208c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_POWERPLAYTABLE2 209c59a5c48SFrançois Tigeot { 210c59a5c48SFrançois Tigeot ATOM_PPLIB_POWERPLAYTABLE basicTable; 211c59a5c48SFrançois Tigeot UCHAR ucNumCustomThermalPolicy; 212c59a5c48SFrançois Tigeot USHORT usCustomThermalPolicyArrayOffset; 213c59a5c48SFrançois Tigeot }ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2; 214c59a5c48SFrançois Tigeot 215c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_POWERPLAYTABLE3 216c59a5c48SFrançois Tigeot { 217c59a5c48SFrançois Tigeot ATOM_PPLIB_POWERPLAYTABLE2 basicTable2; 218c59a5c48SFrançois Tigeot USHORT usFormatID; // To be used ONLY by PPGen. 219c59a5c48SFrançois Tigeot USHORT usFanTableOffset; 220c59a5c48SFrançois Tigeot USHORT usExtendendedHeaderOffset; 221c59a5c48SFrançois Tigeot } ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3; 222c59a5c48SFrançois Tigeot 223c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_POWERPLAYTABLE4 224c59a5c48SFrançois Tigeot { 225c59a5c48SFrançois Tigeot ATOM_PPLIB_POWERPLAYTABLE3 basicTable3; 226c59a5c48SFrançois Tigeot ULONG ulGoldenPPID; // PPGen use only 227c59a5c48SFrançois Tigeot ULONG ulGoldenRevision; // PPGen use only 228c59a5c48SFrançois Tigeot USHORT usVddcDependencyOnSCLKOffset; 229c59a5c48SFrançois Tigeot USHORT usVddciDependencyOnMCLKOffset; 230c59a5c48SFrançois Tigeot USHORT usVddcDependencyOnMCLKOffset; 231c59a5c48SFrançois Tigeot USHORT usMaxClockVoltageOnDCOffset; 232c59a5c48SFrançois Tigeot USHORT usVddcPhaseShedLimitsTableOffset; // Points to ATOM_PPLIB_PhaseSheddingLimits_Table 233c59a5c48SFrançois Tigeot USHORT usMvddDependencyOnMCLKOffset; 234c59a5c48SFrançois Tigeot } ATOM_PPLIB_POWERPLAYTABLE4, *LPATOM_PPLIB_POWERPLAYTABLE4; 235c59a5c48SFrançois Tigeot 236c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_POWERPLAYTABLE5 237c59a5c48SFrançois Tigeot { 238c59a5c48SFrançois Tigeot ATOM_PPLIB_POWERPLAYTABLE4 basicTable4; 239c59a5c48SFrançois Tigeot ULONG ulTDPLimit; 240c59a5c48SFrançois Tigeot ULONG ulNearTDPLimit; 241c59a5c48SFrançois Tigeot ULONG ulSQRampingThreshold; 242c59a5c48SFrançois Tigeot USHORT usCACLeakageTableOffset; // Points to ATOM_PPLIB_CAC_Leakage_Table 243c59a5c48SFrançois Tigeot ULONG ulCACLeakage; // The iLeakage for driver calculated CAC leakage table 244c59a5c48SFrançois Tigeot USHORT usTDPODLimit; 245c59a5c48SFrançois Tigeot USHORT usLoadLineSlope; // in milliOhms * 100 246c59a5c48SFrançois Tigeot } ATOM_PPLIB_POWERPLAYTABLE5, *LPATOM_PPLIB_POWERPLAYTABLE5; 247c59a5c48SFrançois Tigeot 248c59a5c48SFrançois Tigeot //// ATOM_PPLIB_NONCLOCK_INFO::usClassification 249c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_UI_MASK 0x0007 250c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT 0 251c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_UI_NONE 0 252c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY 1 253c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED 3 254c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE 5 255c59a5c48SFrançois Tigeot // 2, 4, 6, 7 are reserved 256c59a5c48SFrançois Tigeot 257c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_BOOT 0x0008 258c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_THERMAL 0x0010 259c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE 0x0020 260c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_REST 0x0040 261c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_FORCED 0x0080 262c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE 0x0100 263c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_OVERDRIVETEMPLATE 0x0200 264c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_UVDSTATE 0x0400 265c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_3DLOW 0x0800 266c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_ACPI 0x1000 267c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_HD2STATE 0x2000 268c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_HDSTATE 0x4000 269c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION_SDSTATE 0x8000 270c59a5c48SFrançois Tigeot 271c59a5c48SFrançois Tigeot //// ATOM_PPLIB_NONCLOCK_INFO::usClassification2 272c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION2_LIMITEDPOWERSOURCE_2 0x0001 273c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION2_ULV 0x0002 274c59a5c48SFrançois Tigeot #define ATOM_PPLIB_CLASSIFICATION2_MVC 0x0004 //Multi-View Codec (BD-3D) 275c59a5c48SFrançois Tigeot 276c59a5c48SFrançois Tigeot //// ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings 277c59a5c48SFrançois Tigeot #define ATOM_PPLIB_SINGLE_DISPLAY_ONLY 0x00000001 278c59a5c48SFrançois Tigeot #define ATOM_PPLIB_SUPPORTS_VIDEO_PLAYBACK 0x00000002 279c59a5c48SFrançois Tigeot 280c59a5c48SFrançois Tigeot // 0 is 2.5Gb/s, 1 is 5Gb/s 281c59a5c48SFrançois Tigeot #define ATOM_PPLIB_PCIE_LINK_SPEED_MASK 0x00000004 282c59a5c48SFrançois Tigeot #define ATOM_PPLIB_PCIE_LINK_SPEED_SHIFT 2 283c59a5c48SFrançois Tigeot 284c59a5c48SFrançois Tigeot // lanes - 1: 1, 2, 4, 8, 12, 16 permitted by PCIE spec 285c59a5c48SFrançois Tigeot #define ATOM_PPLIB_PCIE_LINK_WIDTH_MASK 0x000000F8 286c59a5c48SFrançois Tigeot #define ATOM_PPLIB_PCIE_LINK_WIDTH_SHIFT 3 287c59a5c48SFrançois Tigeot 288c59a5c48SFrançois Tigeot // lookup into reduced refresh-rate table 289c59a5c48SFrançois Tigeot #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_MASK 0x00000F00 290c59a5c48SFrançois Tigeot #define ATOM_PPLIB_LIMITED_REFRESHRATE_VALUE_SHIFT 8 291c59a5c48SFrançois Tigeot 292c59a5c48SFrançois Tigeot #define ATOM_PPLIB_LIMITED_REFRESHRATE_UNLIMITED 0 293c59a5c48SFrançois Tigeot #define ATOM_PPLIB_LIMITED_REFRESHRATE_50HZ 1 294c59a5c48SFrançois Tigeot // 2-15 TBD as needed. 295c59a5c48SFrançois Tigeot 296c59a5c48SFrançois Tigeot #define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING 0x00001000 297c59a5c48SFrançois Tigeot #define ATOM_PPLIB_SOFTWARE_ENABLE_SLEEP_FOR_TIMESTAMPS 0x00002000 298c59a5c48SFrançois Tigeot 299c59a5c48SFrançois Tigeot #define ATOM_PPLIB_DISALLOW_ON_DC 0x00004000 300c59a5c48SFrançois Tigeot 301c59a5c48SFrançois Tigeot #define ATOM_PPLIB_ENABLE_VARIBRIGHT 0x00008000 302c59a5c48SFrançois Tigeot 303c59a5c48SFrançois Tigeot //memory related flags 304c59a5c48SFrançois Tigeot #define ATOM_PPLIB_SWSTATE_MEMORY_DLL_OFF 0x000010000 305c59a5c48SFrançois Tigeot 306c59a5c48SFrançois Tigeot //M3 Arb //2bits, current 3 sets of parameters in total 307c59a5c48SFrançois Tigeot #define ATOM_PPLIB_M3ARB_MASK 0x00060000 308c59a5c48SFrançois Tigeot #define ATOM_PPLIB_M3ARB_SHIFT 17 309c59a5c48SFrançois Tigeot 310c59a5c48SFrançois Tigeot #define ATOM_PPLIB_ENABLE_DRR 0x00080000 311c59a5c48SFrançois Tigeot 312c59a5c48SFrançois Tigeot // remaining 16 bits are reserved 313c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_THERMAL_STATE 314c59a5c48SFrançois Tigeot { 315c59a5c48SFrançois Tigeot UCHAR ucMinTemperature; 316c59a5c48SFrançois Tigeot UCHAR ucMaxTemperature; 317c59a5c48SFrançois Tigeot UCHAR ucThermalAction; 318c59a5c48SFrançois Tigeot }ATOM_PPLIB_THERMAL_STATE, *LPATOM_PPLIB_THERMAL_STATE; 319c59a5c48SFrançois Tigeot 320c59a5c48SFrançois Tigeot // Contained in an array starting at the offset 321c59a5c48SFrançois Tigeot // in ATOM_PPLIB_POWERPLAYTABLE::usNonClockInfoArrayOffset. 322c59a5c48SFrançois Tigeot // referenced from ATOM_PPLIB_STATE_INFO::ucNonClockStateIndex 323c59a5c48SFrançois Tigeot #define ATOM_PPLIB_NONCLOCKINFO_VER1 12 324c59a5c48SFrançois Tigeot #define ATOM_PPLIB_NONCLOCKINFO_VER2 24 325c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_NONCLOCK_INFO 326c59a5c48SFrançois Tigeot { 327c59a5c48SFrançois Tigeot USHORT usClassification; 328c59a5c48SFrançois Tigeot UCHAR ucMinTemperature; 329c59a5c48SFrançois Tigeot UCHAR ucMaxTemperature; 330c59a5c48SFrançois Tigeot ULONG ulCapsAndSettings; 331c59a5c48SFrançois Tigeot UCHAR ucRequiredPower; 332c59a5c48SFrançois Tigeot USHORT usClassification2; 333c59a5c48SFrançois Tigeot ULONG ulVCLK; 334c59a5c48SFrançois Tigeot ULONG ulDCLK; 335c59a5c48SFrançois Tigeot UCHAR ucUnused[5]; 336c59a5c48SFrançois Tigeot } ATOM_PPLIB_NONCLOCK_INFO; 337c59a5c48SFrançois Tigeot 338c59a5c48SFrançois Tigeot // Contained in an array starting at the offset 339c59a5c48SFrançois Tigeot // in ATOM_PPLIB_POWERPLAYTABLE::usClockInfoArrayOffset. 340c59a5c48SFrançois Tigeot // referenced from ATOM_PPLIB_STATE::ucClockStateIndices 341c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_R600_CLOCK_INFO 342c59a5c48SFrançois Tigeot { 343c59a5c48SFrançois Tigeot USHORT usEngineClockLow; 344c59a5c48SFrançois Tigeot UCHAR ucEngineClockHigh; 345c59a5c48SFrançois Tigeot 346c59a5c48SFrançois Tigeot USHORT usMemoryClockLow; 347c59a5c48SFrançois Tigeot UCHAR ucMemoryClockHigh; 348c59a5c48SFrançois Tigeot 349c59a5c48SFrançois Tigeot USHORT usVDDC; 350c59a5c48SFrançois Tigeot USHORT usUnused1; 351c59a5c48SFrançois Tigeot USHORT usUnused2; 352c59a5c48SFrançois Tigeot 353c59a5c48SFrançois Tigeot ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_* 354c59a5c48SFrançois Tigeot 355c59a5c48SFrançois Tigeot } ATOM_PPLIB_R600_CLOCK_INFO; 356c59a5c48SFrançois Tigeot 357c59a5c48SFrançois Tigeot // ulFlags in ATOM_PPLIB_R600_CLOCK_INFO 358c59a5c48SFrançois Tigeot #define ATOM_PPLIB_R600_FLAGS_PCIEGEN2 1 359c59a5c48SFrançois Tigeot #define ATOM_PPLIB_R600_FLAGS_UVDSAFE 2 360c59a5c48SFrançois Tigeot #define ATOM_PPLIB_R600_FLAGS_BACKBIASENABLE 4 361c59a5c48SFrançois Tigeot #define ATOM_PPLIB_R600_FLAGS_MEMORY_ODT_OFF 8 362c59a5c48SFrançois Tigeot #define ATOM_PPLIB_R600_FLAGS_MEMORY_DLL_OFF 16 363c59a5c48SFrançois Tigeot #define ATOM_PPLIB_R600_FLAGS_LOWPOWER 32 // On the RV770 use 'low power' setting (sequencer S0). 364c59a5c48SFrançois Tigeot 365c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_RS780_CLOCK_INFO 366c59a5c48SFrançois Tigeot 367c59a5c48SFrançois Tigeot { 368c59a5c48SFrançois Tigeot USHORT usLowEngineClockLow; // Low Engine clock in MHz (the same way as on the R600). 369c59a5c48SFrançois Tigeot UCHAR ucLowEngineClockHigh; 370c59a5c48SFrançois Tigeot USHORT usHighEngineClockLow; // High Engine clock in MHz. 371c59a5c48SFrançois Tigeot UCHAR ucHighEngineClockHigh; 372c59a5c48SFrançois Tigeot USHORT usMemoryClockLow; // For now one of the ATOM_PPLIB_RS780_SPMCLK_XXXX constants. 373c59a5c48SFrançois Tigeot UCHAR ucMemoryClockHigh; // Currentyl unused. 374c59a5c48SFrançois Tigeot UCHAR ucPadding; // For proper alignment and size. 375c59a5c48SFrançois Tigeot USHORT usVDDC; // For the 780, use: None, Low, High, Variable 376c59a5c48SFrançois Tigeot UCHAR ucMaxHTLinkWidth; // From SBIOS - {2, 4, 8, 16} 377c59a5c48SFrançois Tigeot UCHAR ucMinHTLinkWidth; // From SBIOS - {2, 4, 8, 16}. Effective only if CDLW enabled. Minimum down stream width could 378c59a5c48SFrançois Tigeot USHORT usHTLinkFreq; // See definition ATOM_PPLIB_RS780_HTLINKFREQ_xxx or in MHz(>=200). 379c59a5c48SFrançois Tigeot ULONG ulFlags; 380c59a5c48SFrançois Tigeot } ATOM_PPLIB_RS780_CLOCK_INFO; 381c59a5c48SFrançois Tigeot 382c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_VOLTAGE_NONE 0 383c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_VOLTAGE_LOW 1 384c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_VOLTAGE_HIGH 2 385c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_VOLTAGE_VARIABLE 3 386c59a5c48SFrançois Tigeot 387c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_SPMCLK_NONE 0 // We cannot change the side port memory clock, leave it as it is. 388c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_SPMCLK_LOW 1 389c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_SPMCLK_HIGH 2 390c59a5c48SFrançois Tigeot 391c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_HTLINKFREQ_NONE 0 392c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_HTLINKFREQ_LOW 1 393c59a5c48SFrançois Tigeot #define ATOM_PPLIB_RS780_HTLINKFREQ_HIGH 2 394c59a5c48SFrançois Tigeot 395c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO 396c59a5c48SFrançois Tigeot { 397c59a5c48SFrançois Tigeot USHORT usEngineClockLow; 398c59a5c48SFrançois Tigeot UCHAR ucEngineClockHigh; 399c59a5c48SFrançois Tigeot 400c59a5c48SFrançois Tigeot USHORT usMemoryClockLow; 401c59a5c48SFrançois Tigeot UCHAR ucMemoryClockHigh; 402c59a5c48SFrançois Tigeot 403c59a5c48SFrançois Tigeot USHORT usVDDC; 404c59a5c48SFrançois Tigeot USHORT usVDDCI; 405c59a5c48SFrançois Tigeot USHORT usUnused; 406c59a5c48SFrançois Tigeot 407c59a5c48SFrançois Tigeot ULONG ulFlags; // ATOM_PPLIB_R600_FLAGS_* 408c59a5c48SFrançois Tigeot 409c59a5c48SFrançois Tigeot } ATOM_PPLIB_EVERGREEN_CLOCK_INFO; 410c59a5c48SFrançois Tigeot 411c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_SI_CLOCK_INFO 412c59a5c48SFrançois Tigeot { 413c59a5c48SFrançois Tigeot USHORT usEngineClockLow; 414c59a5c48SFrançois Tigeot UCHAR ucEngineClockHigh; 415c59a5c48SFrançois Tigeot 416c59a5c48SFrançois Tigeot USHORT usMemoryClockLow; 417c59a5c48SFrançois Tigeot UCHAR ucMemoryClockHigh; 418c59a5c48SFrançois Tigeot 419c59a5c48SFrançois Tigeot USHORT usVDDC; 420c59a5c48SFrançois Tigeot USHORT usVDDCI; 421c59a5c48SFrançois Tigeot UCHAR ucPCIEGen; 422c59a5c48SFrançois Tigeot UCHAR ucUnused1; 423c59a5c48SFrançois Tigeot 424c59a5c48SFrançois Tigeot ULONG ulFlags; // ATOM_PPLIB_SI_FLAGS_*, no flag is necessary for now 425c59a5c48SFrançois Tigeot 426c59a5c48SFrançois Tigeot } ATOM_PPLIB_SI_CLOCK_INFO; 427c59a5c48SFrançois Tigeot 428c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_CI_CLOCK_INFO 429c59a5c48SFrançois Tigeot { 430c59a5c48SFrançois Tigeot USHORT usEngineClockLow; 431c59a5c48SFrançois Tigeot UCHAR ucEngineClockHigh; 432c59a5c48SFrançois Tigeot 433c59a5c48SFrançois Tigeot USHORT usMemoryClockLow; 434c59a5c48SFrançois Tigeot UCHAR ucMemoryClockHigh; 435c59a5c48SFrançois Tigeot 436c59a5c48SFrançois Tigeot UCHAR ucPCIEGen; 437c59a5c48SFrançois Tigeot USHORT usPCIELane; 438c59a5c48SFrançois Tigeot } ATOM_PPLIB_CI_CLOCK_INFO; 439c59a5c48SFrançois Tigeot 440c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_SUMO_CLOCK_INFO{ 441c59a5c48SFrançois Tigeot USHORT usEngineClockLow; //clockfrequency & 0xFFFF. The unit is in 10khz 442c59a5c48SFrançois Tigeot UCHAR ucEngineClockHigh; //clockfrequency >> 16. 443c59a5c48SFrançois Tigeot UCHAR vddcIndex; //2-bit vddc index; 444c59a5c48SFrançois Tigeot USHORT tdpLimit; 445c59a5c48SFrançois Tigeot //please initalize to 0 446c59a5c48SFrançois Tigeot USHORT rsv1; 447c59a5c48SFrançois Tigeot //please initialize to 0s 448c59a5c48SFrançois Tigeot ULONG rsv2[2]; 449c59a5c48SFrançois Tigeot }ATOM_PPLIB_SUMO_CLOCK_INFO; 450c59a5c48SFrançois Tigeot 451*b843c749SSergey Zigachev typedef struct _ATOM_PPLIB_KV_CLOCK_INFO { 452*b843c749SSergey Zigachev USHORT usEngineClockLow; 453*b843c749SSergey Zigachev UCHAR ucEngineClockHigh; 454*b843c749SSergey Zigachev UCHAR vddcIndex; 455*b843c749SSergey Zigachev USHORT tdpLimit; 456*b843c749SSergey Zigachev USHORT rsv1; 457*b843c749SSergey Zigachev ULONG rsv2[2]; 458*b843c749SSergey Zigachev } ATOM_PPLIB_KV_CLOCK_INFO; 459*b843c749SSergey Zigachev 460c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_CZ_CLOCK_INFO { 461c59a5c48SFrançois Tigeot UCHAR index; 462c59a5c48SFrançois Tigeot UCHAR rsv[3]; 463c59a5c48SFrançois Tigeot } ATOM_PPLIB_CZ_CLOCK_INFO; 464c59a5c48SFrançois Tigeot 465c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_STATE_V2 466c59a5c48SFrançois Tigeot { 467c59a5c48SFrançois Tigeot //number of valid dpm levels in this state; Driver uses it to calculate the whole 468c59a5c48SFrançois Tigeot //size of the state: sizeof(ATOM_PPLIB_STATE_V2) + (ucNumDPMLevels - 1) * sizeof(UCHAR) 469c59a5c48SFrançois Tigeot UCHAR ucNumDPMLevels; 470c59a5c48SFrançois Tigeot 471c59a5c48SFrançois Tigeot //a index to the array of nonClockInfos 472c59a5c48SFrançois Tigeot UCHAR nonClockInfoIndex; 473c59a5c48SFrançois Tigeot /** 474c59a5c48SFrançois Tigeot * Driver will read the first ucNumDPMLevels in this array 475c59a5c48SFrançois Tigeot */ 476c59a5c48SFrançois Tigeot UCHAR clockInfoIndex[1]; 477c59a5c48SFrançois Tigeot } ATOM_PPLIB_STATE_V2; 478c59a5c48SFrançois Tigeot 479c59a5c48SFrançois Tigeot typedef struct _StateArray{ 480c59a5c48SFrançois Tigeot //how many states we have 481c59a5c48SFrançois Tigeot UCHAR ucNumEntries; 482c59a5c48SFrançois Tigeot 483c59a5c48SFrançois Tigeot ATOM_PPLIB_STATE_V2 states[1]; 484c59a5c48SFrançois Tigeot }StateArray; 485c59a5c48SFrançois Tigeot 486c59a5c48SFrançois Tigeot 487c59a5c48SFrançois Tigeot typedef struct _ClockInfoArray{ 488c59a5c48SFrançois Tigeot //how many clock levels we have 489c59a5c48SFrançois Tigeot UCHAR ucNumEntries; 490c59a5c48SFrançois Tigeot 491c59a5c48SFrançois Tigeot //sizeof(ATOM_PPLIB_CLOCK_INFO) 492c59a5c48SFrançois Tigeot UCHAR ucEntrySize; 493c59a5c48SFrançois Tigeot 494c59a5c48SFrançois Tigeot UCHAR clockInfo[1]; 495c59a5c48SFrançois Tigeot }ClockInfoArray; 496c59a5c48SFrançois Tigeot 497c59a5c48SFrançois Tigeot typedef struct _NonClockInfoArray{ 498c59a5c48SFrançois Tigeot 499c59a5c48SFrançois Tigeot //how many non-clock levels we have. normally should be same as number of states 500c59a5c48SFrançois Tigeot UCHAR ucNumEntries; 501c59a5c48SFrançois Tigeot //sizeof(ATOM_PPLIB_NONCLOCK_INFO) 502c59a5c48SFrançois Tigeot UCHAR ucEntrySize; 503c59a5c48SFrançois Tigeot 504c59a5c48SFrançois Tigeot ATOM_PPLIB_NONCLOCK_INFO nonClockInfo[1]; 505c59a5c48SFrançois Tigeot }NonClockInfoArray; 506c59a5c48SFrançois Tigeot 507c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Record 508c59a5c48SFrançois Tigeot { 509c59a5c48SFrançois Tigeot USHORT usClockLow; 510c59a5c48SFrançois Tigeot UCHAR ucClockHigh; 511c59a5c48SFrançois Tigeot USHORT usVoltage; 512c59a5c48SFrançois Tigeot }ATOM_PPLIB_Clock_Voltage_Dependency_Record; 513c59a5c48SFrançois Tigeot 514c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_Clock_Voltage_Dependency_Table 515c59a5c48SFrançois Tigeot { 516c59a5c48SFrançois Tigeot UCHAR ucNumEntries; // Number of entries. 517c59a5c48SFrançois Tigeot ATOM_PPLIB_Clock_Voltage_Dependency_Record entries[1]; // Dynamically allocate entries. 518c59a5c48SFrançois Tigeot }ATOM_PPLIB_Clock_Voltage_Dependency_Table; 519c59a5c48SFrançois Tigeot 520c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Record 521c59a5c48SFrançois Tigeot { 522c59a5c48SFrançois Tigeot USHORT usSclkLow; 523c59a5c48SFrançois Tigeot UCHAR ucSclkHigh; 524c59a5c48SFrançois Tigeot USHORT usMclkLow; 525c59a5c48SFrançois Tigeot UCHAR ucMclkHigh; 526c59a5c48SFrançois Tigeot USHORT usVddc; 527c59a5c48SFrançois Tigeot USHORT usVddci; 528c59a5c48SFrançois Tigeot }ATOM_PPLIB_Clock_Voltage_Limit_Record; 529c59a5c48SFrançois Tigeot 530c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_Clock_Voltage_Limit_Table 531c59a5c48SFrançois Tigeot { 532c59a5c48SFrançois Tigeot UCHAR ucNumEntries; // Number of entries. 533c59a5c48SFrançois Tigeot ATOM_PPLIB_Clock_Voltage_Limit_Record entries[1]; // Dynamically allocate entries. 534c59a5c48SFrançois Tigeot }ATOM_PPLIB_Clock_Voltage_Limit_Table; 535c59a5c48SFrançois Tigeot 536c59a5c48SFrançois Tigeot union _ATOM_PPLIB_CAC_Leakage_Record 537c59a5c48SFrançois Tigeot { 538c59a5c48SFrançois Tigeot struct 539c59a5c48SFrançois Tigeot { 540c59a5c48SFrançois Tigeot 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 541c59a5c48SFrançois Tigeot ULONG ulLeakageValue; // For CI and newer we use this as the "fake" standar VDDC value. in CI we read it as StdVoltageLoSidd 542c59a5c48SFrançois Tigeot 543c59a5c48SFrançois Tigeot }; 544c59a5c48SFrançois Tigeot struct 545c59a5c48SFrançois Tigeot { 546c59a5c48SFrançois Tigeot USHORT usVddc1; 547c59a5c48SFrançois Tigeot USHORT usVddc2; 548c59a5c48SFrançois Tigeot USHORT usVddc3; 549c59a5c48SFrançois Tigeot }; 550c59a5c48SFrançois Tigeot }; 551c59a5c48SFrançois Tigeot 552c59a5c48SFrançois Tigeot typedef union _ATOM_PPLIB_CAC_Leakage_Record ATOM_PPLIB_CAC_Leakage_Record; 553c59a5c48SFrançois Tigeot 554c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_CAC_Leakage_Table 555c59a5c48SFrançois Tigeot { 556c59a5c48SFrançois Tigeot UCHAR ucNumEntries; // Number of entries. 557c59a5c48SFrançois Tigeot ATOM_PPLIB_CAC_Leakage_Record entries[1]; // Dynamically allocate entries. 558c59a5c48SFrançois Tigeot }ATOM_PPLIB_CAC_Leakage_Table; 559c59a5c48SFrançois Tigeot 560c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Record 561c59a5c48SFrançois Tigeot { 562c59a5c48SFrançois Tigeot USHORT usVoltage; 563c59a5c48SFrançois Tigeot USHORT usSclkLow; 564c59a5c48SFrançois Tigeot UCHAR ucSclkHigh; 565c59a5c48SFrançois Tigeot USHORT usMclkLow; 566c59a5c48SFrançois Tigeot UCHAR ucMclkHigh; 567c59a5c48SFrançois Tigeot }ATOM_PPLIB_PhaseSheddingLimits_Record; 568c59a5c48SFrançois Tigeot 569c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_PhaseSheddingLimits_Table 570c59a5c48SFrançois Tigeot { 571c59a5c48SFrançois Tigeot UCHAR ucNumEntries; // Number of entries. 572c59a5c48SFrançois Tigeot ATOM_PPLIB_PhaseSheddingLimits_Record entries[1]; // Dynamically allocate entries. 573c59a5c48SFrançois Tigeot }ATOM_PPLIB_PhaseSheddingLimits_Table; 574c59a5c48SFrançois Tigeot 575c59a5c48SFrançois Tigeot typedef struct _VCEClockInfo{ 576c59a5c48SFrançois Tigeot USHORT usEVClkLow; 577c59a5c48SFrançois Tigeot UCHAR ucEVClkHigh; 578c59a5c48SFrançois Tigeot USHORT usECClkLow; 579c59a5c48SFrançois Tigeot UCHAR ucECClkHigh; 580c59a5c48SFrançois Tigeot }VCEClockInfo; 581c59a5c48SFrançois Tigeot 582c59a5c48SFrançois Tigeot typedef struct _VCEClockInfoArray{ 583c59a5c48SFrançois Tigeot UCHAR ucNumEntries; 584c59a5c48SFrançois Tigeot VCEClockInfo entries[1]; 585c59a5c48SFrançois Tigeot }VCEClockInfoArray; 586c59a5c48SFrançois Tigeot 587c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record 588c59a5c48SFrançois Tigeot { 589c59a5c48SFrançois Tigeot USHORT usVoltage; 590c59a5c48SFrançois Tigeot UCHAR ucVCEClockInfoIndex; 591c59a5c48SFrançois Tigeot }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record; 592c59a5c48SFrançois Tigeot 593c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table 594c59a5c48SFrançois Tigeot { 595c59a5c48SFrançois Tigeot UCHAR numEntries; 596c59a5c48SFrançois Tigeot ATOM_PPLIB_VCE_Clock_Voltage_Limit_Record entries[1]; 597c59a5c48SFrançois Tigeot }ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table; 598c59a5c48SFrançois Tigeot 599c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_VCE_State_Record 600c59a5c48SFrançois Tigeot { 601c59a5c48SFrançois Tigeot UCHAR ucVCEClockInfoIndex; 602c59a5c48SFrançois Tigeot UCHAR ucClockInfoIndex; //highest 2 bits indicates memory p-states, lower 6bits indicates index to ClockInfoArrary 603c59a5c48SFrançois Tigeot }ATOM_PPLIB_VCE_State_Record; 604c59a5c48SFrançois Tigeot 605c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_VCE_State_Table 606c59a5c48SFrançois Tigeot { 607c59a5c48SFrançois Tigeot UCHAR numEntries; 608c59a5c48SFrançois Tigeot ATOM_PPLIB_VCE_State_Record entries[1]; 609c59a5c48SFrançois Tigeot }ATOM_PPLIB_VCE_State_Table; 610c59a5c48SFrançois Tigeot 611c59a5c48SFrançois Tigeot 612c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_VCE_Table 613c59a5c48SFrançois Tigeot { 614c59a5c48SFrançois Tigeot UCHAR revid; 615c59a5c48SFrançois Tigeot // VCEClockInfoArray array; 616c59a5c48SFrançois Tigeot // ATOM_PPLIB_VCE_Clock_Voltage_Limit_Table limits; 617c59a5c48SFrançois Tigeot // ATOM_PPLIB_VCE_State_Table states; 618c59a5c48SFrançois Tigeot }ATOM_PPLIB_VCE_Table; 619c59a5c48SFrançois Tigeot 620c59a5c48SFrançois Tigeot 621c59a5c48SFrançois Tigeot typedef struct _UVDClockInfo{ 622c59a5c48SFrançois Tigeot USHORT usVClkLow; 623c59a5c48SFrançois Tigeot UCHAR ucVClkHigh; 624c59a5c48SFrançois Tigeot USHORT usDClkLow; 625c59a5c48SFrançois Tigeot UCHAR ucDClkHigh; 626c59a5c48SFrançois Tigeot }UVDClockInfo; 627c59a5c48SFrançois Tigeot 628c59a5c48SFrançois Tigeot typedef struct _UVDClockInfoArray{ 629c59a5c48SFrançois Tigeot UCHAR ucNumEntries; 630c59a5c48SFrançois Tigeot UVDClockInfo entries[1]; 631c59a5c48SFrançois Tigeot }UVDClockInfoArray; 632c59a5c48SFrançois Tigeot 633c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record 634c59a5c48SFrançois Tigeot { 635c59a5c48SFrançois Tigeot USHORT usVoltage; 636c59a5c48SFrançois Tigeot UCHAR ucUVDClockInfoIndex; 637c59a5c48SFrançois Tigeot }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record; 638c59a5c48SFrançois Tigeot 639c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table 640c59a5c48SFrançois Tigeot { 641c59a5c48SFrançois Tigeot UCHAR numEntries; 642c59a5c48SFrançois Tigeot ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record entries[1]; 643c59a5c48SFrançois Tigeot }ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table; 644c59a5c48SFrançois Tigeot 645c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_UVD_Table 646c59a5c48SFrançois Tigeot { 647c59a5c48SFrançois Tigeot UCHAR revid; 648c59a5c48SFrançois Tigeot // UVDClockInfoArray array; 649c59a5c48SFrançois Tigeot // ATOM_PPLIB_UVD_Clock_Voltage_Limit_Table limits; 650c59a5c48SFrançois Tigeot }ATOM_PPLIB_UVD_Table; 651c59a5c48SFrançois Tigeot 652c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Record 653c59a5c48SFrançois Tigeot { 654c59a5c48SFrançois Tigeot USHORT usVoltage; 655c59a5c48SFrançois Tigeot USHORT usSAMClockLow; 656c59a5c48SFrançois Tigeot UCHAR ucSAMClockHigh; 657c59a5c48SFrançois Tigeot }ATOM_PPLIB_SAMClk_Voltage_Limit_Record; 658c59a5c48SFrançois Tigeot 659c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_SAMClk_Voltage_Limit_Table{ 660c59a5c48SFrançois Tigeot UCHAR numEntries; 661c59a5c48SFrançois Tigeot ATOM_PPLIB_SAMClk_Voltage_Limit_Record entries[1]; 662c59a5c48SFrançois Tigeot }ATOM_PPLIB_SAMClk_Voltage_Limit_Table; 663c59a5c48SFrançois Tigeot 664c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_SAMU_Table 665c59a5c48SFrançois Tigeot { 666c59a5c48SFrançois Tigeot UCHAR revid; 667c59a5c48SFrançois Tigeot ATOM_PPLIB_SAMClk_Voltage_Limit_Table limits; 668c59a5c48SFrançois Tigeot }ATOM_PPLIB_SAMU_Table; 669c59a5c48SFrançois Tigeot 670c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Record 671c59a5c48SFrançois Tigeot { 672c59a5c48SFrançois Tigeot USHORT usVoltage; 673c59a5c48SFrançois Tigeot USHORT usACPClockLow; 674c59a5c48SFrançois Tigeot UCHAR ucACPClockHigh; 675c59a5c48SFrançois Tigeot }ATOM_PPLIB_ACPClk_Voltage_Limit_Record; 676c59a5c48SFrançois Tigeot 677c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_ACPClk_Voltage_Limit_Table{ 678c59a5c48SFrançois Tigeot UCHAR numEntries; 679c59a5c48SFrançois Tigeot ATOM_PPLIB_ACPClk_Voltage_Limit_Record entries[1]; 680c59a5c48SFrançois Tigeot }ATOM_PPLIB_ACPClk_Voltage_Limit_Table; 681c59a5c48SFrançois Tigeot 682c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_ACP_Table 683c59a5c48SFrançois Tigeot { 684c59a5c48SFrançois Tigeot UCHAR revid; 685c59a5c48SFrançois Tigeot ATOM_PPLIB_ACPClk_Voltage_Limit_Table limits; 686c59a5c48SFrançois Tigeot }ATOM_PPLIB_ACP_Table; 687c59a5c48SFrançois Tigeot 688c59a5c48SFrançois Tigeot typedef struct _ATOM_PowerTune_Table{ 689c59a5c48SFrançois Tigeot USHORT usTDP; 690c59a5c48SFrançois Tigeot USHORT usConfigurableTDP; 691c59a5c48SFrançois Tigeot USHORT usTDC; 692c59a5c48SFrançois Tigeot USHORT usBatteryPowerLimit; 693c59a5c48SFrançois Tigeot USHORT usSmallPowerLimit; 694c59a5c48SFrançois Tigeot USHORT usLowCACLeakage; 695c59a5c48SFrançois Tigeot USHORT usHighCACLeakage; 696c59a5c48SFrançois Tigeot }ATOM_PowerTune_Table; 697c59a5c48SFrançois Tigeot 698c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_POWERTUNE_Table 699c59a5c48SFrançois Tigeot { 700c59a5c48SFrançois Tigeot UCHAR revid; 701c59a5c48SFrançois Tigeot ATOM_PowerTune_Table power_tune_table; 702c59a5c48SFrançois Tigeot }ATOM_PPLIB_POWERTUNE_Table; 703c59a5c48SFrançois Tigeot 704c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_POWERTUNE_Table_V1 705c59a5c48SFrançois Tigeot { 706c59a5c48SFrançois Tigeot UCHAR revid; 707c59a5c48SFrançois Tigeot ATOM_PowerTune_Table power_tune_table; 708c59a5c48SFrançois Tigeot USHORT usMaximumPowerDeliveryLimit; 709c59a5c48SFrançois Tigeot USHORT usTjMax; 710c59a5c48SFrançois Tigeot USHORT usReserve[6]; 711c59a5c48SFrançois Tigeot } ATOM_PPLIB_POWERTUNE_Table_V1; 712c59a5c48SFrançois Tigeot 713c59a5c48SFrançois Tigeot #define ATOM_PPM_A_A 1 714c59a5c48SFrançois Tigeot #define ATOM_PPM_A_I 2 715c59a5c48SFrançois Tigeot typedef struct _ATOM_PPLIB_PPM_Table 716c59a5c48SFrançois Tigeot { 717c59a5c48SFrançois Tigeot UCHAR ucRevId; 718c59a5c48SFrançois Tigeot UCHAR ucPpmDesign; //A+I or A+A 719c59a5c48SFrançois Tigeot USHORT usCpuCoreNumber; 720c59a5c48SFrançois Tigeot ULONG ulPlatformTDP; 721c59a5c48SFrançois Tigeot ULONG ulSmallACPlatformTDP; 722c59a5c48SFrançois Tigeot ULONG ulPlatformTDC; 723c59a5c48SFrançois Tigeot ULONG ulSmallACPlatformTDC; 724c59a5c48SFrançois Tigeot ULONG ulApuTDP; 725c59a5c48SFrançois Tigeot ULONG ulDGpuTDP; 726c59a5c48SFrançois Tigeot ULONG ulDGpuUlvPower; 727c59a5c48SFrançois Tigeot ULONG ulTjmax; 728c59a5c48SFrançois Tigeot } ATOM_PPLIB_PPM_Table; 729c59a5c48SFrançois Tigeot 730*b843c749SSergey Zigachev #define VQ_DisplayConfig_NoneAWD 1 731*b843c749SSergey Zigachev #define VQ_DisplayConfig_AWD 2 732*b843c749SSergey Zigachev 733*b843c749SSergey Zigachev typedef struct ATOM_PPLIB_VQ_Budgeting_Record{ 734*b843c749SSergey Zigachev ULONG ulDeviceID; 735*b843c749SSergey Zigachev ULONG ulSustainableSOCPowerLimitLow; /* in mW */ 736*b843c749SSergey Zigachev ULONG ulSustainableSOCPowerLimitHigh; /* in mW */ 737*b843c749SSergey Zigachev 738*b843c749SSergey Zigachev ULONG ulDClk; 739*b843c749SSergey Zigachev ULONG ulEClk; 740*b843c749SSergey Zigachev ULONG ulDispSclk; 741*b843c749SSergey Zigachev UCHAR ucDispConfig; 742*b843c749SSergey Zigachev 743*b843c749SSergey Zigachev } ATOM_PPLIB_VQ_Budgeting_Record; 744*b843c749SSergey Zigachev 745*b843c749SSergey Zigachev typedef struct ATOM_PPLIB_VQ_Budgeting_Table { 746*b843c749SSergey Zigachev UCHAR revid; 747*b843c749SSergey Zigachev UCHAR numEntries; 748*b843c749SSergey Zigachev ATOM_PPLIB_VQ_Budgeting_Record entries[1]; 749*b843c749SSergey Zigachev } ATOM_PPLIB_VQ_Budgeting_Table; 750*b843c749SSergey Zigachev 751c59a5c48SFrançois Tigeot #pragma pack() 752c59a5c48SFrançois Tigeot 753c59a5c48SFrançois Tigeot #endif 754