<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Rex Zhu <Rex.Zhu@amd.com><br>
<b>Sent:</b> Wednesday, June 13, 2018 3:34:05 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH] drm/amd/pp: Remove SAMU support in powerplay</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">As the SAMU ip was not supported in linux,<br>
so delete the SAMU support in powerplay on<br>
asics Bonarire/Hawwii/Tonga/Fiji/Polaris/vegam.<br>
<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
.../amd/powerplay/hwmgr/smu7_clockpowergating.c | 54 --------------<br>
.../amd/powerplay/hwmgr/smu7_clockpowergating.h | 1 -<br>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 1 -<br>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h | 1 -<br>
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h | 1 -<br>
drivers/gpu/drm/amd/powerplay/inc/smumgr.h | 2 -<br>
drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c | 35 ---------<br>
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 74 -------------------<br>
.../gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c | 10 ---<br>
.../drm/amd/powerplay/smumgr/polaris10_smumgr.c | 86 ----------------------<br>
.../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 80 --------------------<br>
.../gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 85 ---------------------<br>
12 files changed, 430 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c<br>
index 6d72a56..4149562 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c<br>
@@ -39,13 +39,6 @@ static int smu7_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable)<br>
PPSMC_MSG_VCEDPM_Disable);<br>
}<br>
<br>
-static int smu7_enable_disable_samu_dpm(struct pp_hwmgr *hwmgr, bool enable)<br>
-{<br>
- return smum_send_msg_to_smc(hwmgr, enable ?<br>
- PPSMC_MSG_SAMUDPM_Enable :<br>
- PPSMC_MSG_SAMUDPM_Disable);<br>
-}<br>
-<br>
static int smu7_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate)<br>
{<br>
if (!bgate)<br>
@@ -60,13 +53,6 @@ static int smu7_update_vce_dpm(struct pp_hwmgr *hwmgr, bool bgate)<br>
return smu7_enable_disable_vce_dpm(hwmgr, !bgate);<br>
}<br>
<br>
-static int smu7_update_samu_dpm(struct pp_hwmgr *hwmgr, bool bgate)<br>
-{<br>
- if (!bgate)<br>
- smum_update_smc_table(hwmgr, SMU_SAMU_TABLE);<br>
- return smu7_enable_disable_samu_dpm(hwmgr, !bgate);<br>
-}<br>
-<br>
int smu7_powerdown_uvd(struct pp_hwmgr *hwmgr)<br>
{<br>
if (phm_cf_want_uvd_power_gating(hwmgr))<br>
@@ -107,35 +93,15 @@ static int smu7_powerup_vce(struct pp_hwmgr *hwmgr)<br>
return 0;<br>
}<br>
<br>
-static int smu7_powerdown_samu(struct pp_hwmgr *hwmgr)<br>
-{<br>
- if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,<br>
- PHM_PlatformCaps_SamuPowerGating))<br>
- return smum_send_msg_to_smc(hwmgr,<br>
- PPSMC_MSG_SAMPowerOFF);<br>
- return 0;<br>
-}<br>
-<br>
-static int smu7_powerup_samu(struct pp_hwmgr *hwmgr)<br>
-{<br>
- if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,<br>
- PHM_PlatformCaps_SamuPowerGating))<br>
- return smum_send_msg_to_smc(hwmgr,<br>
- PPSMC_MSG_SAMPowerON);<br>
- return 0;<br>
-}<br>
-<br>
int smu7_disable_clock_power_gating(struct pp_hwmgr *hwmgr)<br>
{<br>
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);<br>
<br>
data->uvd_power_gated = false;<br>
data->vce_power_gated = false;<br>
- data->samu_power_gated = false;<br>
<br>
smu7_powerup_uvd(hwmgr);<br>
smu7_powerup_vce(hwmgr);<br>
- smu7_powerup_samu(hwmgr);<br>
<br>
return 0;<br>
}<br>
@@ -195,26 +161,6 @@ void smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate)<br>
}<br>
}<br>
<br>
-int smu7_powergate_samu(struct pp_hwmgr *hwmgr, bool bgate)<br>
-{<br>
- struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);<br>
-<br>
- if (data->samu_power_gated == bgate)<br>
- return 0;<br>
-<br>
- data->samu_power_gated = bgate;<br>
-<br>
- if (bgate) {<br>
- smu7_update_samu_dpm(hwmgr, true);<br>
- smu7_powerdown_samu(hwmgr);<br>
- } else {<br>
- smu7_powerup_samu(hwmgr);<br>
- smu7_update_samu_dpm(hwmgr, false);<br>
- }<br>
-<br>
- return 0;<br>
-}<br>
-<br>
int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,<br>
const uint32_t *msg_id)<br>
{<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h<br>
index 1ddce02..be7f66d 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h<br>
@@ -29,7 +29,6 @@<br>
void smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate);<br>
void smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate);<br>
int smu7_powerdown_uvd(struct pp_hwmgr *hwmgr);<br>
-int smu7_powergate_samu(struct pp_hwmgr *hwmgr, bool bgate);<br>
int smu7_powergate_acp(struct pp_hwmgr *hwmgr, bool bgate);<br>
int smu7_disable_clock_power_gating(struct pp_hwmgr *hwmgr);<br>
int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
index 11e1762..a338142 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
@@ -4244,7 +4244,6 @@ static int smu7_init_power_gate_state(struct pp_hwmgr *hwmgr)<br>
<br>
data->uvd_power_gated = false;<br>
data->vce_power_gated = false;<br>
- data->samu_power_gated = false;<br>
<br>
return 0;<br>
}<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h<br>
index c91e75d..3784ce6 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h<br>
@@ -310,7 +310,6 @@ struct smu7_hwmgr {<br>
/* ---- Power Gating States ---- */<br>
bool uvd_power_gated;<br>
bool vce_power_gated;<br>
- bool samu_power_gated;<br>
bool need_long_memory_training;<br>
<br>
/* Application power optimization parameters */<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h<br>
index aadd6cb..339820d 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h<br>
@@ -370,7 +370,6 @@ struct vega10_hwmgr {<br>
/* ---- Power Gating States ---- */<br>
bool uvd_power_gated;<br>
bool vce_power_gated;<br>
- bool samu_power_gated;<br>
bool need_long_memory_training;<br>
<br>
/* Internal settings to apply the application power optimization parameters */<br>
diff --git a/drivers/gpu/drm/amd/powerplay/inc/smumgr.h b/drivers/gpu/drm/amd/powerplay/inc/smumgr.h<br>
index 6c22ed9..89dfbf5 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/inc/smumgr.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/inc/smumgr.h<br>
@@ -29,7 +29,6 @@<br>
enum SMU_TABLE {<br>
SMU_UVD_TABLE = 0,<br>
SMU_VCE_TABLE,<br>
- SMU_SAMU_TABLE,<br>
SMU_BIF_TABLE,<br>
};<br>
<br>
@@ -47,7 +46,6 @@ enum SMU_MEMBER {<br>
UcodeLoadStatus,<br>
UvdBootLevel,<br>
VceBootLevel,<br>
- SamuBootLevel,<br>
LowSclkInterruptThreshold,<br>
DRAM_LOG_ADDR_H,<br>
DRAM_LOG_ADDR_L,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
index 2d4ec8a..8cd21ac 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
@@ -1614,37 +1614,6 @@ static int ci_populate_smc_acp_level(struct pp_hwmgr *hwmgr,<br>
return result;<br>
}<br>
<br>
-static int ci_populate_smc_samu_level(struct pp_hwmgr *hwmgr,<br>
- SMU7_Discrete_DpmTable *table)<br>
-{<br>
- int result = -EINVAL;<br>
- uint8_t count;<br>
- struct pp_atomctrl_clock_dividers_vi dividers;<br>
- struct phm_samu_clock_voltage_dependency_table *samu_table =<br>
- hwmgr->dyn_state.samu_clock_voltage_dependency_table;<br>
-<br>
- table->SamuBootLevel = 0;<br>
- table->SamuLevelCount = (uint8_t)(samu_table->count);<br>
-<br>
- for (count = 0; count < table->SamuLevelCount; count++) {<br>
- table->SamuLevel[count].Frequency = samu_table->entries[count].samclk;<br>
- table->SamuLevel[count].MinVoltage = samu_table->entries[count].v * VOLTAGE_SCALE;<br>
- table->SamuLevel[count].MinPhases = 1;<br>
-<br>
- /* retrieve divider value for VBIOS */<br>
- result = atomctrl_get_dfs_pll_dividers_vi(hwmgr,<br>
- table->SamuLevel[count].Frequency, ÷rs);<br>
- PP_ASSERT_WITH_CODE((0 == result),<br>
- "can not find divide id for samu clock", return result);<br>
-<br>
- table->SamuLevel[count].Divider = (uint8_t)dividers.pll_post_divider;<br>
-<br>
- CONVERT_FROM_HOST_TO_SMC_UL(table->SamuLevel[count].Frequency);<br>
- CONVERT_FROM_HOST_TO_SMC_US(table->SamuLevel[count].MinVoltage);<br>
- }<br>
- return result;<br>
-}<br>
-<br>
static int ci_populate_memory_timing_parameters(<br>
struct pp_hwmgr *hwmgr,<br>
uint32_t engine_clock,<br>
@@ -2026,10 +1995,6 @@ static int ci_init_smc_table(struct pp_hwmgr *hwmgr)<br>
PP_ASSERT_WITH_CODE(0 == result,<br>
"Failed to initialize ACP Level!", return result);<br>
<br>
- result = ci_populate_smc_samu_level(hwmgr, table);<br>
- PP_ASSERT_WITH_CODE(0 == result,<br>
- "Failed to initialize SAMU Level!", return result);<br>
-<br>
/* Since only the initial state is completely set up at this point (the other states are just copies of the boot state) we only */<br>
/* need to populate the ARB settings for the initial state. */<br>
result = ci_program_memory_timing_parameters(hwmgr);<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
index 53df940..18048f8 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
@@ -1503,44 +1503,6 @@ static int fiji_populate_smc_acp_level(struct pp_hwmgr *hwmgr,<br>
return result;<br>
}<br>
<br>
-static int fiji_populate_smc_samu_level(struct pp_hwmgr *hwmgr,<br>
- SMU73_Discrete_DpmTable *table)<br>
-{<br>
- int result = -EINVAL;<br>
- uint8_t count;<br>
- struct pp_atomctrl_clock_dividers_vi dividers;<br>
- struct phm_ppt_v1_information *table_info =<br>
- (struct phm_ppt_v1_information *)(hwmgr->pptable);<br>
- struct phm_ppt_v1_mm_clock_voltage_dependency_table *mm_table =<br>
- table_info->mm_dep_table;<br>
-<br>
- table->SamuBootLevel = 0;<br>
- table->SamuLevelCount = (uint8_t)(mm_table->count);<br>
-<br>
- for (count = 0; count < table->SamuLevelCount; count++) {<br>
- /* not sure whether we need evclk or not */<br>
- table->SamuLevel[count].MinVoltage = 0;<br>
- table->SamuLevel[count].Frequency = mm_table->entries[count].samclock;<br>
- table->SamuLevel[count].MinVoltage |= (mm_table->entries[count].vddc *<br>
- VOLTAGE_SCALE) << VDDC_SHIFT;<br>
- table->SamuLevel[count].MinVoltage |= ((mm_table->entries[count].vddc -<br>
- VDDC_VDDCI_DELTA) * VOLTAGE_SCALE) << VDDCI_SHIFT;<br>
- table->SamuLevel[count].MinVoltage |= 1 << PHASES_SHIFT;<br>
-<br>
- /* retrieve divider value for VBIOS */<br>
- result = atomctrl_get_dfs_pll_dividers_vi(hwmgr,<br>
- table->SamuLevel[count].Frequency, ÷rs);<br>
- PP_ASSERT_WITH_CODE((0 == result),<br>
- "can not find divide id for samu clock", return result);<br>
-<br>
- table->SamuLevel[count].Divider = (uint8_t)dividers.pll_post_divider;<br>
-<br>
- CONVERT_FROM_HOST_TO_SMC_UL(table->SamuLevel[count].Frequency);<br>
- CONVERT_FROM_HOST_TO_SMC_UL(table->SamuLevel[count].MinVoltage);<br>
- }<br>
- return result;<br>
-}<br>
-<br>
static int fiji_populate_memory_timing_parameters(struct pp_hwmgr *hwmgr,<br>
int32_t eng_clock, int32_t mem_clock,<br>
struct SMU73_Discrete_MCArbDramTimingTableEntry *arb_regs)<br>
@@ -2028,10 +1990,6 @@ static int fiji_init_smc_table(struct pp_hwmgr *hwmgr)<br>
PP_ASSERT_WITH_CODE(0 == result,<br>
"Failed to initialize ACP Level!", return result);<br>
<br>
- result = fiji_populate_smc_samu_level(hwmgr, table);<br>
- PP_ASSERT_WITH_CODE(0 == result,<br>
- "Failed to initialize SAMU Level!", return result);<br>
-<br>
/* Since only the initial state is completely set up at this point<br>
* (the other states are just copies of the boot state) we only<br>
* need to populate the ARB settings for the initial state.<br>
@@ -2378,8 +2336,6 @@ static uint32_t fiji_get_offsetof(uint32_t type, uint32_t member)<br>
return offsetof(SMU73_Discrete_DpmTable, UvdBootLevel);<br>
case VceBootLevel:<br>
return offsetof(SMU73_Discrete_DpmTable, VceBootLevel);<br>
- case SamuBootLevel:<br>
- return offsetof(SMU73_Discrete_DpmTable, SamuBootLevel);<br>
case LowSclkInterruptThreshold:<br>
return offsetof(SMU73_Discrete_DpmTable, LowSclkInterruptThreshold);<br>
}<br>
@@ -2478,33 +2434,6 @@ static int fiji_update_vce_smc_table(struct pp_hwmgr *hwmgr)<br>
return 0;<br>
}<br>
<br>
-static int fiji_update_samu_smc_table(struct pp_hwmgr *hwmgr)<br>
-{<br>
- struct fiji_smumgr *smu_data = (struct fiji_smumgr *)(hwmgr->smu_backend);<br>
- uint32_t mm_boot_level_offset, mm_boot_level_value;<br>
-<br>
-<br>
- smu_data->smc_state_table.SamuBootLevel = 0;<br>
- mm_boot_level_offset = smu_data->smu7_data.dpm_table_start +<br>
- offsetof(SMU73_Discrete_DpmTable, SamuBootLevel);<br>
-<br>
- mm_boot_level_offset /= 4;<br>
- mm_boot_level_offset *= 4;<br>
- mm_boot_level_value = cgs_read_ind_register(hwmgr->device,<br>
- CGS_IND_REG__SMC, mm_boot_level_offset);<br>
- mm_boot_level_value &= 0xFFFFFF00;<br>
- mm_boot_level_value |= smu_data->smc_state_table.SamuBootLevel << 0;<br>
- cgs_write_ind_register(hwmgr->device,<br>
- CGS_IND_REG__SMC, mm_boot_level_offset, mm_boot_level_value);<br>
-<br>
- if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,<br>
- PHM_PlatformCaps_StablePState))<br>
- smum_send_msg_to_smc_with_parameter(hwmgr,<br>
- PPSMC_MSG_SAMUDPM_SetEnabledMask,<br>
- (uint32_t)(1 << smu_data->smc_state_table.SamuBootLevel));<br>
- return 0;<br>
-}<br>
-<br>
static int fiji_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)<br>
{<br>
switch (type) {<br>
@@ -2514,9 +2443,6 @@ static int fiji_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)<br>
case SMU_VCE_TABLE:<br>
fiji_update_vce_smc_table(hwmgr);<br>
break;<br>
- case SMU_SAMU_TABLE:<br>
- fiji_update_samu_smc_table(hwmgr);<br>
- break;<br>
default:<br>
break;<br>
}<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c<br>
index 415f691..9299b93 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c<br>
@@ -1578,12 +1578,6 @@ static int iceland_populate_smc_acp_level(struct pp_hwmgr *hwmgr,<br>
return 0;<br>
}<br>
<br>
-static int iceland_populate_smc_samu_level(struct pp_hwmgr *hwmgr,<br>
- SMU71_Discrete_DpmTable *table)<br>
-{<br>
- return 0;<br>
-}<br>
-<br>
static int iceland_populate_memory_timing_parameters(<br>
struct pp_hwmgr *hwmgr,<br>
uint32_t engine_clock,<br>
@@ -1992,10 +1986,6 @@ static int iceland_init_smc_table(struct pp_hwmgr *hwmgr)<br>
PP_ASSERT_WITH_CODE(0 == result,<br>
"Failed to initialize ACP Level!", return result;);<br>
<br>
- result = iceland_populate_smc_samu_level(hwmgr, table);<br>
- PP_ASSERT_WITH_CODE(0 == result,<br>
- "Failed to initialize SAMU Level!", return result;);<br>
-<br>
/* Since only the initial state is completely set up at this point (the other states are just copies of the boot state) we only */<br>
/* need to populate the ARB settings for the initial state. */<br>
result = iceland_program_memory_timing_parameters(hwmgr);<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
index a8c6524..a4ce199 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
@@ -1337,55 +1337,6 @@ static int polaris10_populate_smc_vce_level(struct pp_hwmgr *hwmgr,<br>
return result;<br>
}<br>
<br>
-<br>
-static int polaris10_populate_smc_samu_level(struct pp_hwmgr *hwmgr,<br>
- SMU74_Discrete_DpmTable *table)<br>
-{<br>
- int result = -EINVAL;<br>
- uint8_t count;<br>
- struct pp_atomctrl_clock_dividers_vi dividers;<br>
- struct phm_ppt_v1_information *table_info =<br>
- (struct phm_ppt_v1_information *)(hwmgr->pptable);<br>
- struct phm_ppt_v1_mm_clock_voltage_dependency_table *mm_table =<br>
- table_info->mm_dep_table;<br>
- struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);<br>
- uint32_t vddci;<br>
-<br>
- table->SamuBootLevel = 0;<br>
- table->SamuLevelCount = (uint8_t)(mm_table->count);<br>
-<br>
- for (count = 0; count < table->SamuLevelCount; count++) {<br>
- /* not sure whether we need evclk or not */<br>
- table->SamuLevel[count].MinVoltage = 0;<br>
- table->SamuLevel[count].Frequency = mm_table->entries[count].samclock;<br>
- table->SamuLevel[count].MinVoltage |= (mm_table->entries[count].vddc *<br>
- VOLTAGE_SCALE) << VDDC_SHIFT;<br>
-<br>
- if (SMU7_VOLTAGE_CONTROL_BY_GPIO == data->vddci_control)<br>
- vddci = (uint32_t)phm_find_closest_vddci(&(data->vddci_voltage_table),<br>
- mm_table->entries[count].vddc - VDDC_VDDCI_DELTA);<br>
- else if (SMU7_VOLTAGE_CONTROL_BY_SVID2 == data->vddci_control)<br>
- vddci = mm_table->entries[count].vddc - VDDC_VDDCI_DELTA;<br>
- else<br>
- vddci = (data->vbios_boot_state.vddci_bootup_value * VOLTAGE_SCALE) << VDDCI_SHIFT;<br>
-<br>
- table->SamuLevel[count].MinVoltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;<br>
- table->SamuLevel[count].MinVoltage |= 1 << PHASES_SHIFT;<br>
-<br>
- /* retrieve divider value for VBIOS */<br>
- result = atomctrl_get_dfs_pll_dividers_vi(hwmgr,<br>
- table->SamuLevel[count].Frequency, ÷rs);<br>
- PP_ASSERT_WITH_CODE((0 == result),<br>
- "can not find divide id for samu clock", return result);<br>
-<br>
- table->SamuLevel[count].Divider = (uint8_t)dividers.pll_post_divider;<br>
-<br>
- CONVERT_FROM_HOST_TO_SMC_UL(table->SamuLevel[count].Frequency);<br>
- CONVERT_FROM_HOST_TO_SMC_UL(table->SamuLevel[count].MinVoltage);<br>
- }<br>
- return result;<br>
-}<br>
-<br>
static int polaris10_populate_memory_timing_parameters(struct pp_hwmgr *hwmgr,<br>
int32_t eng_clock, int32_t mem_clock,<br>
SMU74_Discrete_MCArbDramTimingTableEntry *arb_regs)<br>
@@ -1865,10 +1816,6 @@ static int polaris10_init_smc_table(struct pp_hwmgr *hwmgr)<br>
PP_ASSERT_WITH_CODE(0 == result,<br>
"Failed to initialize VCE Level!", return result);<br>
<br>
- result = polaris10_populate_smc_samu_level(hwmgr, table);<br>
- PP_ASSERT_WITH_CODE(0 == result,<br>
- "Failed to initialize SAMU Level!", return result);<br>
-<br>
/* Since only the initial state is completely set up at this point<br>
* (the other states are just copies of the boot state) we only<br>
* need to populate the ARB settings for the initial state.<br>
@@ -2222,34 +2169,6 @@ static int polaris10_update_vce_smc_table(struct pp_hwmgr *hwmgr)<br>
return 0;<br>
}<br>
<br>
-static int polaris10_update_samu_smc_table(struct pp_hwmgr *hwmgr)<br>
-{<br>
- struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(hwmgr->smu_backend);<br>
- uint32_t mm_boot_level_offset, mm_boot_level_value;<br>
-<br>
-<br>
- smu_data->smc_state_table.SamuBootLevel = 0;<br>
- mm_boot_level_offset = smu_data->smu7_data.dpm_table_start +<br>
- offsetof(SMU74_Discrete_DpmTable, SamuBootLevel);<br>
-<br>
- mm_boot_level_offset /= 4;<br>
- mm_boot_level_offset *= 4;<br>
- mm_boot_level_value = cgs_read_ind_register(hwmgr->device,<br>
- CGS_IND_REG__SMC, mm_boot_level_offset);<br>
- mm_boot_level_value &= 0xFFFFFF00;<br>
- mm_boot_level_value |= smu_data->smc_state_table.SamuBootLevel << 0;<br>
- cgs_write_ind_register(hwmgr->device,<br>
- CGS_IND_REG__SMC, mm_boot_level_offset, mm_boot_level_value);<br>
-<br>
- if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,<br>
- PHM_PlatformCaps_StablePState))<br>
- smum_send_msg_to_smc_with_parameter(hwmgr,<br>
- PPSMC_MSG_SAMUDPM_SetEnabledMask,<br>
- (uint32_t)(1 << smu_data->smc_state_table.SamuBootLevel));<br>
- return 0;<br>
-}<br>
-<br>
-<br>
static int polaris10_update_bif_smc_table(struct pp_hwmgr *hwmgr)<br>
{<br>
struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)(hwmgr->smu_backend);<br>
@@ -2276,9 +2195,6 @@ static int polaris10_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)<br>
case SMU_VCE_TABLE:<br>
polaris10_update_vce_smc_table(hwmgr);<br>
break;<br>
- case SMU_SAMU_TABLE:<br>
- polaris10_update_samu_smc_table(hwmgr);<br>
- break;<br>
case SMU_BIF_TABLE:<br>
polaris10_update_bif_smc_table(hwmgr);<br>
default:<br>
@@ -2357,8 +2273,6 @@ static uint32_t polaris10_get_offsetof(uint32_t type, uint32_t member)<br>
return offsetof(SMU74_Discrete_DpmTable, UvdBootLevel);<br>
case VceBootLevel:<br>
return offsetof(SMU74_Discrete_DpmTable, VceBootLevel);<br>
- case SamuBootLevel:<br>
- return offsetof(SMU74_Discrete_DpmTable, SamuBootLevel);<br>
case LowSclkInterruptThreshold:<br>
return offsetof(SMU74_Discrete_DpmTable, LowSclkInterruptThreshold);<br>
}<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
index 782b19f..7dabc6c 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
@@ -1443,51 +1443,6 @@ static int tonga_populate_smc_acp_level(struct pp_hwmgr *hwmgr,<br>
return result;<br>
}<br>
<br>
-static int tonga_populate_smc_samu_level(struct pp_hwmgr *hwmgr,<br>
- SMU72_Discrete_DpmTable *table)<br>
-{<br>
- int result = 0;<br>
- uint8_t count;<br>
- pp_atomctrl_clock_dividers_vi dividers;<br>
- struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);<br>
- struct phm_ppt_v1_information *pptable_info =<br>
- (struct phm_ppt_v1_information *)(hwmgr->pptable);<br>
- phm_ppt_v1_mm_clock_voltage_dependency_table *mm_table =<br>
- pptable_info->mm_dep_table;<br>
-<br>
- table->SamuBootLevel = 0;<br>
- table->SamuLevelCount = (uint8_t) (mm_table->count);<br>
-<br>
- for (count = 0; count < table->SamuLevelCount; count++) {<br>
- /* not sure whether we need evclk or not */<br>
- table->SamuLevel[count].Frequency =<br>
- pptable_info->mm_dep_table->entries[count].samclock;<br>
- table->SamuLevel[count].MinVoltage.Vddc =<br>
- phm_get_voltage_index(pptable_info->vddc_lookup_table,<br>
- mm_table->entries[count].vddc);<br>
- table->SamuLevel[count].MinVoltage.VddGfx =<br>
- (data->vdd_gfx_control == SMU7_VOLTAGE_CONTROL_BY_SVID2) ?<br>
- phm_get_voltage_index(pptable_info->vddgfx_lookup_table,<br>
- mm_table->entries[count].vddgfx) : 0;<br>
- table->SamuLevel[count].MinVoltage.Vddci =<br>
- phm_get_voltage_id(&data->vddci_voltage_table,<br>
- mm_table->entries[count].vddc - VDDC_VDDCI_DELTA);<br>
- table->SamuLevel[count].MinVoltage.Phases = 1;<br>
-<br>
- /* retrieve divider value for VBIOS */<br>
- result = atomctrl_get_dfs_pll_dividers_vi(hwmgr,<br>
- table->SamuLevel[count].Frequency, ÷rs);<br>
- PP_ASSERT_WITH_CODE((!result),<br>
- "can not find divide id for samu clock", return result);<br>
-<br>
- table->SamuLevel[count].Divider = (uint8_t)dividers.pll_post_divider;<br>
-<br>
- CONVERT_FROM_HOST_TO_SMC_UL(table->SamuLevel[count].Frequency);<br>
- }<br>
-<br>
- return result;<br>
-}<br>
-<br>
static int tonga_populate_memory_timing_parameters(<br>
struct pp_hwmgr *hwmgr,<br>
uint32_t engine_clock,<br>
@@ -2323,10 +2278,6 @@ static int tonga_init_smc_table(struct pp_hwmgr *hwmgr)<br>
PP_ASSERT_WITH_CODE(!result,<br>
"Failed to initialize ACP Level !", return result);<br>
<br>
- result = tonga_populate_smc_samu_level(hwmgr, table);<br>
- PP_ASSERT_WITH_CODE(!result,<br>
- "Failed to initialize SAMU Level !", return result);<br>
-<br>
/* Since only the initial state is completely set up at this<br>
* point (the other states are just copies of the boot state) we only<br>
* need to populate the ARB settings for the initial state.<br>
@@ -2673,8 +2624,6 @@ static uint32_t tonga_get_offsetof(uint32_t type, uint32_t member)<br>
return offsetof(SMU72_Discrete_DpmTable, UvdBootLevel);<br>
case VceBootLevel:<br>
return offsetof(SMU72_Discrete_DpmTable, VceBootLevel);<br>
- case SamuBootLevel:<br>
- return offsetof(SMU72_Discrete_DpmTable, SamuBootLevel);<br>
case LowSclkInterruptThreshold:<br>
return offsetof(SMU72_Discrete_DpmTable, LowSclkInterruptThreshold);<br>
}<br>
@@ -2773,32 +2722,6 @@ static int tonga_update_vce_smc_table(struct pp_hwmgr *hwmgr)<br>
return 0;<br>
}<br>
<br>
-static int tonga_update_samu_smc_table(struct pp_hwmgr *hwmgr)<br>
-{<br>
- struct tonga_smumgr *smu_data = (struct tonga_smumgr *)(hwmgr->smu_backend);<br>
- uint32_t mm_boot_level_offset, mm_boot_level_value;<br>
-<br>
- smu_data->smc_state_table.SamuBootLevel = 0;<br>
- mm_boot_level_offset = smu_data->smu7_data.dpm_table_start +<br>
- offsetof(SMU72_Discrete_DpmTable, SamuBootLevel);<br>
-<br>
- mm_boot_level_offset /= 4;<br>
- mm_boot_level_offset *= 4;<br>
- mm_boot_level_value = cgs_read_ind_register(hwmgr->device,<br>
- CGS_IND_REG__SMC, mm_boot_level_offset);<br>
- mm_boot_level_value &= 0xFFFFFF00;<br>
- mm_boot_level_value |= smu_data->smc_state_table.SamuBootLevel << 0;<br>
- cgs_write_ind_register(hwmgr->device,<br>
- CGS_IND_REG__SMC, mm_boot_level_offset, mm_boot_level_value);<br>
-<br>
- if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,<br>
- PHM_PlatformCaps_StablePState))<br>
- smum_send_msg_to_smc_with_parameter(hwmgr,<br>
- PPSMC_MSG_SAMUDPM_SetEnabledMask,<br>
- (uint32_t)(1 << smu_data->smc_state_table.SamuBootLevel));<br>
- return 0;<br>
-}<br>
-<br>
static int tonga_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)<br>
{<br>
switch (type) {<br>
@@ -2808,9 +2731,6 @@ static int tonga_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)<br>
case SMU_VCE_TABLE:<br>
tonga_update_vce_smc_table(hwmgr);<br>
break;<br>
- case SMU_SAMU_TABLE:<br>
- tonga_update_samu_smc_table(hwmgr);<br>
- break;<br>
default:<br>
break;<br>
}<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c<br>
index 2de4895..57420d7 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c<br>
@@ -393,34 +393,6 @@ static int vegam_update_vce_smc_table(struct pp_hwmgr *hwmgr)<br>
return 0;<br>
}<br>
<br>
-static int vegam_update_samu_smc_table(struct pp_hwmgr *hwmgr)<br>
-{<br>
- struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend);<br>
- uint32_t mm_boot_level_offset, mm_boot_level_value;<br>
-<br>
-<br>
- smu_data->smc_state_table.SamuBootLevel = 0;<br>
- mm_boot_level_offset = smu_data->smu7_data.dpm_table_start +<br>
- offsetof(SMU75_Discrete_DpmTable, SamuBootLevel);<br>
-<br>
- mm_boot_level_offset /= 4;<br>
- mm_boot_level_offset *= 4;<br>
- mm_boot_level_value = cgs_read_ind_register(hwmgr->device,<br>
- CGS_IND_REG__SMC, mm_boot_level_offset);<br>
- mm_boot_level_value &= 0xFFFFFF00;<br>
- mm_boot_level_value |= smu_data->smc_state_table.SamuBootLevel << 0;<br>
- cgs_write_ind_register(hwmgr->device,<br>
- CGS_IND_REG__SMC, mm_boot_level_offset, mm_boot_level_value);<br>
-<br>
- if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,<br>
- PHM_PlatformCaps_StablePState))<br>
- smum_send_msg_to_smc_with_parameter(hwmgr,<br>
- PPSMC_MSG_SAMUDPM_SetEnabledMask,<br>
- (uint32_t)(1 << smu_data->smc_state_table.SamuBootLevel));<br>
- return 0;<br>
-}<br>
-<br>
-<br>
static int vegam_update_bif_smc_table(struct pp_hwmgr *hwmgr)<br>
{<br>
struct vegam_smumgr *smu_data = (struct vegam_smumgr *)(hwmgr->smu_backend);<br>
@@ -447,9 +419,6 @@ static int vegam_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)<br>
case SMU_VCE_TABLE:<br>
vegam_update_vce_smc_table(hwmgr);<br>
break;<br>
- case SMU_SAMU_TABLE:<br>
- vegam_update_samu_smc_table(hwmgr);<br>
- break;<br>
case SMU_BIF_TABLE:<br>
vegam_update_bif_smc_table(hwmgr);<br>
break;<br>
@@ -1281,54 +1250,6 @@ static int vegam_populate_smc_vce_level(struct pp_hwmgr *hwmgr,<br>
return result;<br>
}<br>
<br>
-static int vegam_populate_smc_samu_level(struct pp_hwmgr *hwmgr,<br>
- SMU75_Discrete_DpmTable *table)<br>
-{<br>
- int result = -EINVAL;<br>
- uint8_t count;<br>
- struct pp_atomctrl_clock_dividers_vi dividers;<br>
- struct phm_ppt_v1_information *table_info =<br>
- (struct phm_ppt_v1_information *)(hwmgr->pptable);<br>
- struct phm_ppt_v1_mm_clock_voltage_dependency_table *mm_table =<br>
- table_info->mm_dep_table;<br>
- struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);<br>
- uint32_t vddci;<br>
-<br>
- table->SamuBootLevel = 0;<br>
- table->SamuLevelCount = (uint8_t)(mm_table->count);<br>
-<br>
- for (count = 0; count < table->SamuLevelCount; count++) {<br>
- /* not sure whether we need evclk or not */<br>
- table->SamuLevel[count].MinVoltage = 0;<br>
- table->SamuLevel[count].Frequency = mm_table->entries[count].samclock;<br>
- table->SamuLevel[count].MinVoltage |= (mm_table->entries[count].vddc *<br>
- VOLTAGE_SCALE) << VDDC_SHIFT;<br>
-<br>
- if (SMU7_VOLTAGE_CONTROL_BY_GPIO == data->vddci_control)<br>
- vddci = (uint32_t)phm_find_closest_vddci(&(data->vddci_voltage_table),<br>
- mm_table->entries[count].vddc - VDDC_VDDCI_DELTA);<br>
- else if (SMU7_VOLTAGE_CONTROL_BY_SVID2 == data->vddci_control)<br>
- vddci = mm_table->entries[count].vddc - VDDC_VDDCI_DELTA;<br>
- else<br>
- vddci = (data->vbios_boot_state.vddci_bootup_value * VOLTAGE_SCALE) << VDDCI_SHIFT;<br>
-<br>
- table->SamuLevel[count].MinVoltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;<br>
- table->SamuLevel[count].MinVoltage |= 1 << PHASES_SHIFT;<br>
-<br>
- /* retrieve divider value for VBIOS */<br>
- result = atomctrl_get_dfs_pll_dividers_vi(hwmgr,<br>
- table->SamuLevel[count].Frequency, ÷rs);<br>
- PP_ASSERT_WITH_CODE((0 == result),<br>
- "can not find divide id for samu clock", return result);<br>
-<br>
- table->SamuLevel[count].Divider = (uint8_t)dividers.pll_post_divider;<br>
-<br>
- CONVERT_FROM_HOST_TO_SMC_UL(table->SamuLevel[count].Frequency);<br>
- CONVERT_FROM_HOST_TO_SMC_UL(table->SamuLevel[count].MinVoltage);<br>
- }<br>
- return result;<br>
-}<br>
-<br>
static int vegam_populate_memory_timing_parameters(struct pp_hwmgr *hwmgr,<br>
int32_t eng_clock, int32_t mem_clock,<br>
SMU75_Discrete_MCArbDramTimingTableEntry *arb_regs)<br>
@@ -2062,10 +1983,6 @@ static int vegam_init_smc_table(struct pp_hwmgr *hwmgr)<br>
PP_ASSERT_WITH_CODE(!result,<br>
"Failed to initialize VCE Level!", return result);<br>
<br>
- result = vegam_populate_smc_samu_level(hwmgr, table);<br>
- PP_ASSERT_WITH_CODE(!result,<br>
- "Failed to initialize SAMU Level!", return result);<br>
-<br>
/* Since only the initial state is completely set up at this point<br>
* (the other states are just copies of the boot state) we only<br>
* need to populate the ARB settings for the initial state.<br>
@@ -2273,8 +2190,6 @@ static uint32_t vegam_get_offsetof(uint32_t type, uint32_t member)<br>
return offsetof(SMU75_Discrete_DpmTable, UvdBootLevel);<br>
case VceBootLevel:<br>
return offsetof(SMU75_Discrete_DpmTable, VceBootLevel);<br>
- case SamuBootLevel:<br>
- return offsetof(SMU75_Discrete_DpmTable, SamuBootLevel);<br>
case LowSclkInterruptThreshold:<br>
return offsetof(SMU75_Discrete_DpmTable, LowSclkInterruptThreshold);<br>
}<br>
-- <br>
1.9.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>