Skip to content

Commit fefa83f

Browse files
Likun Gaoalexdeucher
authored andcommitted
drm/amd/swsmu: add pptable header for smu v14_0_2
Add pptable header for smu v14_0_2. Signed-off-by: Likun Gao <Likun.Gao@amd.com> Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 457ff29 commit fefa83f

1 file changed

Lines changed: 164 additions & 0 deletions

File tree

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/*
2+
* Copyright 2023 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_14_0_2_PPTABLE_H
25+
#define SMU_14_0_2_PPTABLE_H
26+
27+
28+
#pragma pack(push, 1)
29+
30+
#define SMU_14_0_2_TABLE_FORMAT_REVISION 3
31+
32+
// POWERPLAYTABLE::ulPlatformCaps
33+
#define SMU_14_0_2_PP_PLATFORM_CAP_POWERPLAY 0x1 // This cap indicates whether CCC need to show Powerplay page.
34+
#define SMU_14_0_2_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 0x2 // This cap indicates whether power source notificaiton is done by SBIOS instead of OS.
35+
#define SMU_14_0_2_PP_PLATFORM_CAP_HARDWAREDC 0x4 // This cap indicates whether DC mode notificaiton is done by GPIO pin directly.
36+
#define SMU_14_0_2_PP_PLATFORM_CAP_BACO 0x8 // This cap indicates whether board supports the BACO circuitry.
37+
#define SMU_14_0_2_PP_PLATFORM_CAP_MACO 0x10 // This cap indicates whether board supports the MACO circuitry.
38+
#define SMU_14_0_2_PP_PLATFORM_CAP_SHADOWPSTATE 0x20 // This cap indicates whether board supports the Shadow Pstate.
39+
#define SMU_14_0_2_PP_PLATFORM_CAP_LEDSUPPORTED 0x40 // This cap indicates whether board supports the LED.
40+
#define SMU_14_0_2_PP_PLATFORM_CAP_MOBILEOVERDRIVE 0x80 // This cap indicates whether board supports the Mobile Overdrive.
41+
42+
// SMU_14_0_2_PP_THERMALCONTROLLER - Thermal Controller Type
43+
#define SMU_14_0_2_PP_THERMALCONTROLLER_NONE 0
44+
45+
#define SMU_14_0_2_PP_OVERDRIVE_VERSION 0x1 // TODO: FIX OverDrive Version TBD
46+
#define SMU_14_0_2_PP_POWERSAVINGCLOCK_VERSION 0x01 // Power Saving Clock Table Version 1.00
47+
48+
enum SMU_14_0_2_OD_SW_FEATURE_CAP
49+
{
50+
SMU_14_0_2_ODCAP_AUTO_FAN_ACOUSTIC_LIMIT = 0,
51+
SMU_14_0_2_ODCAP_POWER_MODE = 1,
52+
SMU_14_0_2_ODCAP_AUTO_UV_ENGINE = 2,
53+
SMU_14_0_2_ODCAP_AUTO_OC_ENGINE = 3,
54+
SMU_14_0_2_ODCAP_AUTO_OC_MEMORY = 4,
55+
SMU_14_0_2_ODCAP_MEMORY_TIMING_TUNE = 5,
56+
SMU_14_0_2_ODCAP_MANUAL_AC_TIMING = 6,
57+
SMU_14_0_2_ODCAP_AUTO_VF_CURVE_OPTIMIZER = 7,
58+
SMU_14_0_2_ODCAP_AUTO_SOC_UV = 8,
59+
SMU_14_0_2_ODCAP_COUNT = 9,
60+
};
61+
62+
enum SMU_14_0_2_OD_SW_FEATURE_ID
63+
{
64+
SMU_14_0_2_ODFEATURE_AUTO_FAN_ACOUSTIC_LIMIT = 1 << SMU_14_0_2_ODCAP_AUTO_FAN_ACOUSTIC_LIMIT, // Auto Fan Acoustic RPM
65+
SMU_14_0_2_ODFEATURE_POWER_MODE = 1 << SMU_14_0_2_ODCAP_POWER_MODE, // Optimized GPU Power Mode
66+
SMU_14_0_2_ODFEATURE_AUTO_UV_ENGINE = 1 << SMU_14_0_2_ODCAP_AUTO_UV_ENGINE, // Auto Under Volt GFXCLK
67+
SMU_14_0_2_ODFEATURE_AUTO_OC_ENGINE = 1 << SMU_14_0_2_ODCAP_AUTO_OC_ENGINE, // Auto Over Clock GFXCLK
68+
SMU_14_0_2_ODFEATURE_AUTO_OC_MEMORY = 1 << SMU_14_0_2_ODCAP_AUTO_OC_MEMORY, // Auto Over Clock MCLK
69+
SMU_14_0_2_ODFEATURE_MEMORY_TIMING_TUNE = 1 << SMU_14_0_2_ODCAP_MEMORY_TIMING_TUNE, // Auto AC Timing Tuning
70+
SMU_14_0_2_ODFEATURE_MANUAL_AC_TIMING = 1 << SMU_14_0_2_ODCAP_MANUAL_AC_TIMING, // Manual fine grain AC Timing tuning
71+
SMU_14_0_2_ODFEATURE_AUTO_VF_CURVE_OPTIMIZER = 1 << SMU_14_0_2_ODCAP_AUTO_VF_CURVE_OPTIMIZER, // Fine grain auto VF curve tuning
72+
SMU_14_0_2_ODFEATURE_AUTO_SOC_UV = 1 << SMU_14_0_2_ODCAP_AUTO_SOC_UV, // Auto Unver Volt VDDSOC
73+
};
74+
75+
#define SMU_14_0_2_MAX_ODFEATURE 32 // Maximum Number of OD Features
76+
77+
enum SMU_14_0_2_OD_SW_FEATURE_SETTING_ID
78+
{
79+
SMU_14_0_2_ODSETTING_AUTO_FAN_ACOUSTIC_LIMIT = 0,
80+
SMU_14_0_2_ODSETTING_POWER_MODE = 1,
81+
SMU_14_0_2_ODSETTING_AUTOUVENGINE = 2,
82+
SMU_14_0_2_ODSETTING_AUTOOCENGINE = 3,
83+
SMU_14_0_2_ODSETTING_AUTOOCMEMORY = 4,
84+
SMU_14_0_2_ODSETTING_ACTIMING = 5,
85+
SMU_14_0_2_ODSETTING_MANUAL_AC_TIMING = 6,
86+
SMU_14_0_2_ODSETTING_AUTO_VF_CURVE_OPTIMIZER = 7,
87+
SMU_14_0_2_ODSETTING_AUTO_SOC_UV = 8,
88+
SMU_14_0_2_ODSETTING_COUNT = 9,
89+
};
90+
#define SMU_14_0_2_MAX_ODSETTING 64 // Maximum Number of ODSettings
91+
92+
enum SMU_14_0_2_PWRMODE_SETTING
93+
{
94+
SMU_14_0_2_PMSETTING_POWER_LIMIT_QUIET = 0,
95+
SMU_14_0_2_PMSETTING_POWER_LIMIT_BALANCE,
96+
SMU_14_0_2_PMSETTING_POWER_LIMIT_TURBO,
97+
SMU_14_0_2_PMSETTING_POWER_LIMIT_RAGE,
98+
SMU_14_0_2_PMSETTING_ACOUSTIC_TEMP_QUIET,
99+
SMU_14_0_2_PMSETTING_ACOUSTIC_TEMP_BALANCE,
100+
SMU_14_0_2_PMSETTING_ACOUSTIC_TEMP_TURBO,
101+
SMU_14_0_2_PMSETTING_ACOUSTIC_TEMP_RAGE,
102+
SMU_14_0_2_PMSETTING_ACOUSTIC_TARGET_RPM_QUIET,
103+
SMU_14_0_2_PMSETTING_ACOUSTIC_TARGET_RPM_BALANCE,
104+
SMU_14_0_2_PMSETTING_ACOUSTIC_TARGET_RPM_TURBO,
105+
SMU_14_0_2_PMSETTING_ACOUSTIC_TARGET_RPM_RAGE,
106+
SMU_14_0_2_PMSETTING_ACOUSTIC_LIMIT_RPM_QUIET,
107+
SMU_14_0_2_PMSETTING_ACOUSTIC_LIMIT_RPM_BALANCE,
108+
SMU_14_0_2_PMSETTING_ACOUSTIC_LIMIT_RPM_TURBO,
109+
SMU_14_0_2_PMSETTING_ACOUSTIC_LIMIT_RPM_RAGE,
110+
};
111+
#define SMU_14_0_2_MAX_PMSETTING 32 // Maximum Number of PowerMode Settings
112+
113+
enum SMU_14_0_2_overdrive_table_id
114+
{
115+
SMU_14_0_2_OVERDRIVE_TABLE_BASIC = 0,
116+
SMU_14_0_2_OVERDRIVE_TABLE_ADVANCED = 1,
117+
SMU_14_0_2_OVERDRIVE_TABLE_COUNT = 2,
118+
};
119+
120+
struct smu_14_0_2_overdrive_table
121+
{
122+
uint8_t revision; // Revision = SMU_14_0_2_PP_OVERDRIVE_VERSION
123+
uint8_t reserve[3]; // Zero filled field reserved for future use
124+
uint8_t cap[SMU_14_0_2_OVERDRIVE_TABLE_COUNT][SMU_14_0_2_MAX_ODFEATURE]; // OD feature support flags
125+
int32_t max[SMU_14_0_2_OVERDRIVE_TABLE_COUNT][SMU_14_0_2_MAX_ODSETTING]; // maximum settings
126+
int32_t min[SMU_14_0_2_OVERDRIVE_TABLE_COUNT][SMU_14_0_2_MAX_ODSETTING]; // minimum settings
127+
int16_t pm_setting[SMU_14_0_2_MAX_PMSETTING]; // Optimized power mode feature settings
128+
};
129+
130+
struct smu_14_0_2_powerplay_table
131+
{
132+
struct atom_common_table_header header; // header.format_revision = 3 (HAS TO MATCH SMU_14_0_2_TABLE_FORMAT_REVISION), header.content_revision = ? structuresize is calculated by PPGen.
133+
uint8_t table_revision; // PPGen use only: table_revision = 3
134+
uint8_t padding; // Padding 1 byte to align table_size offset to 6 bytes (pmfw_start_offset, for PMFW to know the starting offset of PPTable_t).
135+
uint16_t pmfw_pptable_start_offset; // The start offset of the pmfw portion. i.e. start of PPTable_t (start of SkuTable_t)
136+
uint16_t pmfw_pptable_size; // The total size of pmfw_pptable, i.e PPTable_t.
137+
uint16_t pmfw_pfe_table_start_offset; // The start offset of the PFE_Settings_t within pmfw_pptable.
138+
uint16_t pmfw_pfe_table_size; // The size of PFE_Settings_t.
139+
uint16_t pmfw_board_table_start_offset; // The start offset of the BoardTable_t within pmfw_pptable.
140+
uint16_t pmfw_board_table_size; // The size of BoardTable_t.
141+
uint16_t pmfw_custom_sku_table_start_offset; // The start offset of the CustomSkuTable_t within pmfw_pptable.
142+
uint16_t pmfw_custom_sku_table_size; // The size of the CustomSkuTable_t.
143+
uint32_t golden_pp_id; // PPGen use only: PP Table ID on the Golden Data Base
144+
uint32_t golden_revision; // PPGen use only: PP Table Revision on the Golden Data Base
145+
uint16_t format_id; // PPGen use only: PPTable for different ASICs.
146+
uint32_t platform_caps; // POWERPLAYTABLE::ulPlatformCaps
147+
148+
uint8_t thermal_controller_type; // one of smu_14_0_2_PP_THERMALCONTROLLER
149+
150+
uint16_t small_power_limit1;
151+
uint16_t small_power_limit2;
152+
uint16_t boost_power_limit; // For Gemini Board, when the slave adapter is in BACO mode, the master adapter will use this boost power limit instead of the default power limit to boost the power limit.
153+
uint16_t software_shutdown_temp;
154+
155+
uint8_t reserve[143]; // Zero filled field reserved for future use
156+
157+
struct smu_14_0_2_overdrive_table overdrive_table;
158+
159+
PPTable_t smc_pptable; // PPTable_t in driver_if.h -- as requested by PMFW, this offset should start at a 32-byte boundary, and the table_size above should remain at offset=6 bytes
160+
};
161+
162+
#pragma pack(pop)
163+
164+
#endif

0 commit comments

Comments
 (0)