1*b843c749SSergey Zigachev /*
2*b843c749SSergey Zigachev  * Copyright 2016 Advanced Micro Devices, Inc.
3*b843c749SSergey Zigachev  *
4*b843c749SSergey Zigachev  * Permission is hereby granted, free of charge, to any person obtaining a
5*b843c749SSergey Zigachev  * copy of this software and associated documentation files (the "Software"),
6*b843c749SSergey Zigachev  * to deal in the Software without restriction, including without limitation
7*b843c749SSergey Zigachev  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*b843c749SSergey Zigachev  * and/or sell copies of the Software, and to permit persons to whom the
9*b843c749SSergey Zigachev  * Software is furnished to do so, subject to the following conditions:
10*b843c749SSergey Zigachev  *
11*b843c749SSergey Zigachev  * The above copyright notice and this permission notice shall be included in
12*b843c749SSergey Zigachev  * all copies or substantial portions of the Software.
13*b843c749SSergey Zigachev  *
14*b843c749SSergey Zigachev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*b843c749SSergey Zigachev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*b843c749SSergey Zigachev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*b843c749SSergey Zigachev  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*b843c749SSergey Zigachev  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*b843c749SSergey Zigachev  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*b843c749SSergey Zigachev  * OTHER DEALINGS IN THE SOFTWARE.
21*b843c749SSergey Zigachev  *
22*b843c749SSergey Zigachev  */
23*b843c749SSergey Zigachev 
24*b843c749SSergey Zigachev #ifndef PP_SMC_H
25*b843c749SSergey Zigachev #define PP_SMC_H
26*b843c749SSergey Zigachev 
27*b843c749SSergey Zigachev #pragma pack(push, 1)
28*b843c749SSergey Zigachev 
29*b843c749SSergey Zigachev #define SMU_UCODE_VERSION                  0x001c0800
30*b843c749SSergey Zigachev 
31*b843c749SSergey Zigachev /* SMU Response Codes: */
32*b843c749SSergey Zigachev #define PPSMC_Result_OK                    0x1
33*b843c749SSergey Zigachev #define PPSMC_Result_Failed                0xFF
34*b843c749SSergey Zigachev #define PPSMC_Result_UnknownCmd            0xFE
35*b843c749SSergey Zigachev #define PPSMC_Result_CmdRejectedPrereq     0xFD
36*b843c749SSergey Zigachev #define PPSMC_Result_CmdRejectedBusy       0xFC
37*b843c749SSergey Zigachev 
38*b843c749SSergey Zigachev typedef uint16_t PPSMC_Result;
39*b843c749SSergey Zigachev 
40*b843c749SSergey Zigachev /* Message Definitions */
41*b843c749SSergey Zigachev #define PPSMC_MSG_TestMessage                    0x1
42*b843c749SSergey Zigachev #define PPSMC_MSG_GetSmuVersion                  0x2
43*b843c749SSergey Zigachev #define PPSMC_MSG_GetDriverIfVersion             0x3
44*b843c749SSergey Zigachev #define PPSMC_MSG_EnableSmuFeatures              0x4
45*b843c749SSergey Zigachev #define PPSMC_MSG_DisableSmuFeatures             0x5
46*b843c749SSergey Zigachev #define PPSMC_MSG_GetEnabledSmuFeatures          0x6
47*b843c749SSergey Zigachev #define PPSMC_MSG_SetWorkloadMask                0x7
48*b843c749SSergey Zigachev #define PPSMC_MSG_SetPptLimit                    0x8
49*b843c749SSergey Zigachev #define PPSMC_MSG_SetDriverDramAddrHigh          0x9
50*b843c749SSergey Zigachev #define PPSMC_MSG_SetDriverDramAddrLow           0xA
51*b843c749SSergey Zigachev #define PPSMC_MSG_SetToolsDramAddrHigh           0xB
52*b843c749SSergey Zigachev #define PPSMC_MSG_SetToolsDramAddrLow            0xC
53*b843c749SSergey Zigachev #define PPSMC_MSG_TransferTableSmu2Dram          0xD
54*b843c749SSergey Zigachev #define PPSMC_MSG_TransferTableDram2Smu          0xE
55*b843c749SSergey Zigachev #define PPSMC_MSG_UseDefaultPPTable              0xF
56*b843c749SSergey Zigachev #define PPSMC_MSG_UseBackupPPTable               0x10
57*b843c749SSergey Zigachev #define PPSMC_MSG_RunBtc                         0x11
58*b843c749SSergey Zigachev #define PPSMC_MSG_RequestI2CBus                  0x12
59*b843c749SSergey Zigachev #define PPSMC_MSG_ReleaseI2CBus                  0x13
60*b843c749SSergey Zigachev #define PPSMC_MSG_ConfigureTelemetry             0x14
61*b843c749SSergey Zigachev #define PPSMC_MSG_SetUlvIpMask                   0x15
62*b843c749SSergey Zigachev #define PPSMC_MSG_SetSocVidOffset                0x16
63*b843c749SSergey Zigachev #define PPSMC_MSG_SetMemVidOffset                0x17
64*b843c749SSergey Zigachev #define PPSMC_MSG_GetSocVidOffset                0x18
65*b843c749SSergey Zigachev #define PPSMC_MSG_GetMemVidOffset                0x19
66*b843c749SSergey Zigachev #define PPSMC_MSG_SetFloorSocVoltage             0x1A
67*b843c749SSergey Zigachev #define PPSMC_MSG_SoftReset                      0x1B
68*b843c749SSergey Zigachev #define PPSMC_MSG_StartBacoMonitor               0x1C
69*b843c749SSergey Zigachev #define PPSMC_MSG_CancelBacoMonitor              0x1D
70*b843c749SSergey Zigachev #define PPSMC_MSG_EnterBaco                      0x1E
71*b843c749SSergey Zigachev #define PPSMC_MSG_AllowLowGfxclkInterrupt        0x1F
72*b843c749SSergey Zigachev #define PPSMC_MSG_SetLowGfxclkInterruptThreshold 0x20
73*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMinGfxclkByIndex        0x21
74*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMaxGfxclkByIndex        0x22
75*b843c749SSergey Zigachev #define PPSMC_MSG_GetCurrentGfxclkIndex          0x23
76*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMinUclkByIndex          0x24
77*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMaxUclkByIndex          0x25
78*b843c749SSergey Zigachev #define PPSMC_MSG_GetCurrentUclkIndex            0x26
79*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMinUvdByIndex           0x27
80*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMaxUvdByIndex           0x28
81*b843c749SSergey Zigachev #define PPSMC_MSG_GetCurrentUvdIndex             0x29
82*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMinVceByIndex           0x2A
83*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMaxVceByIndex           0x2B
84*b843c749SSergey Zigachev #define PPSMC_MSG_SetHardMinVceByIndex           0x2C
85*b843c749SSergey Zigachev #define PPSMC_MSG_GetCurrentVceIndex             0x2D
86*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMinSocclkByIndex        0x2E
87*b843c749SSergey Zigachev #define PPSMC_MSG_SetHardMinSocclkByIndex        0x2F
88*b843c749SSergey Zigachev #define PPSMC_MSG_SetSoftMaxSocclkByIndex        0x30
89*b843c749SSergey Zigachev #define PPSMC_MSG_GetCurrentSocclkIndex          0x31
90*b843c749SSergey Zigachev #define PPSMC_MSG_SetMinLinkDpmByIndex           0x32
91*b843c749SSergey Zigachev #define PPSMC_MSG_GetCurrentLinkIndex            0x33
92*b843c749SSergey Zigachev #define PPSMC_MSG_GetAverageGfxclkFrequency      0x34
93*b843c749SSergey Zigachev #define PPSMC_MSG_GetAverageSocclkFrequency      0x35
94*b843c749SSergey Zigachev #define PPSMC_MSG_GetAverageUclkFrequency        0x36
95*b843c749SSergey Zigachev #define PPSMC_MSG_GetAverageGfxActivity          0x37
96*b843c749SSergey Zigachev #define PPSMC_MSG_GetTemperatureEdge             0x38
97*b843c749SSergey Zigachev #define PPSMC_MSG_GetTemperatureHotspot          0x39
98*b843c749SSergey Zigachev #define PPSMC_MSG_GetTemperatureHBM              0x3A
99*b843c749SSergey Zigachev #define PPSMC_MSG_GetTemperatureVrSoc            0x3B
100*b843c749SSergey Zigachev #define PPSMC_MSG_GetTemperatureVrMem            0x3C
101*b843c749SSergey Zigachev #define PPSMC_MSG_GetTemperatureLiquid           0x3D
102*b843c749SSergey Zigachev #define PPSMC_MSG_GetTemperaturePlx              0x3E
103*b843c749SSergey Zigachev #define PPSMC_MSG_OverDriveSetPercentage         0x3F
104*b843c749SSergey Zigachev #define PPSMC_MSG_SetMinDeepSleepDcefclk         0x40
105*b843c749SSergey Zigachev #define PPSMC_MSG_SwitchToAC                     0x41
106*b843c749SSergey Zigachev #define PPSMC_MSG_SetUclkFastSwitch              0x42
107*b843c749SSergey Zigachev #define PPSMC_MSG_SetUclkDownHyst                0x43
108*b843c749SSergey Zigachev #define PPSMC_MSG_RemoveDCClamp                  0x44
109*b843c749SSergey Zigachev #define PPSMC_MSG_GfxDeviceDriverReset           0x45
110*b843c749SSergey Zigachev #define PPSMC_MSG_GetCurrentRpm                  0x46
111*b843c749SSergey Zigachev #define PPSMC_MSG_SetVideoFps                    0x47
112*b843c749SSergey Zigachev #define PPSMC_MSG_SetCustomGfxDpmParameters      0x48
113*b843c749SSergey Zigachev #define PPSMC_MSG_SetTjMax                       0x49
114*b843c749SSergey Zigachev #define PPSMC_MSG_SetFanTemperatureTarget        0x4A
115*b843c749SSergey Zigachev #define PPSMC_MSG_PrepareMp1ForUnload            0x4B
116*b843c749SSergey Zigachev #define PPSMC_MSG_RequestDisplayClockByFreq      0x4C
117*b843c749SSergey Zigachev #define PPSMC_MSG_GetClockFreqMHz                0x4D
118*b843c749SSergey Zigachev #define PPSMC_MSG_DramLogSetDramAddrHigh         0x4E
119*b843c749SSergey Zigachev #define PPSMC_MSG_DramLogSetDramAddrLow          0x4F
120*b843c749SSergey Zigachev #define PPSMC_MSG_DramLogSetDramSize             0x50
121*b843c749SSergey Zigachev #define PPSMC_MSG_SetFanMaxRpm                   0x51
122*b843c749SSergey Zigachev #define PPSMC_MSG_SetFanMinPwm                   0x52
123*b843c749SSergey Zigachev #define PPSMC_MSG_ConfigureGfxDidt               0x55
124*b843c749SSergey Zigachev #define PPSMC_MSG_NumOfDisplays                  0x56
125*b843c749SSergey Zigachev #define PPSMC_MSG_ReadSerialNumTop32             0x58
126*b843c749SSergey Zigachev #define PPSMC_MSG_ReadSerialNumBottom32          0x59
127*b843c749SSergey Zigachev #define PPSMC_MSG_SetSystemVirtualDramAddrHigh   0x5A
128*b843c749SSergey Zigachev #define PPSMC_MSG_SetSystemVirtualDramAddrLow    0x5B
129*b843c749SSergey Zigachev #define PPSMC_MSG_RunAcgBtc                      0x5C
130*b843c749SSergey Zigachev #define PPSMC_MSG_RunAcgInClosedLoop             0x5D
131*b843c749SSergey Zigachev #define PPSMC_MSG_RunAcgInOpenLoop               0x5E
132*b843c749SSergey Zigachev #define PPSMC_MSG_InitializeAcg                  0x5F
133*b843c749SSergey Zigachev #define PPSMC_MSG_GetCurrPkgPwr                  0x61
134*b843c749SSergey Zigachev #define PPSMC_MSG_GetAverageGfxclkActualFrequency 0x63
135*b843c749SSergey Zigachev #define PPSMC_MSG_SetPccThrottleLevel            0x67
136*b843c749SSergey Zigachev #define PPSMC_MSG_UpdatePkgPwrPidAlpha           0x68
137*b843c749SSergey Zigachev #define PPSMC_Message_Count                      0x69
138*b843c749SSergey Zigachev 
139*b843c749SSergey Zigachev 
140*b843c749SSergey Zigachev typedef int PPSMC_Msg;
141*b843c749SSergey Zigachev 
142*b843c749SSergey Zigachev #pragma pack(pop)
143*b843c749SSergey Zigachev 
144*b843c749SSergey Zigachev #endif
145