xref: /linux/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_pptable.h (revision a1c613ae4c322ddd58d5a8539dbfba2a0380a8c0)
1e098bc96SEvan Quan /*
2e098bc96SEvan Quan  * Copyright 2018 Advanced Micro Devices, Inc.
3e098bc96SEvan Quan  *
4e098bc96SEvan Quan  * Permission is hereby granted, free of charge, to any person obtaining a
5e098bc96SEvan Quan  * copy of this software and associated documentation files (the "Software"),
6e098bc96SEvan Quan  * to deal in the Software without restriction, including without limitation
7e098bc96SEvan Quan  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8e098bc96SEvan Quan  * and/or sell copies of the Software, and to permit persons to whom the
9e098bc96SEvan Quan  * Software is furnished to do so, subject to the following conditions:
10e098bc96SEvan Quan  *
11e098bc96SEvan Quan  * The above copyright notice and this permission notice shall be included in
12e098bc96SEvan Quan  * all copies or substantial portions of the Software.
13e098bc96SEvan Quan  *
14e098bc96SEvan Quan  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15e098bc96SEvan Quan  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16e098bc96SEvan Quan  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17e098bc96SEvan Quan  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18e098bc96SEvan Quan  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19e098bc96SEvan Quan  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20e098bc96SEvan Quan  * OTHER DEALINGS IN THE SOFTWARE.
21e098bc96SEvan Quan  *
22e098bc96SEvan Quan  */
23e098bc96SEvan Quan #ifndef _VEGA20_PPTABLE_H_
24e098bc96SEvan Quan #define _VEGA20_PPTABLE_H_
25e098bc96SEvan Quan 
26e098bc96SEvan Quan #pragma pack(push, 1)
27e098bc96SEvan Quan 
28e098bc96SEvan Quan #define ATOM_VEGA20_PP_THERMALCONTROLLER_NONE           0
29e098bc96SEvan Quan #define ATOM_VEGA20_PP_THERMALCONTROLLER_VEGA20     26
30e098bc96SEvan Quan 
31e098bc96SEvan Quan #define ATOM_VEGA20_PP_PLATFORM_CAP_POWERPLAY                   0x1
32e098bc96SEvan Quan #define ATOM_VEGA20_PP_PLATFORM_CAP_SBIOSPOWERSOURCE            0x2
33e098bc96SEvan Quan #define ATOM_VEGA20_PP_PLATFORM_CAP_HARDWAREDC                  0x4
34e098bc96SEvan Quan #define ATOM_VEGA20_PP_PLATFORM_CAP_BACO                        0x8
35e098bc96SEvan Quan #define ATOM_VEGA20_PP_PLATFORM_CAP_BAMACO                      0x10
36e098bc96SEvan Quan #define ATOM_VEGA20_PP_PLATFORM_CAP_ENABLESHADOWPSTATE          0x20
37e098bc96SEvan Quan 
38e098bc96SEvan Quan #define ATOM_VEGA20_TABLE_REVISION_VEGA20         11
39e098bc96SEvan Quan #define ATOM_VEGA20_ODFEATURE_MAX_COUNT         32
40e098bc96SEvan Quan #define ATOM_VEGA20_ODSETTING_MAX_COUNT         32
41e098bc96SEvan Quan #define ATOM_VEGA20_PPCLOCK_MAX_COUNT           16
42e098bc96SEvan Quan 
43e098bc96SEvan Quan enum ATOM_VEGA20_ODFEATURE_ID {
44e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_GFXCLK_LIMITS = 0,
45e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_GFXCLK_CURVE,
46e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_UCLK_MAX,
47e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_POWER_LIMIT,
48e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_FAN_ACOUSTIC_LIMIT,    //FanMaximumRpm
49e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_FAN_SPEED_MIN,         //FanMinimumPwm
50e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_TEMPERATURE_FAN,       //FanTargetTemperature
51e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_TEMPERATURE_SYSTEM,    //MaxOpTemp
52e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_MEMORY_TIMING_TUNE,
53e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_FAN_ZERO_RPM_CONTROL,
54e098bc96SEvan Quan   ATOM_VEGA20_ODFEATURE_COUNT,
55e098bc96SEvan Quan };
56e098bc96SEvan Quan 
57e098bc96SEvan Quan enum ATOM_VEGA20_ODSETTING_ID {
58e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_GFXCLKFMAX = 0,
59e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_GFXCLKFMIN,
60e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_VDDGFXCURVEFREQ_P1,
61e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_VDDGFXCURVEVOLTAGEOFFSET_P1,
62e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_VDDGFXCURVEFREQ_P2,
63e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_VDDGFXCURVEVOLTAGEOFFSET_P2,
64e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_VDDGFXCURVEFREQ_P3,
65e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_VDDGFXCURVEVOLTAGEOFFSET_P3,
66e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_UCLKFMAX,
67e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_POWERPERCENTAGE,
68e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_FANRPMMIN,
69e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_FANRPMACOUSTICLIMIT,
70e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_FANTARGETTEMPERATURE,
71e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_OPERATINGTEMPMAX,
72e098bc96SEvan Quan   ATOM_VEGA20_ODSETTING_COUNT,
73e098bc96SEvan Quan };
74e098bc96SEvan Quan typedef enum ATOM_VEGA20_ODSETTING_ID ATOM_VEGA20_ODSETTING_ID;
75e098bc96SEvan Quan 
76*2cf9fc26SRan Sun typedef struct _ATOM_VEGA20_OVERDRIVE8_RECORD {
77e098bc96SEvan Quan   UCHAR ucODTableRevision;
78e098bc96SEvan Quan   ULONG ODFeatureCount;
79e098bc96SEvan Quan   UCHAR ODFeatureCapabilities[ATOM_VEGA20_ODFEATURE_MAX_COUNT];   //OD feature support flags
80e098bc96SEvan Quan   ULONG ODSettingCount;
81e098bc96SEvan Quan   ULONG ODSettingsMax[ATOM_VEGA20_ODSETTING_MAX_COUNT];           //Upper Limit for each OD Setting
82e098bc96SEvan Quan   ULONG ODSettingsMin[ATOM_VEGA20_ODSETTING_MAX_COUNT];           //Lower Limit for each OD Setting
83e098bc96SEvan Quan } ATOM_VEGA20_OVERDRIVE8_RECORD;
84e098bc96SEvan Quan 
85e098bc96SEvan Quan enum ATOM_VEGA20_PPCLOCK_ID {
86e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_GFXCLK = 0,
87e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_VCLK,
88e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_DCLK,
89e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_ECLK,
90e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_SOCCLK,
91e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_UCLK,
92e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_FCLK,
93e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_DCEFCLK,
94e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_DISPCLK,
95e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_PIXCLK,
96e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_PHYCLK,
97e098bc96SEvan Quan   ATOM_VEGA20_PPCLOCK_COUNT,
98e098bc96SEvan Quan };
99e098bc96SEvan Quan typedef enum ATOM_VEGA20_PPCLOCK_ID ATOM_VEGA20_PPCLOCK_ID;
100e098bc96SEvan Quan 
101*2cf9fc26SRan Sun typedef struct _ATOM_VEGA20_POWER_SAVING_CLOCK_RECORD {
102e098bc96SEvan Quan   UCHAR ucTableRevision;
103e098bc96SEvan Quan   ULONG PowerSavingClockCount;                                 // Count of PowerSavingClock Mode
104e098bc96SEvan Quan   ULONG PowerSavingClockMax[ATOM_VEGA20_PPCLOCK_MAX_COUNT];      // PowerSavingClock Mode Clock Maximum array In MHz
105e098bc96SEvan Quan   ULONG PowerSavingClockMin[ATOM_VEGA20_PPCLOCK_MAX_COUNT];      // PowerSavingClock Mode Clock Minimum array In MHz
106e098bc96SEvan Quan } ATOM_VEGA20_POWER_SAVING_CLOCK_RECORD;
107e098bc96SEvan Quan 
108*2cf9fc26SRan Sun typedef struct _ATOM_VEGA20_POWERPLAYTABLE {
109e098bc96SEvan Quan       struct atom_common_table_header sHeader;
110e098bc96SEvan Quan       UCHAR  ucTableRevision;
111e098bc96SEvan Quan       USHORT usTableSize;
112e098bc96SEvan Quan       ULONG  ulGoldenPPID;
113e098bc96SEvan Quan       ULONG  ulGoldenRevision;
114e098bc96SEvan Quan       USHORT usFormatID;
115e098bc96SEvan Quan 
116e098bc96SEvan Quan       ULONG  ulPlatformCaps;
117e098bc96SEvan Quan 
118e098bc96SEvan Quan       UCHAR  ucThermalControllerType;
119e098bc96SEvan Quan 
120e098bc96SEvan Quan       USHORT usSmallPowerLimit1;
121e098bc96SEvan Quan       USHORT usSmallPowerLimit2;
122e098bc96SEvan Quan       USHORT usBoostPowerLimit;
123e098bc96SEvan Quan       USHORT usODTurboPowerLimit;
124e098bc96SEvan Quan       USHORT usODPowerSavePowerLimit;
125e098bc96SEvan Quan       USHORT usSoftwareShutdownTemp;
126e098bc96SEvan Quan 
127e098bc96SEvan Quan       ATOM_VEGA20_POWER_SAVING_CLOCK_RECORD PowerSavingClockTable;    //PowerSavingClock Mode Clock Min/Max array
128e098bc96SEvan Quan 
129e098bc96SEvan Quan       ATOM_VEGA20_OVERDRIVE8_RECORD OverDrive8Table;       //OverDrive8 Feature capabilities and Settings Range (Max and Min)
130e098bc96SEvan Quan 
131e098bc96SEvan Quan       USHORT usReserve[5];
132e098bc96SEvan Quan 
133e098bc96SEvan Quan       PPTable_t smcPPTable;
134e098bc96SEvan Quan 
135e098bc96SEvan Quan } ATOM_Vega20_POWERPLAYTABLE;
136e098bc96SEvan Quan 
137e098bc96SEvan Quan #pragma pack(pop)
138e098bc96SEvan Quan 
139e098bc96SEvan Quan #endif
140