xref: /linux/drivers/gpu/drm/amd/pm/powerplay/inc/smu75_discrete.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1*837d542aSEvan Quan /*
2*837d542aSEvan Quan  * Copyright 2017 Advanced Micro Devices, Inc.
3*837d542aSEvan Quan  *
4*837d542aSEvan Quan  * Permission is hereby granted, free of charge, to any person obtaining a
5*837d542aSEvan Quan  * copy of this software and associated documentation files (the "Software"),
6*837d542aSEvan Quan  * to deal in the Software without restriction, including without limitation
7*837d542aSEvan Quan  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*837d542aSEvan Quan  * and/or sell copies of the Software, and to permit persons to whom the
9*837d542aSEvan Quan  * Software is furnished to do so, subject to the following conditions:
10*837d542aSEvan Quan  *
11*837d542aSEvan Quan  * The above copyright notice and this permission notice shall be included in
12*837d542aSEvan Quan  * all copies or substantial portions of the Software.
13*837d542aSEvan Quan  *
14*837d542aSEvan Quan  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*837d542aSEvan Quan  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*837d542aSEvan Quan  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*837d542aSEvan Quan  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*837d542aSEvan Quan  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*837d542aSEvan Quan  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*837d542aSEvan Quan  * OTHER DEALINGS IN THE SOFTWARE.
21*837d542aSEvan Quan  *
22*837d542aSEvan Quan  */
23*837d542aSEvan Quan 
24*837d542aSEvan Quan #ifndef SMU75_DISCRETE_H
25*837d542aSEvan Quan #define SMU75_DISCRETE_H
26*837d542aSEvan Quan 
27*837d542aSEvan Quan #include "smu75.h"
28*837d542aSEvan Quan 
29*837d542aSEvan Quan #pragma pack(push, 1)
30*837d542aSEvan Quan 
31*837d542aSEvan Quan #define NUM_SCLK_RANGE 8
32*837d542aSEvan Quan 
33*837d542aSEvan Quan #define VCO_3_6 1
34*837d542aSEvan Quan #define VCO_2_4 3
35*837d542aSEvan Quan 
36*837d542aSEvan Quan #define POSTDIV_DIV_BY_1  0
37*837d542aSEvan Quan #define POSTDIV_DIV_BY_2  1
38*837d542aSEvan Quan #define POSTDIV_DIV_BY_4  2
39*837d542aSEvan Quan #define POSTDIV_DIV_BY_8  3
40*837d542aSEvan Quan #define POSTDIV_DIV_BY_16 4
41*837d542aSEvan Quan 
42*837d542aSEvan Quan struct sclkFcwRange_t {
43*837d542aSEvan Quan 	uint8_t  vco_setting; /* 1: 3-6GHz, 3: 2-4GHz */
44*837d542aSEvan Quan 	uint8_t  postdiv;     /* divide by 2^n */
45*837d542aSEvan Quan 	uint16_t fcw_pcc;
46*837d542aSEvan Quan 	uint16_t fcw_trans_upper;
47*837d542aSEvan Quan 	uint16_t fcw_trans_lower;
48*837d542aSEvan Quan };
49*837d542aSEvan Quan typedef struct sclkFcwRange_t sclkFcwRange_t;
50*837d542aSEvan Quan 
51*837d542aSEvan Quan struct SMIO_Pattern {
52*837d542aSEvan Quan 	uint16_t Voltage;
53*837d542aSEvan Quan 	uint8_t  Smio;
54*837d542aSEvan Quan 	uint8_t  padding;
55*837d542aSEvan Quan };
56*837d542aSEvan Quan 
57*837d542aSEvan Quan typedef struct SMIO_Pattern SMIO_Pattern;
58*837d542aSEvan Quan 
59*837d542aSEvan Quan struct SMIO_Table {
60*837d542aSEvan Quan 	SMIO_Pattern Pattern[SMU_MAX_SMIO_LEVELS];
61*837d542aSEvan Quan };
62*837d542aSEvan Quan 
63*837d542aSEvan Quan typedef struct SMIO_Table SMIO_Table;
64*837d542aSEvan Quan 
65*837d542aSEvan Quan struct SMU_SclkSetting {
66*837d542aSEvan Quan 	uint32_t    SclkFrequency;
67*837d542aSEvan Quan 	uint16_t    Fcw_int;
68*837d542aSEvan Quan 	uint16_t    Fcw_frac;
69*837d542aSEvan Quan 	uint16_t    Pcc_fcw_int;
70*837d542aSEvan Quan 	uint8_t     PllRange;
71*837d542aSEvan Quan 	uint8_t     SSc_En;
72*837d542aSEvan Quan 	uint16_t    Sclk_slew_rate;
73*837d542aSEvan Quan 	uint16_t    Pcc_up_slew_rate;
74*837d542aSEvan Quan 	uint16_t    Pcc_down_slew_rate;
75*837d542aSEvan Quan 	uint16_t    Fcw1_int;
76*837d542aSEvan Quan 	uint16_t    Fcw1_frac;
77*837d542aSEvan Quan 	uint16_t    Sclk_ss_slew_rate;
78*837d542aSEvan Quan };
79*837d542aSEvan Quan typedef struct SMU_SclkSetting SMU_SclkSetting;
80*837d542aSEvan Quan 
81*837d542aSEvan Quan struct SMU75_Discrete_GraphicsLevel {
82*837d542aSEvan Quan 	SMU_VoltageLevel MinVoltage;
83*837d542aSEvan Quan 
84*837d542aSEvan Quan 	uint8_t     pcieDpmLevel;
85*837d542aSEvan Quan 	uint8_t     DeepSleepDivId;
86*837d542aSEvan Quan 	uint16_t    ActivityLevel;
87*837d542aSEvan Quan 
88*837d542aSEvan Quan 	uint32_t    CgSpllFuncCntl3;
89*837d542aSEvan Quan 	uint32_t    CgSpllFuncCntl4;
90*837d542aSEvan Quan 	uint32_t    CcPwrDynRm;
91*837d542aSEvan Quan 	uint32_t    CcPwrDynRm1;
92*837d542aSEvan Quan 
93*837d542aSEvan Quan 	uint8_t     SclkDid;
94*837d542aSEvan Quan 	uint8_t     padding;
95*837d542aSEvan Quan 	uint8_t     EnabledForActivity;
96*837d542aSEvan Quan 	uint8_t     EnabledForThrottle;
97*837d542aSEvan Quan 	uint8_t     UpHyst;
98*837d542aSEvan Quan 	uint8_t     DownHyst;
99*837d542aSEvan Quan 	uint8_t     VoltageDownHyst;
100*837d542aSEvan Quan 	uint8_t     PowerThrottle;
101*837d542aSEvan Quan 
102*837d542aSEvan Quan 	SMU_SclkSetting SclkSetting;
103*837d542aSEvan Quan 
104*837d542aSEvan Quan 	uint8_t  ScksStretchThreshVid[NUM_SCKS_STATE_TYPES];
105*837d542aSEvan Quan 	uint16_t Padding;
106*837d542aSEvan Quan };
107*837d542aSEvan Quan 
108*837d542aSEvan Quan typedef struct SMU75_Discrete_GraphicsLevel SMU75_Discrete_GraphicsLevel;
109*837d542aSEvan Quan 
110*837d542aSEvan Quan struct SMU75_Discrete_ACPILevel {
111*837d542aSEvan Quan 	uint32_t    Flags;
112*837d542aSEvan Quan 	SMU_VoltageLevel MinVoltage;
113*837d542aSEvan Quan 	uint32_t    SclkFrequency;
114*837d542aSEvan Quan 	uint8_t     SclkDid;
115*837d542aSEvan Quan 	uint8_t     DisplayWatermark;
116*837d542aSEvan Quan 	uint8_t     DeepSleepDivId;
117*837d542aSEvan Quan 	uint8_t     padding;
118*837d542aSEvan Quan 	uint32_t    CcPwrDynRm;
119*837d542aSEvan Quan 	uint32_t    CcPwrDynRm1;
120*837d542aSEvan Quan 
121*837d542aSEvan Quan 	SMU_SclkSetting SclkSetting;
122*837d542aSEvan Quan };
123*837d542aSEvan Quan 
124*837d542aSEvan Quan typedef struct SMU75_Discrete_ACPILevel SMU75_Discrete_ACPILevel;
125*837d542aSEvan Quan 
126*837d542aSEvan Quan struct SMU75_Discrete_Ulv {
127*837d542aSEvan Quan 	uint32_t    CcPwrDynRm;
128*837d542aSEvan Quan 	uint32_t    CcPwrDynRm1;
129*837d542aSEvan Quan 	uint16_t    VddcOffset;
130*837d542aSEvan Quan 	uint8_t     VddcOffsetVid;
131*837d542aSEvan Quan 	uint8_t     VddcPhase;
132*837d542aSEvan Quan 	uint16_t    BifSclkDfs;
133*837d542aSEvan Quan 	uint16_t    Reserved;
134*837d542aSEvan Quan };
135*837d542aSEvan Quan 
136*837d542aSEvan Quan typedef struct SMU75_Discrete_Ulv SMU75_Discrete_Ulv;
137*837d542aSEvan Quan 
138*837d542aSEvan Quan struct SMU75_Discrete_MemoryLevel {
139*837d542aSEvan Quan 	SMU_VoltageLevel MinVoltage;
140*837d542aSEvan Quan 	uint32_t    MinMvdd;
141*837d542aSEvan Quan 
142*837d542aSEvan Quan 	uint32_t    MclkFrequency;
143*837d542aSEvan Quan 
144*837d542aSEvan Quan 	uint8_t     StutterEnable;
145*837d542aSEvan Quan 	uint8_t     EnabledForThrottle;
146*837d542aSEvan Quan 	uint8_t     EnabledForActivity;
147*837d542aSEvan Quan 	uint8_t     padding_0;
148*837d542aSEvan Quan 
149*837d542aSEvan Quan 	uint8_t     UpHyst;
150*837d542aSEvan Quan 	uint8_t     DownHyst;
151*837d542aSEvan Quan 	uint8_t     VoltageDownHyst;
152*837d542aSEvan Quan 	uint8_t     padding_1;
153*837d542aSEvan Quan 
154*837d542aSEvan Quan 	uint16_t    ActivityLevel;
155*837d542aSEvan Quan 	uint8_t     DisplayWatermark;
156*837d542aSEvan Quan 	uint8_t     padding_2;
157*837d542aSEvan Quan 
158*837d542aSEvan Quan 	uint16_t    Fcw_int;
159*837d542aSEvan Quan 	uint16_t    Fcw_frac;
160*837d542aSEvan Quan 	uint8_t     Postdiv;
161*837d542aSEvan Quan 	uint8_t     padding_3[3];
162*837d542aSEvan Quan };
163*837d542aSEvan Quan 
164*837d542aSEvan Quan typedef struct SMU75_Discrete_MemoryLevel SMU75_Discrete_MemoryLevel;
165*837d542aSEvan Quan 
166*837d542aSEvan Quan struct SMU75_Discrete_LinkLevel {
167*837d542aSEvan Quan 	uint8_t     PcieGenSpeed;
168*837d542aSEvan Quan 	uint8_t     PcieLaneCount;
169*837d542aSEvan Quan 	uint8_t     EnabledForActivity;
170*837d542aSEvan Quan 	uint8_t     SPC;
171*837d542aSEvan Quan 	uint32_t    DownThreshold;
172*837d542aSEvan Quan 	uint32_t    UpThreshold;
173*837d542aSEvan Quan 	uint16_t    BifSclkDfs;
174*837d542aSEvan Quan 	uint16_t    Reserved;
175*837d542aSEvan Quan };
176*837d542aSEvan Quan 
177*837d542aSEvan Quan typedef struct SMU75_Discrete_LinkLevel SMU75_Discrete_LinkLevel;
178*837d542aSEvan Quan 
179*837d542aSEvan Quan 
180*837d542aSEvan Quan /* MC ARB DRAM Timing registers. */
181*837d542aSEvan Quan struct SMU75_Discrete_MCArbDramTimingTableEntry {
182*837d542aSEvan Quan 	uint32_t McArbDramTiming;
183*837d542aSEvan Quan 	uint32_t McArbDramTiming2;
184*837d542aSEvan Quan 	uint32_t McArbBurstTime;
185*837d542aSEvan Quan 	uint32_t McArbRfshRate;
186*837d542aSEvan Quan 	uint32_t McArbMisc3;
187*837d542aSEvan Quan };
188*837d542aSEvan Quan 
189*837d542aSEvan Quan typedef struct SMU75_Discrete_MCArbDramTimingTableEntry SMU75_Discrete_MCArbDramTimingTableEntry;
190*837d542aSEvan Quan 
191*837d542aSEvan Quan struct SMU75_Discrete_MCArbDramTimingTable {
192*837d542aSEvan Quan 	SMU75_Discrete_MCArbDramTimingTableEntry entries[SMU__NUM_SCLK_DPM_STATE][SMU__NUM_MCLK_DPM_LEVELS];
193*837d542aSEvan Quan };
194*837d542aSEvan Quan 
195*837d542aSEvan Quan typedef struct SMU75_Discrete_MCArbDramTimingTable SMU75_Discrete_MCArbDramTimingTable;
196*837d542aSEvan Quan 
197*837d542aSEvan Quan /* UVD VCLK/DCLK state (level) definition. */
198*837d542aSEvan Quan struct SMU75_Discrete_UvdLevel {
199*837d542aSEvan Quan 	uint32_t VclkFrequency;
200*837d542aSEvan Quan 	uint32_t DclkFrequency;
201*837d542aSEvan Quan 	SMU_VoltageLevel MinVoltage;
202*837d542aSEvan Quan 	uint8_t  VclkDivider;
203*837d542aSEvan Quan 	uint8_t  DclkDivider;
204*837d542aSEvan Quan 	uint8_t  padding[2];
205*837d542aSEvan Quan };
206*837d542aSEvan Quan 
207*837d542aSEvan Quan typedef struct SMU75_Discrete_UvdLevel SMU75_Discrete_UvdLevel;
208*837d542aSEvan Quan 
209*837d542aSEvan Quan /* Clocks for other external blocks (VCE, ACP, SAMU). */
210*837d542aSEvan Quan struct SMU75_Discrete_ExtClkLevel {
211*837d542aSEvan Quan 	uint32_t Frequency;
212*837d542aSEvan Quan 	SMU_VoltageLevel MinVoltage;
213*837d542aSEvan Quan 	uint8_t  Divider;
214*837d542aSEvan Quan 	uint8_t  padding[3];
215*837d542aSEvan Quan };
216*837d542aSEvan Quan 
217*837d542aSEvan Quan typedef struct SMU75_Discrete_ExtClkLevel SMU75_Discrete_ExtClkLevel;
218*837d542aSEvan Quan 
219*837d542aSEvan Quan struct SMU75_Discrete_StateInfo {
220*837d542aSEvan Quan 	uint32_t SclkFrequency;
221*837d542aSEvan Quan 	uint32_t MclkFrequency;
222*837d542aSEvan Quan 	uint32_t VclkFrequency;
223*837d542aSEvan Quan 	uint32_t DclkFrequency;
224*837d542aSEvan Quan 	uint32_t SamclkFrequency;
225*837d542aSEvan Quan 	uint32_t AclkFrequency;
226*837d542aSEvan Quan 	uint32_t EclkFrequency;
227*837d542aSEvan Quan 	uint16_t MvddVoltage;
228*837d542aSEvan Quan 	uint16_t padding16;
229*837d542aSEvan Quan 	uint8_t  DisplayWatermark;
230*837d542aSEvan Quan 	uint8_t  McArbIndex;
231*837d542aSEvan Quan 	uint8_t  McRegIndex;
232*837d542aSEvan Quan 	uint8_t  SeqIndex;
233*837d542aSEvan Quan 	uint8_t  SclkDid;
234*837d542aSEvan Quan 	int8_t   SclkIndex;
235*837d542aSEvan Quan 	int8_t   MclkIndex;
236*837d542aSEvan Quan 	uint8_t  PCIeGen;
237*837d542aSEvan Quan };
238*837d542aSEvan Quan 
239*837d542aSEvan Quan typedef struct SMU75_Discrete_StateInfo SMU75_Discrete_StateInfo;
240*837d542aSEvan Quan 
241*837d542aSEvan Quan struct SMU75_Discrete_DpmTable {
242*837d542aSEvan Quan 	SMU75_PIDController                  GraphicsPIDController;
243*837d542aSEvan Quan 	SMU75_PIDController                  MemoryPIDController;
244*837d542aSEvan Quan 	SMU75_PIDController                  LinkPIDController;
245*837d542aSEvan Quan 
246*837d542aSEvan Quan 	uint32_t                            SystemFlags;
247*837d542aSEvan Quan 
248*837d542aSEvan Quan 	uint32_t                            VRConfig;
249*837d542aSEvan Quan 	uint32_t                            SmioMask1;
250*837d542aSEvan Quan 	uint32_t                            SmioMask2;
251*837d542aSEvan Quan 	SMIO_Table                          SmioTable1;
252*837d542aSEvan Quan 	SMIO_Table                          SmioTable2;
253*837d542aSEvan Quan 
254*837d542aSEvan Quan 	uint32_t                            MvddLevelCount;
255*837d542aSEvan Quan 
256*837d542aSEvan Quan 	uint8_t                             BapmVddcVidHiSidd        [SMU75_MAX_LEVELS_VDDC];
257*837d542aSEvan Quan 	uint8_t                             BapmVddcVidLoSidd        [SMU75_MAX_LEVELS_VDDC];
258*837d542aSEvan Quan 	uint8_t                             BapmVddcVidHiSidd2       [SMU75_MAX_LEVELS_VDDC];
259*837d542aSEvan Quan 
260*837d542aSEvan Quan 	uint8_t                             GraphicsDpmLevelCount;
261*837d542aSEvan Quan 	uint8_t                             MemoryDpmLevelCount;
262*837d542aSEvan Quan 	uint8_t                             LinkLevelCount;
263*837d542aSEvan Quan 	uint8_t                             MasterDeepSleepControl;
264*837d542aSEvan Quan 
265*837d542aSEvan Quan 	uint8_t                             UvdLevelCount;
266*837d542aSEvan Quan 	uint8_t                             VceLevelCount;
267*837d542aSEvan Quan 	uint8_t                             AcpLevelCount;
268*837d542aSEvan Quan 	uint8_t                             SamuLevelCount;
269*837d542aSEvan Quan 
270*837d542aSEvan Quan 	uint8_t                             ThermOutGpio;
271*837d542aSEvan Quan 	uint8_t                             ThermOutPolarity;
272*837d542aSEvan Quan 	uint8_t                             ThermOutMode;
273*837d542aSEvan Quan 	uint8_t                             BootPhases;
274*837d542aSEvan Quan 
275*837d542aSEvan Quan 	uint8_t                             VRHotLevel;
276*837d542aSEvan Quan 	uint8_t                             LdoRefSel;
277*837d542aSEvan Quan 
278*837d542aSEvan Quan 	uint8_t                             Reserved1[2];
279*837d542aSEvan Quan 
280*837d542aSEvan Quan 	uint16_t                            FanStartTemperature;
281*837d542aSEvan Quan 	uint16_t                            FanStopTemperature;
282*837d542aSEvan Quan 
283*837d542aSEvan Quan 	uint16_t                            MaxVoltage;
284*837d542aSEvan Quan 	uint16_t                            Reserved2;
285*837d542aSEvan Quan 	uint32_t                            Reserved;
286*837d542aSEvan Quan 
287*837d542aSEvan Quan 	SMU75_Discrete_GraphicsLevel        GraphicsLevel           [SMU75_MAX_LEVELS_GRAPHICS];
288*837d542aSEvan Quan 	SMU75_Discrete_MemoryLevel          MemoryACPILevel;
289*837d542aSEvan Quan 	SMU75_Discrete_MemoryLevel          MemoryLevel             [SMU75_MAX_LEVELS_MEMORY];
290*837d542aSEvan Quan 	SMU75_Discrete_LinkLevel            LinkLevel               [SMU75_MAX_LEVELS_LINK];
291*837d542aSEvan Quan 	SMU75_Discrete_ACPILevel            ACPILevel;
292*837d542aSEvan Quan 	SMU75_Discrete_UvdLevel             UvdLevel                [SMU75_MAX_LEVELS_UVD];
293*837d542aSEvan Quan 	SMU75_Discrete_ExtClkLevel          VceLevel                [SMU75_MAX_LEVELS_VCE];
294*837d542aSEvan Quan 	SMU75_Discrete_ExtClkLevel          AcpLevel                [SMU75_MAX_LEVELS_ACP];
295*837d542aSEvan Quan 	SMU75_Discrete_ExtClkLevel          SamuLevel               [SMU75_MAX_LEVELS_SAMU];
296*837d542aSEvan Quan 	SMU75_Discrete_Ulv                  Ulv;
297*837d542aSEvan Quan 
298*837d542aSEvan Quan 	uint8_t                             DisplayWatermark        [SMU75_MAX_LEVELS_MEMORY][SMU75_MAX_LEVELS_GRAPHICS];
299*837d542aSEvan Quan 
300*837d542aSEvan Quan 	uint32_t                            SclkStepSize;
301*837d542aSEvan Quan 	uint32_t                            Smio                    [SMU75_MAX_ENTRIES_SMIO];
302*837d542aSEvan Quan 
303*837d542aSEvan Quan 	uint8_t                             UvdBootLevel;
304*837d542aSEvan Quan 	uint8_t                             VceBootLevel;
305*837d542aSEvan Quan 	uint8_t                             AcpBootLevel;
306*837d542aSEvan Quan 	uint8_t                             SamuBootLevel;
307*837d542aSEvan Quan 
308*837d542aSEvan Quan 	uint8_t                             GraphicsBootLevel;
309*837d542aSEvan Quan 	uint8_t                             GraphicsVoltageChangeEnable;
310*837d542aSEvan Quan 	uint8_t                             GraphicsThermThrottleEnable;
311*837d542aSEvan Quan 	uint8_t                             GraphicsInterval;
312*837d542aSEvan Quan 
313*837d542aSEvan Quan 	uint8_t                             VoltageInterval;
314*837d542aSEvan Quan 	uint8_t                             ThermalInterval;
315*837d542aSEvan Quan 	uint16_t                            TemperatureLimitHigh;
316*837d542aSEvan Quan 
317*837d542aSEvan Quan 	uint16_t                            TemperatureLimitLow;
318*837d542aSEvan Quan 	uint8_t                             MemoryBootLevel;
319*837d542aSEvan Quan 	uint8_t                             MemoryVoltageChangeEnable;
320*837d542aSEvan Quan 
321*837d542aSEvan Quan 	uint16_t                            BootMVdd;
322*837d542aSEvan Quan 	uint8_t                             MemoryInterval;
323*837d542aSEvan Quan 	uint8_t                             MemoryThermThrottleEnable;
324*837d542aSEvan Quan 
325*837d542aSEvan Quan 	uint16_t                            VoltageResponseTime;
326*837d542aSEvan Quan 	uint16_t                            PhaseResponseTime;
327*837d542aSEvan Quan 
328*837d542aSEvan Quan 	uint8_t                             PCIeBootLinkLevel;
329*837d542aSEvan Quan 	uint8_t                             PCIeGenInterval;
330*837d542aSEvan Quan 	uint8_t                             DTEInterval;
331*837d542aSEvan Quan 	uint8_t                             DTEMode;
332*837d542aSEvan Quan 
333*837d542aSEvan Quan 	uint8_t                             SVI2Enable;
334*837d542aSEvan Quan 	uint8_t                             VRHotGpio;
335*837d542aSEvan Quan 	uint8_t                             AcDcGpio;
336*837d542aSEvan Quan 	uint8_t                             ThermGpio;
337*837d542aSEvan Quan 
338*837d542aSEvan Quan 	uint16_t                            PPM_PkgPwrLimit;
339*837d542aSEvan Quan 	uint16_t                            PPM_TemperatureLimit;
340*837d542aSEvan Quan 
341*837d542aSEvan Quan 	uint16_t                            DefaultTdp;
342*837d542aSEvan Quan 	uint16_t                            TargetTdp;
343*837d542aSEvan Quan 
344*837d542aSEvan Quan 	uint16_t                            FpsHighThreshold;
345*837d542aSEvan Quan 	uint16_t                            FpsLowThreshold;
346*837d542aSEvan Quan 
347*837d542aSEvan Quan 	uint16_t                            BAPMTI_R  [SMU75_DTE_ITERATIONS][SMU75_DTE_SOURCES][SMU75_DTE_SINKS];
348*837d542aSEvan Quan 	uint16_t                            BAPMTI_RC [SMU75_DTE_ITERATIONS][SMU75_DTE_SOURCES][SMU75_DTE_SINKS];
349*837d542aSEvan Quan 
350*837d542aSEvan Quan 	uint16_t                            TemperatureLimitEdge;
351*837d542aSEvan Quan 	uint16_t                            TemperatureLimitHotspot;
352*837d542aSEvan Quan 
353*837d542aSEvan Quan 	uint16_t                            BootVddc;
354*837d542aSEvan Quan 	uint16_t                            BootVddci;
355*837d542aSEvan Quan 
356*837d542aSEvan Quan 	uint16_t                            FanGainEdge;
357*837d542aSEvan Quan 	uint16_t                            FanGainHotspot;
358*837d542aSEvan Quan 
359*837d542aSEvan Quan 	uint32_t                            LowSclkInterruptThreshold;
360*837d542aSEvan Quan 	uint32_t                            VddGfxReChkWait;
361*837d542aSEvan Quan 
362*837d542aSEvan Quan 	uint8_t                             ClockStretcherAmount;
363*837d542aSEvan Quan 	uint8_t                             Sclk_CKS_masterEn0_7;
364*837d542aSEvan Quan 	uint8_t                             Sclk_CKS_masterEn8_15;
365*837d542aSEvan Quan 	uint8_t                             DPMFreezeAndForced;
366*837d542aSEvan Quan 
367*837d542aSEvan Quan 	uint8_t                             Sclk_voltageOffset[8];
368*837d542aSEvan Quan 
369*837d542aSEvan Quan 	SMU_ClockStretcherDataTable         ClockStretcherDataTable;
370*837d542aSEvan Quan 	SMU_CKS_LOOKUPTable                 CKS_LOOKUPTable;
371*837d542aSEvan Quan 
372*837d542aSEvan Quan 	uint32_t                            CurrSclkPllRange;
373*837d542aSEvan Quan 	sclkFcwRange_t                      SclkFcwRangeTable[NUM_SCLK_RANGE];
374*837d542aSEvan Quan 
375*837d542aSEvan Quan 	GB_VDROOP_TABLE_t                   BTCGB_VDROOP_TABLE[BTCGB_VDROOP_TABLE_MAX_ENTRIES];
376*837d542aSEvan Quan 	SMU_QuadraticCoeffs                 AVFSGB_FUSE_TABLE[AVFSGB_VDROOP_TABLE_MAX_ENTRIES];
377*837d542aSEvan Quan };
378*837d542aSEvan Quan 
379*837d542aSEvan Quan typedef struct SMU75_Discrete_DpmTable SMU75_Discrete_DpmTable;
380*837d542aSEvan Quan 
381*837d542aSEvan Quan struct SMU75_Discrete_FanTable {
382*837d542aSEvan Quan 	uint16_t FdoMode;
383*837d542aSEvan Quan 	int16_t  TempMin;
384*837d542aSEvan Quan 	int16_t  TempMed;
385*837d542aSEvan Quan 	int16_t  TempMax;
386*837d542aSEvan Quan 	int16_t  Slope1;
387*837d542aSEvan Quan 	int16_t  Slope2;
388*837d542aSEvan Quan 	int16_t  FdoMin;
389*837d542aSEvan Quan 	int16_t  HystUp;
390*837d542aSEvan Quan 	int16_t  HystDown;
391*837d542aSEvan Quan 	int16_t  HystSlope;
392*837d542aSEvan Quan 	int16_t  TempRespLim;
393*837d542aSEvan Quan 	int16_t  TempCurr;
394*837d542aSEvan Quan 	int16_t  SlopeCurr;
395*837d542aSEvan Quan 	int16_t  PwmCurr;
396*837d542aSEvan Quan 	uint32_t RefreshPeriod;
397*837d542aSEvan Quan 	int16_t  FdoMax;
398*837d542aSEvan Quan 	uint8_t  TempSrc;
399*837d542aSEvan Quan 	int8_t   Padding;
400*837d542aSEvan Quan };
401*837d542aSEvan Quan 
402*837d542aSEvan Quan typedef struct SMU75_Discrete_FanTable SMU75_Discrete_FanTable;
403*837d542aSEvan Quan 
404*837d542aSEvan Quan #define SMU7_DISCRETE_GPIO_SCLK_DEBUG             4
405*837d542aSEvan Quan #define SMU7_DISCRETE_GPIO_SCLK_DEBUG_BIT         (0x1 << SMU7_DISCRETE_GPIO_SCLK_DEBUG)
406*837d542aSEvan Quan 
407*837d542aSEvan Quan 
408*837d542aSEvan Quan 
409*837d542aSEvan Quan struct SMU7_MclkDpmScoreboard {
410*837d542aSEvan Quan 	uint32_t PercentageBusy;
411*837d542aSEvan Quan 
412*837d542aSEvan Quan 	int32_t  PIDError;
413*837d542aSEvan Quan 	int32_t  PIDIntegral;
414*837d542aSEvan Quan 	int32_t  PIDOutput;
415*837d542aSEvan Quan 
416*837d542aSEvan Quan 	uint32_t SigmaDeltaAccum;
417*837d542aSEvan Quan 	uint32_t SigmaDeltaOutput;
418*837d542aSEvan Quan 	uint32_t SigmaDeltaLevel;
419*837d542aSEvan Quan 
420*837d542aSEvan Quan 	uint32_t UtilizationSetpoint;
421*837d542aSEvan Quan 
422*837d542aSEvan Quan 	uint8_t  TdpClampMode;
423*837d542aSEvan Quan 	uint8_t  TdcClampMode;
424*837d542aSEvan Quan 	uint8_t  ThermClampMode;
425*837d542aSEvan Quan 	uint8_t  VoltageBusy;
426*837d542aSEvan Quan 
427*837d542aSEvan Quan 	int8_t   CurrLevel;
428*837d542aSEvan Quan 	int8_t   TargLevel;
429*837d542aSEvan Quan 	uint8_t  LevelChangeInProgress;
430*837d542aSEvan Quan 	uint8_t  UpHyst;
431*837d542aSEvan Quan 
432*837d542aSEvan Quan 	uint8_t  DownHyst;
433*837d542aSEvan Quan 	uint8_t  VoltageDownHyst;
434*837d542aSEvan Quan 	uint8_t  DpmEnable;
435*837d542aSEvan Quan 	uint8_t  DpmRunning;
436*837d542aSEvan Quan 
437*837d542aSEvan Quan 	uint8_t  DpmForce;
438*837d542aSEvan Quan 	uint8_t  DpmForceLevel;
439*837d542aSEvan Quan 	uint8_t  padding2;
440*837d542aSEvan Quan 	uint8_t  McArbIndex;
441*837d542aSEvan Quan 
442*837d542aSEvan Quan 	uint32_t MinimumPerfMclk;
443*837d542aSEvan Quan 
444*837d542aSEvan Quan 	uint8_t  AcpiReq;
445*837d542aSEvan Quan 	uint8_t  AcpiAck;
446*837d542aSEvan Quan 	uint8_t  MclkSwitchInProgress;
447*837d542aSEvan Quan 	uint8_t  MclkSwitchCritical;
448*837d542aSEvan Quan 
449*837d542aSEvan Quan 	uint8_t  IgnoreVBlank;
450*837d542aSEvan Quan 	uint8_t  TargetMclkIndex;
451*837d542aSEvan Quan 	uint8_t  TargetMvddIndex;
452*837d542aSEvan Quan 	uint8_t  MclkSwitchResult;
453*837d542aSEvan Quan 
454*837d542aSEvan Quan 	uint16_t VbiFailureCount;
455*837d542aSEvan Quan 	uint8_t  VbiWaitCounter;
456*837d542aSEvan Quan 	uint8_t  EnabledLevelsChange;
457*837d542aSEvan Quan 
458*837d542aSEvan Quan 	uint16_t LevelResidencyCounters [SMU75_MAX_LEVELS_MEMORY];
459*837d542aSEvan Quan 	uint16_t LevelSwitchCounters [SMU75_MAX_LEVELS_MEMORY];
460*837d542aSEvan Quan 
461*837d542aSEvan Quan 	void     (*TargetStateCalculator)(uint8_t);
462*837d542aSEvan Quan 	void     (*SavedTargetStateCalculator)(uint8_t);
463*837d542aSEvan Quan 
464*837d542aSEvan Quan 	uint16_t AutoDpmInterval;
465*837d542aSEvan Quan 	uint16_t AutoDpmRange;
466*837d542aSEvan Quan 
467*837d542aSEvan Quan 	uint16_t VbiTimeoutCount;
468*837d542aSEvan Quan 	uint16_t MclkSwitchingTime;
469*837d542aSEvan Quan 
470*837d542aSEvan Quan 	uint8_t  fastSwitch;
471*837d542aSEvan Quan 	uint8_t  Save_PIC_VDDGFX_EXIT;
472*837d542aSEvan Quan 	uint8_t  Save_PIC_VDDGFX_ENTER;
473*837d542aSEvan Quan 	uint8_t  VbiTimeout;
474*837d542aSEvan Quan 
475*837d542aSEvan Quan 	uint32_t HbmTempRegBackup;
476*837d542aSEvan Quan };
477*837d542aSEvan Quan 
478*837d542aSEvan Quan typedef struct SMU7_MclkDpmScoreboard SMU7_MclkDpmScoreboard;
479*837d542aSEvan Quan 
480*837d542aSEvan Quan struct SMU7_UlvScoreboard {
481*837d542aSEvan Quan 	uint8_t     EnterUlv;
482*837d542aSEvan Quan 	uint8_t     ExitUlv;
483*837d542aSEvan Quan 	uint8_t     UlvActive;
484*837d542aSEvan Quan 	uint8_t     WaitingForUlv;
485*837d542aSEvan Quan 	uint8_t     UlvEnable;
486*837d542aSEvan Quan 	uint8_t     UlvRunning;
487*837d542aSEvan Quan 	uint8_t     UlvMasterEnable;
488*837d542aSEvan Quan 	uint8_t     padding;
489*837d542aSEvan Quan 	uint32_t    UlvAbortedCount;
490*837d542aSEvan Quan 	uint32_t    UlvTimeStamp;
491*837d542aSEvan Quan };
492*837d542aSEvan Quan 
493*837d542aSEvan Quan typedef struct SMU7_UlvScoreboard SMU7_UlvScoreboard;
494*837d542aSEvan Quan 
495*837d542aSEvan Quan struct VddgfxSavedRegisters {
496*837d542aSEvan Quan 	uint32_t GPU_DBG[3];
497*837d542aSEvan Quan 	uint32_t MEC_BaseAddress_Hi;
498*837d542aSEvan Quan 	uint32_t MEC_BaseAddress_Lo;
499*837d542aSEvan Quan 	uint32_t THM_TMON0_CTRL2__RDIR_PRESENT;
500*837d542aSEvan Quan 	uint32_t THM_TMON1_CTRL2__RDIR_PRESENT;
501*837d542aSEvan Quan 	uint32_t CP_INT_CNTL;
502*837d542aSEvan Quan };
503*837d542aSEvan Quan 
504*837d542aSEvan Quan typedef struct VddgfxSavedRegisters VddgfxSavedRegisters;
505*837d542aSEvan Quan 
506*837d542aSEvan Quan struct SMU7_VddGfxScoreboard {
507*837d542aSEvan Quan 	uint8_t     VddGfxEnable;
508*837d542aSEvan Quan 	uint8_t     VddGfxActive;
509*837d542aSEvan Quan 	uint8_t     VPUResetOccured;
510*837d542aSEvan Quan 	uint8_t     padding;
511*837d542aSEvan Quan 
512*837d542aSEvan Quan 	uint32_t    VddGfxEnteredCount;
513*837d542aSEvan Quan 	uint32_t    VddGfxAbortedCount;
514*837d542aSEvan Quan 
515*837d542aSEvan Quan 	uint32_t    VddGfxVid;
516*837d542aSEvan Quan 
517*837d542aSEvan Quan 	VddgfxSavedRegisters SavedRegisters;
518*837d542aSEvan Quan };
519*837d542aSEvan Quan 
520*837d542aSEvan Quan typedef struct SMU7_VddGfxScoreboard SMU7_VddGfxScoreboard;
521*837d542aSEvan Quan 
522*837d542aSEvan Quan struct SMU7_TdcLimitScoreboard {
523*837d542aSEvan Quan 	uint8_t  Enable;
524*837d542aSEvan Quan 	uint8_t  Running;
525*837d542aSEvan Quan 	uint16_t Alpha;
526*837d542aSEvan Quan 	uint32_t FilteredIddc;
527*837d542aSEvan Quan 	uint32_t IddcLimit;
528*837d542aSEvan Quan 	uint32_t IddcHyst;
529*837d542aSEvan Quan 	SMU7_HystController_Data HystControllerData;
530*837d542aSEvan Quan };
531*837d542aSEvan Quan 
532*837d542aSEvan Quan typedef struct SMU7_TdcLimitScoreboard SMU7_TdcLimitScoreboard;
533*837d542aSEvan Quan 
534*837d542aSEvan Quan struct SMU7_PkgPwrLimitScoreboard {
535*837d542aSEvan Quan 	uint8_t  Enable;
536*837d542aSEvan Quan 	uint8_t  Running;
537*837d542aSEvan Quan 	uint16_t Alpha;
538*837d542aSEvan Quan 	uint32_t FilteredPkgPwr;
539*837d542aSEvan Quan 	uint32_t Limit;
540*837d542aSEvan Quan 	uint32_t Hyst;
541*837d542aSEvan Quan 	uint32_t LimitFromDriver;
542*837d542aSEvan Quan 	uint8_t PowerSharingEnabled;
543*837d542aSEvan Quan 	uint8_t PowerSharingCounter;
544*837d542aSEvan Quan 	uint8_t PowerSharingINTEnabled;
545*837d542aSEvan Quan 	uint8_t GFXActivityCounterEnabled;
546*837d542aSEvan Quan 	uint32_t EnergyCount;
547*837d542aSEvan Quan 	uint32_t PSACTCount;
548*837d542aSEvan Quan 	uint8_t RollOverRequired;
549*837d542aSEvan Quan 	uint8_t RollOverCount;
550*837d542aSEvan Quan 	uint8_t padding[2];
551*837d542aSEvan Quan 	SMU7_HystController_Data HystControllerData;
552*837d542aSEvan Quan };
553*837d542aSEvan Quan 
554*837d542aSEvan Quan typedef struct SMU7_PkgPwrLimitScoreboard SMU7_PkgPwrLimitScoreboard;
555*837d542aSEvan Quan 
556*837d542aSEvan Quan struct SMU7_BapmScoreboard {
557*837d542aSEvan Quan 	uint32_t source_powers[SMU75_DTE_SOURCES];
558*837d542aSEvan Quan 	uint32_t source_powers_last[SMU75_DTE_SOURCES];
559*837d542aSEvan Quan 	int32_t entity_temperatures[SMU75_NUM_GPU_TES];
560*837d542aSEvan Quan 	int32_t initial_entity_temperatures[SMU75_NUM_GPU_TES];
561*837d542aSEvan Quan 	int32_t Limit;
562*837d542aSEvan Quan 	int32_t Hyst;
563*837d542aSEvan Quan 	int32_t therm_influence_coeff_table[SMU75_DTE_ITERATIONS * SMU75_DTE_SOURCES * SMU75_DTE_SINKS * 2];
564*837d542aSEvan Quan 	int32_t therm_node_table[SMU75_DTE_ITERATIONS * SMU75_DTE_SOURCES * SMU75_DTE_SINKS];
565*837d542aSEvan Quan 	uint16_t ConfigTDPPowerScalar;
566*837d542aSEvan Quan 	uint16_t FanSpeedPowerScalar;
567*837d542aSEvan Quan 	uint16_t OverDrivePowerScalar;
568*837d542aSEvan Quan 	uint16_t OverDriveLimitScalar;
569*837d542aSEvan Quan 	uint16_t FinalPowerScalar;
570*837d542aSEvan Quan 	uint8_t VariantID;
571*837d542aSEvan Quan 	uint8_t spare997;
572*837d542aSEvan Quan 
573*837d542aSEvan Quan 	SMU7_HystController_Data HystControllerData;
574*837d542aSEvan Quan 
575*837d542aSEvan Quan 	int32_t temperature_gradient_slope;
576*837d542aSEvan Quan 	int32_t temperature_gradient;
577*837d542aSEvan Quan 	uint32_t measured_temperature;
578*837d542aSEvan Quan };
579*837d542aSEvan Quan 
580*837d542aSEvan Quan 
581*837d542aSEvan Quan typedef struct SMU7_BapmScoreboard SMU7_BapmScoreboard;
582*837d542aSEvan Quan 
583*837d542aSEvan Quan struct SMU7_AcpiScoreboard {
584*837d542aSEvan Quan 	uint32_t SavedInterruptMask[2];
585*837d542aSEvan Quan 	uint8_t LastACPIRequest;
586*837d542aSEvan Quan 	uint8_t CgBifResp;
587*837d542aSEvan Quan 	uint8_t RequestType;
588*837d542aSEvan Quan 	uint8_t Padding;
589*837d542aSEvan Quan 	SMU75_Discrete_ACPILevel D0Level;
590*837d542aSEvan Quan };
591*837d542aSEvan Quan 
592*837d542aSEvan Quan typedef struct SMU7_AcpiScoreboard SMU7_AcpiScoreboard;
593*837d542aSEvan Quan 
594*837d542aSEvan Quan struct SMU75_Discrete_PmFuses {
595*837d542aSEvan Quan 	uint8_t BapmVddCVidHiSidd[8];
596*837d542aSEvan Quan 
597*837d542aSEvan Quan 	uint8_t BapmVddCVidLoSidd[8];
598*837d542aSEvan Quan 
599*837d542aSEvan Quan 	uint8_t VddCVid[8];
600*837d542aSEvan Quan 
601*837d542aSEvan Quan 	uint8_t SviLoadLineEn;
602*837d542aSEvan Quan 	uint8_t SviLoadLineVddC;
603*837d542aSEvan Quan 	uint8_t SviLoadLineTrimVddC;
604*837d542aSEvan Quan 	uint8_t SviLoadLineOffsetVddC;
605*837d542aSEvan Quan 
606*837d542aSEvan Quan 	uint16_t TDC_VDDC_PkgLimit;
607*837d542aSEvan Quan 	uint8_t TDC_VDDC_ThrottleReleaseLimitPerc;
608*837d542aSEvan Quan 	uint8_t TDC_MAWt;
609*837d542aSEvan Quan 
610*837d542aSEvan Quan 	uint8_t TdcWaterfallCtl;
611*837d542aSEvan Quan 	uint8_t LPMLTemperatureMin;
612*837d542aSEvan Quan 	uint8_t LPMLTemperatureMax;
613*837d542aSEvan Quan 	uint8_t Reserved;
614*837d542aSEvan Quan 
615*837d542aSEvan Quan 	uint8_t LPMLTemperatureScaler[16];
616*837d542aSEvan Quan 
617*837d542aSEvan Quan 	int16_t FuzzyFan_ErrorSetDelta;
618*837d542aSEvan Quan 	int16_t FuzzyFan_ErrorRateSetDelta;
619*837d542aSEvan Quan 	int16_t FuzzyFan_PwmSetDelta;
620*837d542aSEvan Quan 	uint16_t Reserved6;
621*837d542aSEvan Quan 
622*837d542aSEvan Quan 	uint8_t GnbLPML[16];
623*837d542aSEvan Quan 
624*837d542aSEvan Quan 	uint8_t GnbLPMLMaxVid;
625*837d542aSEvan Quan 	uint8_t GnbLPMLMinVid;
626*837d542aSEvan Quan 	uint8_t Reserved1[2];
627*837d542aSEvan Quan 
628*837d542aSEvan Quan 	uint16_t BapmVddCBaseLeakageHiSidd;
629*837d542aSEvan Quan 	uint16_t BapmVddCBaseLeakageLoSidd;
630*837d542aSEvan Quan 
631*837d542aSEvan Quan 	uint16_t  VFT_Temp[3];
632*837d542aSEvan Quan 	uint8_t   Version;
633*837d542aSEvan Quan 	uint8_t   padding;
634*837d542aSEvan Quan 
635*837d542aSEvan Quan 	SMU_QuadraticCoeffs VFT_ATE[3];
636*837d542aSEvan Quan 
637*837d542aSEvan Quan 	SMU_QuadraticCoeffs AVFS_GB;
638*837d542aSEvan Quan 	SMU_QuadraticCoeffs ATE_ACBTC_GB;
639*837d542aSEvan Quan 
640*837d542aSEvan Quan 	SMU_QuadraticCoeffs P2V;
641*837d542aSEvan Quan 
642*837d542aSEvan Quan 	uint32_t PsmCharzFreq;
643*837d542aSEvan Quan 
644*837d542aSEvan Quan 	uint16_t InversionVoltage;
645*837d542aSEvan Quan 	uint16_t PsmCharzTemp;
646*837d542aSEvan Quan 
647*837d542aSEvan Quan 	uint32_t EnabledAvfsModules;
648*837d542aSEvan Quan 
649*837d542aSEvan Quan 	SMU_QuadraticCoeffs BtcGbv_CksOff;
650*837d542aSEvan Quan };
651*837d542aSEvan Quan 
652*837d542aSEvan Quan typedef struct SMU75_Discrete_PmFuses SMU75_Discrete_PmFuses;
653*837d542aSEvan Quan 
654*837d542aSEvan Quan struct SMU7_Discrete_Log_Header_Table {
655*837d542aSEvan Quan 	uint32_t    version;
656*837d542aSEvan Quan 	uint32_t    asic_id;
657*837d542aSEvan Quan 	uint16_t    flags;
658*837d542aSEvan Quan 	uint16_t    entry_size;
659*837d542aSEvan Quan 	uint32_t    total_size;
660*837d542aSEvan Quan 	uint32_t    num_of_entries;
661*837d542aSEvan Quan 	uint8_t     type;
662*837d542aSEvan Quan 	uint8_t     mode;
663*837d542aSEvan Quan 	uint8_t     filler_0[2];
664*837d542aSEvan Quan 	uint32_t    filler_1[2];
665*837d542aSEvan Quan };
666*837d542aSEvan Quan 
667*837d542aSEvan Quan typedef struct SMU7_Discrete_Log_Header_Table SMU7_Discrete_Log_Header_Table;
668*837d542aSEvan Quan 
669*837d542aSEvan Quan struct SMU7_Discrete_Log_Cntl {
670*837d542aSEvan Quan 	uint8_t             Enabled;
671*837d542aSEvan Quan 	uint8_t             Type;
672*837d542aSEvan Quan 	uint8_t             padding[2];
673*837d542aSEvan Quan 	uint32_t            BufferSize;
674*837d542aSEvan Quan 	uint32_t            SamplesLogged;
675*837d542aSEvan Quan 	uint32_t            SampleSize;
676*837d542aSEvan Quan 	uint32_t            AddrL;
677*837d542aSEvan Quan 	uint32_t            AddrH;
678*837d542aSEvan Quan };
679*837d542aSEvan Quan 
680*837d542aSEvan Quan typedef struct SMU7_Discrete_Log_Cntl SMU7_Discrete_Log_Cntl;
681*837d542aSEvan Quan 
682*837d542aSEvan Quan #if defined SMU__DGPU_ONLY
683*837d542aSEvan Quan #define CAC_ACC_NW_NUM_OF_SIGNALS 87
684*837d542aSEvan Quan #endif
685*837d542aSEvan Quan 
686*837d542aSEvan Quan 
687*837d542aSEvan Quan struct SMU7_Discrete_Cac_Collection_Table {
688*837d542aSEvan Quan 	uint32_t temperature;
689*837d542aSEvan Quan 	uint32_t cac_acc_nw[CAC_ACC_NW_NUM_OF_SIGNALS];
690*837d542aSEvan Quan };
691*837d542aSEvan Quan 
692*837d542aSEvan Quan typedef struct SMU7_Discrete_Cac_Collection_Table SMU7_Discrete_Cac_Collection_Table;
693*837d542aSEvan Quan 
694*837d542aSEvan Quan struct SMU7_Discrete_Cac_Verification_Table {
695*837d542aSEvan Quan 	uint32_t VddcTotalPower;
696*837d542aSEvan Quan 	uint32_t VddcLeakagePower;
697*837d542aSEvan Quan 	uint32_t VddcConstantPower;
698*837d542aSEvan Quan 	uint32_t VddcGfxDynamicPower;
699*837d542aSEvan Quan 	uint32_t VddcUvdDynamicPower;
700*837d542aSEvan Quan 	uint32_t VddcVceDynamicPower;
701*837d542aSEvan Quan 	uint32_t VddcAcpDynamicPower;
702*837d542aSEvan Quan 	uint32_t VddcPcieDynamicPower;
703*837d542aSEvan Quan 	uint32_t VddcDceDynamicPower;
704*837d542aSEvan Quan 	uint32_t VddcCurrent;
705*837d542aSEvan Quan 	uint32_t VddcVoltage;
706*837d542aSEvan Quan 	uint32_t VddciTotalPower;
707*837d542aSEvan Quan 	uint32_t VddciLeakagePower;
708*837d542aSEvan Quan 	uint32_t VddciConstantPower;
709*837d542aSEvan Quan 	uint32_t VddciDynamicPower;
710*837d542aSEvan Quan 	uint32_t Vddr1TotalPower;
711*837d542aSEvan Quan 	uint32_t Vddr1LeakagePower;
712*837d542aSEvan Quan 	uint32_t Vddr1ConstantPower;
713*837d542aSEvan Quan 	uint32_t Vddr1DynamicPower;
714*837d542aSEvan Quan 	uint32_t spare[4];
715*837d542aSEvan Quan 	uint32_t temperature;
716*837d542aSEvan Quan };
717*837d542aSEvan Quan 
718*837d542aSEvan Quan typedef struct SMU7_Discrete_Cac_Verification_Table SMU7_Discrete_Cac_Verification_Table;
719*837d542aSEvan Quan 
720*837d542aSEvan Quan struct SMU7_Discrete_Pm_Status_Table {
721*837d542aSEvan Quan 	int32_t T_meas_max[SMU75_THERMAL_INPUT_LOOP_COUNT];
722*837d542aSEvan Quan 	int32_t T_meas_acc[SMU75_THERMAL_INPUT_LOOP_COUNT];
723*837d542aSEvan Quan 
724*837d542aSEvan Quan 	uint32_t I_calc_max;
725*837d542aSEvan Quan 	uint32_t I_calc_acc;
726*837d542aSEvan Quan 	uint32_t P_meas_acc;
727*837d542aSEvan Quan 	uint32_t V_meas_load_acc;
728*837d542aSEvan Quan 	uint32_t I_meas_acc;
729*837d542aSEvan Quan 	uint32_t P_meas_acc_vddci;
730*837d542aSEvan Quan 	uint32_t V_meas_load_acc_vddci;
731*837d542aSEvan Quan 	uint32_t I_meas_acc_vddci;
732*837d542aSEvan Quan 
733*837d542aSEvan Quan 	uint16_t Sclk_dpm_residency[8];
734*837d542aSEvan Quan 	uint16_t Uvd_dpm_residency[8];
735*837d542aSEvan Quan 	uint16_t Vce_dpm_residency[8];
736*837d542aSEvan Quan 	uint16_t Mclk_dpm_residency[4];
737*837d542aSEvan Quan 
738*837d542aSEvan Quan 	uint32_t P_roc_acc;
739*837d542aSEvan Quan 	uint32_t PkgPwr_max;
740*837d542aSEvan Quan 	uint32_t PkgPwr_acc;
741*837d542aSEvan Quan 	uint32_t MclkSwitchingTime_max;
742*837d542aSEvan Quan 	uint32_t MclkSwitchingTime_acc;
743*837d542aSEvan Quan 	uint32_t FanPwm_acc;
744*837d542aSEvan Quan 	uint32_t FanRpm_acc;
745*837d542aSEvan Quan 	uint32_t Gfx_busy_acc;
746*837d542aSEvan Quan 	uint32_t Mc_busy_acc;
747*837d542aSEvan Quan 	uint32_t Fps_acc;
748*837d542aSEvan Quan 
749*837d542aSEvan Quan 	uint32_t AccCnt;
750*837d542aSEvan Quan };
751*837d542aSEvan Quan 
752*837d542aSEvan Quan typedef struct SMU7_Discrete_Pm_Status_Table SMU7_Discrete_Pm_Status_Table;
753*837d542aSEvan Quan 
754*837d542aSEvan Quan struct SMU7_Discrete_AutoWattMan_Status_Table {
755*837d542aSEvan Quan 	int32_t T_meas_acc[SMU75_THERMAL_INPUT_LOOP_COUNT];
756*837d542aSEvan Quan 	uint16_t Sclk_dpm_residency[8];
757*837d542aSEvan Quan 	uint16_t Mclk_dpm_residency[4];
758*837d542aSEvan Quan 	uint32_t TgpPwr_acc;
759*837d542aSEvan Quan 	uint32_t Gfx_busy_acc;
760*837d542aSEvan Quan 	uint32_t Mc_busy_acc;
761*837d542aSEvan Quan 	uint32_t AccCnt;
762*837d542aSEvan Quan };
763*837d542aSEvan Quan 
764*837d542aSEvan Quan typedef struct SMU7_Discrete_AutoWattMan_Status_Table SMU7_Discrete_AutoWattMan_Status_Table;
765*837d542aSEvan Quan 
766*837d542aSEvan Quan #define SMU7_MAX_GFX_CU_COUNT 24
767*837d542aSEvan Quan #define SMU7_MIN_GFX_CU_COUNT  8
768*837d542aSEvan Quan #define SMU7_GFX_CU_PG_ENABLE_DC_MAX_CU_SHIFT 0
769*837d542aSEvan Quan #define SMU7_GFX_CU_PG_ENABLE_DC_MAX_CU_MASK  (0xFFFF << SMU7_GFX_CU_PG_ENABLE_DC_MAX_CU_SHIFT)
770*837d542aSEvan Quan #define SMU7_GFX_CU_PG_ENABLE_AC_MAX_CU_SHIFT 16
771*837d542aSEvan Quan #define SMU7_GFX_CU_PG_ENABLE_AC_MAX_CU_MASK  (0xFFFF << SMU7_GFX_CU_PG_ENABLE_AC_MAX_CU_SHIFT)
772*837d542aSEvan Quan 
773*837d542aSEvan Quan struct SMU7_GfxCuPgScoreboard {
774*837d542aSEvan Quan 	uint8_t Enabled;
775*837d542aSEvan Quan 	uint8_t WaterfallUp;
776*837d542aSEvan Quan 	uint8_t WaterfallDown;
777*837d542aSEvan Quan 	uint8_t WaterfallLimit;
778*837d542aSEvan Quan 	uint8_t CurrMaxCu;
779*837d542aSEvan Quan 	uint8_t TargMaxCu;
780*837d542aSEvan Quan 	uint8_t ClampMode;
781*837d542aSEvan Quan 	uint8_t Active;
782*837d542aSEvan Quan 	uint8_t MaxSupportedCu;
783*837d542aSEvan Quan 	uint8_t MinSupportedCu;
784*837d542aSEvan Quan 	uint8_t PendingGfxCuHostInterrupt;
785*837d542aSEvan Quan 	uint8_t LastFilteredMaxCuInteger;
786*837d542aSEvan Quan 	uint16_t FilteredMaxCu;
787*837d542aSEvan Quan 	uint16_t FilteredMaxCuAlpha;
788*837d542aSEvan Quan 	uint16_t FilterResetCount;
789*837d542aSEvan Quan 	uint16_t FilterResetCountLimit;
790*837d542aSEvan Quan 	uint8_t ForceCu;
791*837d542aSEvan Quan 	uint8_t ForceCuCount;
792*837d542aSEvan Quan 	uint8_t AcModeMaxCu;
793*837d542aSEvan Quan 	uint8_t DcModeMaxCu;
794*837d542aSEvan Quan };
795*837d542aSEvan Quan 
796*837d542aSEvan Quan typedef struct SMU7_GfxCuPgScoreboard SMU7_GfxCuPgScoreboard;
797*837d542aSEvan Quan 
798*837d542aSEvan Quan #define SMU7_SCLK_CAC 0x561
799*837d542aSEvan Quan #define SMU7_MCLK_CAC 0xF9
800*837d542aSEvan Quan #define SMU7_VCLK_CAC 0x2DE
801*837d542aSEvan Quan #define SMU7_DCLK_CAC 0x2DE
802*837d542aSEvan Quan #define SMU7_ECLK_CAC 0x25E
803*837d542aSEvan Quan #define SMU7_ACLK_CAC 0x25E
804*837d542aSEvan Quan #define SMU7_SAMCLK_CAC 0x25E
805*837d542aSEvan Quan #define SMU7_DISPCLK_CAC 0x100
806*837d542aSEvan Quan #define SMU7_CAC_CONSTANT 0x2EE3430
807*837d542aSEvan Quan #define SMU7_CAC_CONSTANT_SHIFT 18
808*837d542aSEvan Quan 
809*837d542aSEvan Quan #define SMU7_VDDCI_MCLK_CONST        1765
810*837d542aSEvan Quan #define SMU7_VDDCI_MCLK_CONST_SHIFT  16
811*837d542aSEvan Quan #define SMU7_VDDCI_VDDCI_CONST       50958
812*837d542aSEvan Quan #define SMU7_VDDCI_VDDCI_CONST_SHIFT 14
813*837d542aSEvan Quan #define SMU7_VDDCI_CONST             11781
814*837d542aSEvan Quan #define SMU7_VDDCI_STROBE_PWR        1331
815*837d542aSEvan Quan 
816*837d542aSEvan Quan #define SMU7_VDDR1_CONST            693
817*837d542aSEvan Quan #define SMU7_VDDR1_CAC_WEIGHT       20
818*837d542aSEvan Quan #define SMU7_VDDR1_CAC_WEIGHT_SHIFT 19
819*837d542aSEvan Quan #define SMU7_VDDR1_STROBE_PWR       512
820*837d542aSEvan Quan 
821*837d542aSEvan Quan #define SMU7_AREA_COEFF_UVD 0xA78
822*837d542aSEvan Quan #define SMU7_AREA_COEFF_VCE 0x190A
823*837d542aSEvan Quan #define SMU7_AREA_COEFF_ACP 0x22D1
824*837d542aSEvan Quan #define SMU7_AREA_COEFF_SAMU 0x534
825*837d542aSEvan Quan 
826*837d542aSEvan Quan #define SMU7_THERM_OUT_MODE_DISABLE       0x0
827*837d542aSEvan Quan #define SMU7_THERM_OUT_MODE_THERM_ONLY    0x1
828*837d542aSEvan Quan #define SMU7_THERM_OUT_MODE_THERM_VRHOT   0x2
829*837d542aSEvan Quan 
830*837d542aSEvan Quan #define SQ_Enable_MASK 0x1
831*837d542aSEvan Quan #define SQ_IR_MASK 0x2
832*837d542aSEvan Quan #define SQ_PCC_MASK 0x4
833*837d542aSEvan Quan #define SQ_EDC_MASK 0x8
834*837d542aSEvan Quan 
835*837d542aSEvan Quan #define TCP_Enable_MASK 0x100
836*837d542aSEvan Quan #define TCP_IR_MASK 0x200
837*837d542aSEvan Quan #define TCP_PCC_MASK 0x400
838*837d542aSEvan Quan #define TCP_EDC_MASK 0x800
839*837d542aSEvan Quan 
840*837d542aSEvan Quan #define TD_Enable_MASK 0x10000
841*837d542aSEvan Quan #define TD_IR_MASK 0x20000
842*837d542aSEvan Quan #define TD_PCC_MASK 0x40000
843*837d542aSEvan Quan #define TD_EDC_MASK 0x80000
844*837d542aSEvan Quan 
845*837d542aSEvan Quan #define DB_Enable_MASK 0x1000000
846*837d542aSEvan Quan #define DB_IR_MASK 0x2000000
847*837d542aSEvan Quan #define DB_PCC_MASK 0x4000000
848*837d542aSEvan Quan #define DB_EDC_MASK 0x8000000
849*837d542aSEvan Quan 
850*837d542aSEvan Quan #define SQ_Enable_SHIFT 0
851*837d542aSEvan Quan #define SQ_IR_SHIFT 1
852*837d542aSEvan Quan #define SQ_PCC_SHIFT 2
853*837d542aSEvan Quan #define SQ_EDC_SHIFT 3
854*837d542aSEvan Quan 
855*837d542aSEvan Quan #define TCP_Enable_SHIFT 8
856*837d542aSEvan Quan #define TCP_IR_SHIFT 9
857*837d542aSEvan Quan #define TCP_PCC_SHIFT 10
858*837d542aSEvan Quan #define TCP_EDC_SHIFT 11
859*837d542aSEvan Quan 
860*837d542aSEvan Quan #define TD_Enable_SHIFT 16
861*837d542aSEvan Quan #define TD_IR_SHIFT 17
862*837d542aSEvan Quan #define TD_PCC_SHIFT 18
863*837d542aSEvan Quan #define TD_EDC_SHIFT 19
864*837d542aSEvan Quan 
865*837d542aSEvan Quan #define DB_Enable_SHIFT 24
866*837d542aSEvan Quan #define DB_IR_SHIFT 25
867*837d542aSEvan Quan #define DB_PCC_SHIFT 26
868*837d542aSEvan Quan #define DB_EDC_SHIFT 27
869*837d542aSEvan Quan 
870*837d542aSEvan Quan #define PMFUSES_AVFSSIZE 104
871*837d542aSEvan Quan 
872*837d542aSEvan Quan #define BTCGB0_Vdroop_Enable_MASK  0x1
873*837d542aSEvan Quan #define BTCGB1_Vdroop_Enable_MASK  0x2
874*837d542aSEvan Quan #define AVFSGB0_Vdroop_Enable_MASK 0x4
875*837d542aSEvan Quan #define AVFSGB1_Vdroop_Enable_MASK 0x8
876*837d542aSEvan Quan 
877*837d542aSEvan Quan #define BTCGB0_Vdroop_Enable_SHIFT  0
878*837d542aSEvan Quan #define BTCGB1_Vdroop_Enable_SHIFT  1
879*837d542aSEvan Quan #define AVFSGB0_Vdroop_Enable_SHIFT 2
880*837d542aSEvan Quan #define AVFSGB1_Vdroop_Enable_SHIFT 3
881*837d542aSEvan Quan 
882*837d542aSEvan Quan #pragma pack(pop)
883*837d542aSEvan Quan 
884*837d542aSEvan Quan 
885*837d542aSEvan Quan #endif
886*837d542aSEvan Quan 
887