1 /*
2  * Copyright 2020 Advanced Micro Devices, Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20  * OTHER DEALINGS IN THE SOFTWARE.
21  *
22  */
23 
24 #ifndef __SMU_V11_5_0_PMFW_H__
25 #define __SMU_V11_5_0_PMFW_H__
26 
27 #include "smu11_driver_if_vangogh.h"
28 
29 #pragma pack(push, 1)
30 
31 #define ENABLE_DEBUG_FEATURES
32 
33 // Feature Control Defines
34 #define FEATURE_CCLK_DPM_BIT           0
35 #define FEATURE_FAN_CONTROLLER_BIT     1
36 #define FEATURE_DATA_CALCULATION_BIT   2
37 #define FEATURE_PPT_BIT                3
38 #define FEATURE_TDC_BIT                4
39 #define FEATURE_THERMAL_BIT            5
40 #define FEATURE_FIT_BIT                6
41 #define FEATURE_EDC_BIT                7
42 #define FEATURE_PLL_POWER_DOWN_BIT     8
43 #define FEATURE_ULV_BIT                9
44 #define FEATURE_VDDOFF_BIT            10
45 #define FEATURE_VCN_DPM_BIT           11
46 #define FEATURE_CSTATE_BOOST_BIT      12
47 #define FEATURE_FCLK_DPM_BIT          13
48 #define FEATURE_SOCCLK_DPM_BIT        14
49 #define FEATURE_MP0CLK_DPM_BIT        15
50 #define FEATURE_LCLK_DPM_BIT          16
51 #define FEATURE_SHUBCLK_DPM_BIT       17
52 #define FEATURE_DCFCLK_DPM_BIT        18
53 #define FEATURE_GFX_DPM_BIT           19
54 #define FEATURE_DS_GFXCLK_BIT         20
55 #define FEATURE_DS_SOCCLK_BIT         21
56 #define FEATURE_DS_LCLK_BIT           22
57 #define FEATURE_DS_DCFCLK_BIT         23
58 #define FEATURE_DS_SHUBCLK_BIT        24
59 #define FEATURE_GFX_TEMP_VMIN_BIT     25
60 #define FEATURE_S0I2_BIT              26
61 #define FEATURE_WHISPER_MODE_BIT      27
62 #define FEATURE_DS_FCLK_BIT           28
63 #define FEATURE_DS_SMNCLK_BIT         29
64 #define FEATURE_DS_MP1CLK_BIT         30
65 #define FEATURE_DS_MP0CLK_BIT         31
66 #define FEATURE_SMU_LOW_POWER_BIT     32
67 #define FEATURE_FUSE_PG_BIT           33
68 #define FEATURE_GFX_DEM_BIT           34
69 #define FEATURE_PSI_BIT               35
70 #define FEATURE_PROCHOT_BIT           36
71 #define FEATURE_CPUOFF_BIT            37
72 #define FEATURE_STAPM_BIT             38
73 #define FEATURE_S0I3_BIT              39
74 #define FEATURE_DF_CSTATES_BIT        40
75 #define FEATURE_PERF_LIMIT_BIT        41
76 #define FEATURE_CORE_DLDO_BIT         42
77 #define FEATURE_RSMU_LOW_POWER_BIT    43
78 #define FEATURE_SMN_LOW_POWER_BIT     44
79 #define FEATURE_THM_LOW_POWER_BIT     45
80 #define FEATURE_SMUIO_LOW_POWER_BIT   46
81 #define FEATURE_MP1_LOW_POWER_BIT     47
82 #define FEATURE_DS_VCN_BIT            48
83 #define FEATURE_CPPC_BIT              49
84 #define FEATURE_OS_CSTATES_BIT        50
85 #define FEATURE_ISP_DPM_BIT           51
86 #define FEATURE_A55_DPM_BIT           52
87 #define FEATURE_CVIP_DSP_DPM_BIT      53
88 #define FEATURE_MSMU_LOW_POWER_BIT    54
89 #define FEATURE_SOC_VOLTAGE_MON_BIT   55
90 #define FEATURE_ATHUB_PG_BIT          56
91 #define FEATURE_ECO_DEEPCSTATE_BIT    57
92 #define FEATURE_CC6_BIT               58
93 #define FEATURE_GFX_EDC_BIT           59
94 #define NUM_FEATURES                  60
95 
96 typedef struct {
97   // MP1_EXT_SCRATCH0
98   uint32_t DpmHandlerID         : 8;
99   uint32_t ActivityMonitorID    : 8;
100   uint32_t DpmTimerID           : 8;
101   uint32_t DpmHubID             : 4;
102   uint32_t DpmHubTask           : 4;
103   // MP1_EXT_SCRATCH1
104   uint32_t GfxStatus            : 2;
105   uint32_t GfxoffStatus         : 8;
106   uint32_t CpuOff               : 1;
107   uint32_t VddOff               : 1;
108   uint32_t InUlv                : 1;
109   uint32_t InS0i2               : 2;
110   uint32_t InWhisperMode        : 1;
111   uint32_t spare1               : 16;
112   // MP1_EXT_SCRATCH2
113   uint32_t P2JobHandler			: 32;
114   // MP1_EXT_SCRATCH3: used for postcodes
115 
116   // MP1_EXT_SCRATCH4:6 are used by Kernel
117   // MP1_EXT_SCRATCH7: used by HW
118 } FwStatus_t;
119 
120 
121 #pragma pack(pop)
122 
123 #endif
124