Skip to content

Commit 5f142b3

Browse files
Kenneth Fengalexdeucher
authored andcommitted
drm/amd/pm: update powerplay structure on smu v14.0.2/3
update powerplay structure on smu v14.0.2/3 Signed-off-by: Kenneth Feng <[email protected]> Reviewed-by: Yang Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit f905d0c)
1 parent eb880ff commit 5f142b3

File tree

1 file changed

+46
-6
lines changed

1 file changed

+46
-6
lines changed

drivers/gpu/drm/amd/pm/swsmu/inc/smu_v14_0_2_pptable.h

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727

2828
#pragma pack(push, 1)
2929

30-
#define SMU_14_0_2_TABLE_FORMAT_REVISION 3
30+
#define SMU_14_0_2_TABLE_FORMAT_REVISION 23
31+
#define SMU_14_0_2_CUSTOM_TABLE_FORMAT_REVISION 1
3132

3233
// POWERPLAYTABLE::ulPlatformCaps
3334
#define SMU_14_0_2_PP_PLATFORM_CAP_POWERPLAY 0x1 // This cap indicates whether CCC need to show Powerplay page.
@@ -43,6 +44,7 @@
4344
#define SMU_14_0_2_PP_THERMALCONTROLLER_NONE 0
4445

4546
#define SMU_14_0_2_PP_OVERDRIVE_VERSION 0x1 // TODO: FIX OverDrive Version TBD
47+
#define SMU_14_0_2_PP_CUSTOM_OVERDRIVE_VERSION 0x1
4648
#define SMU_14_0_2_PP_POWERSAVINGCLOCK_VERSION 0x01 // Power Saving Clock Table Version 1.00
4749

4850
enum SMU_14_0_2_OD_SW_FEATURE_CAP
@@ -107,6 +109,7 @@ enum SMU_14_0_2_PWRMODE_SETTING
107109
SMU_14_0_2_PMSETTING_ACOUSTIC_LIMIT_RPM_BALANCE,
108110
SMU_14_0_2_PMSETTING_ACOUSTIC_LIMIT_RPM_TURBO,
109111
SMU_14_0_2_PMSETTING_ACOUSTIC_LIMIT_RPM_RAGE,
112+
SMU_14_0_2_PMSETTING_COUNT
110113
};
111114
#define SMU_14_0_2_MAX_PMSETTING 32 // Maximum Number of PowerMode Settings
112115

@@ -127,17 +130,24 @@ struct smu_14_0_2_overdrive_table
127130
int16_t pm_setting[SMU_14_0_2_MAX_PMSETTING]; // Optimized power mode feature settings
128131
};
129132

133+
enum smu_14_0_3_pptable_source {
134+
PPTABLE_SOURCE_IFWI = 0,
135+
PPTABLE_SOURCE_DRIVER_HARDCODED = 1,
136+
PPTABLE_SOURCE_PPGEN_REGISTRY = 2,
137+
PPTABLE_SOURCE_MAX = PPTABLE_SOURCE_PPGEN_REGISTRY,
138+
};
139+
130140
struct smu_14_0_2_powerplay_table
131141
{
132142
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.
133143
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).
144+
uint8_t pptable_source; // PPGen UI dropdown box
135145
uint16_t pmfw_pptable_start_offset; // The start offset of the pmfw portion. i.e. start of PPTable_t (start of SkuTable_t)
136146
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.
147+
uint16_t pmfw_sku_table_start_offset; // DO NOT CHANGE ORDER; The absolute start offset of the SkuTable_t (within smu_14_0_3_powerplay_table).
148+
uint16_t pmfw_sku_table_size; // DO NOT CHANGE ORDER; The size of SkuTable_t.
149+
uint16_t pmfw_board_table_start_offset; // The start offset of the BoardTable_t
150+
uint16_t pmfw_board_table_size; // The size of BoardTable_t.
141151
uint16_t pmfw_custom_sku_table_start_offset; // The start offset of the CustomSkuTable_t within pmfw_pptable.
142152
uint16_t pmfw_custom_sku_table_size; // The size of the CustomSkuTable_t.
143153
uint32_t golden_pp_id; // PPGen use only: PP Table ID on the Golden Data Base
@@ -159,6 +169,36 @@ struct smu_14_0_2_powerplay_table
159169
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
160170
};
161171

172+
enum SMU_14_0_2_CUSTOM_OD_SW_FEATURE_CAP {
173+
SMU_14_0_2_CUSTOM_ODCAP_POWER_MODE = 0,
174+
SMU_14_0_2_CUSTOM_ODCAP_COUNT
175+
};
176+
177+
enum SMU_14_0_2_CUSTOM_OD_FEATURE_SETTING_ID {
178+
SMU_14_0_2_CUSTOM_ODSETTING_POWER_MODE = 0,
179+
SMU_14_0_2_CUSTOM_ODSETTING_COUNT,
180+
};
181+
182+
struct smu_14_0_2_custom_overdrive_table {
183+
uint8_t revision;
184+
uint8_t reserve[3];
185+
uint8_t cap[SMU_14_0_2_CUSTOM_ODCAP_COUNT];
186+
int32_t max[SMU_14_0_2_CUSTOM_ODSETTING_COUNT];
187+
int32_t min[SMU_14_0_2_CUSTOM_ODSETTING_COUNT];
188+
int16_t pm_setting[SMU_14_0_2_PMSETTING_COUNT];
189+
};
190+
191+
struct smu_14_0_3_custom_powerplay_table {
192+
uint8_t custom_table_revision;
193+
uint16_t custom_table_size;
194+
uint16_t custom_sku_table_offset;
195+
uint32_t custom_platform_caps;
196+
uint16_t software_shutdown_temp;
197+
struct smu_14_0_2_custom_overdrive_table custom_overdrive_table;
198+
uint32_t reserve[8];
199+
CustomSkuTable_t custom_sku_table_pmfw;
200+
};
201+
162202
#pragma pack(pop)
163203

164204
#endif

0 commit comments

Comments
 (0)