1/*	$NetBSD: rv_ppsmc.h,v 1.2 2021/12/18 23:45:26 riastradh Exp $	*/
2
3/*
4 * Copyright 2017 Advanced Micro Devices, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 */
25
26#ifndef RAVEN_PP_SMC_H
27#define RAVEN_PP_SMC_H
28
29#pragma pack(push, 1)
30
31#define PPSMC_Result_OK                    0x1
32#define PPSMC_Result_Failed                0xFF
33#define PPSMC_Result_UnknownCmd            0xFE
34#define PPSMC_Result_CmdRejectedPrereq     0xFD
35#define PPSMC_Result_CmdRejectedBusy       0xFC
36
37#define PPSMC_MSG_TestMessage                   0x1
38#define PPSMC_MSG_GetSmuVersion                 0x2
39#define PPSMC_MSG_GetDriverIfVersion            0x3
40#define PPSMC_MSG_PowerUpGfx                    0x6
41#define PPSMC_MSG_EnableGfxOff                  0x7
42#define PPSMC_MSG_DisableGfxOff                 0x8
43#define PPSMC_MSG_PowerDownIspByTile            0x9
44#define PPSMC_MSG_PowerUpIspByTile              0xA
45#define PPSMC_MSG_PowerDownVcn                  0xB
46#define PPSMC_MSG_PowerUpVcn                    0xC
47#define PPSMC_MSG_PowerDownSdma                 0xD
48#define PPSMC_MSG_PowerUpSdma                   0xE
49#define PPSMC_MSG_SetHardMinIspclkByFreq        0xF
50#define PPSMC_MSG_SetHardMinVcn                 0x10
51#define PPSMC_MSG_SetMinDisplayClock            0x11
52#define PPSMC_MSG_SetHardMinFclkByFreq          0x12
53#define PPSMC_MSG_SetAllowFclkSwitch            0x13
54#define PPSMC_MSG_SetMinVideoGfxclkFreq         0x14
55#define PPSMC_MSG_ActiveProcessNotify           0x15
56#define PPSMC_MSG_SetCustomPolicy               0x16
57#define PPSMC_MSG_SetVideoFps                   0x17
58#define PPSMC_MSG_SetDisplayCount               0x18
59#define PPSMC_MSG_QueryPowerLimit               0x19
60#define PPSMC_MSG_SetDriverDramAddrHigh         0x1A
61#define PPSMC_MSG_SetDriverDramAddrLow          0x1B
62#define PPSMC_MSG_TransferTableSmu2Dram         0x1C
63#define PPSMC_MSG_TransferTableDram2Smu         0x1D
64#define PPSMC_MSG_DeviceDriverReset             0x1E
65#define PPSMC_MSG_SetGfxclkOverdriveByFreqVid   0x1F
66#define PPSMC_MSG_SetHardMinDcefclkByFreq       0x20
67#define PPSMC_MSG_SetHardMinSocclkByFreq        0x21
68#define PPSMC_MSG_SetMinVddcrSocVoltage         0x22
69#define PPSMC_MSG_SetMinVideoFclkFreq           0x23
70#define PPSMC_MSG_SetMinDeepSleepDcefclk        0x24
71#define PPSMC_MSG_ForcePowerDownGfx             0x25
72#define PPSMC_MSG_SetPhyclkVoltageByFreq        0x26
73#define PPSMC_MSG_SetDppclkVoltageByFreq        0x27
74#define PPSMC_MSG_SetSoftMinVcn                 0x28
75#define PPSMC_MSG_GetGfxclkFrequency            0x2A
76#define PPSMC_MSG_GetFclkFrequency              0x2B
77#define PPSMC_MSG_GetMinGfxclkFrequency         0x2C
78#define PPSMC_MSG_GetMaxGfxclkFrequency         0x2D
79#define PPSMC_MSG_SoftReset                     0x2E
80#define PPSMC_MSG_SetGfxCGPG			0x2F
81#define PPSMC_MSG_SetSoftMaxGfxClk              0x30
82#define PPSMC_MSG_SetHardMinGfxClk              0x31
83#define PPSMC_MSG_SetSoftMaxSocclkByFreq        0x32
84#define PPSMC_MSG_SetSoftMaxFclkByFreq          0x33
85#define PPSMC_MSG_SetSoftMaxVcn                 0x34
86#define PPSMC_MSG_PowerGateMmHub                0x35
87#define PPSMC_MSG_SetRccPfcPmeRestoreRegister   0x36
88#define PPSMC_Message_Count                     0x37
89
90typedef uint16_t PPSMC_Result;
91typedef int      PPSMC_Msg;
92
93
94#pragma pack(pop)
95
96#endif
97