Commit 04c572a0 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: issue DC-BTC for arcturus on SMU init

Need to perform DC-BTC for arcturus on bootup.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarKevin Wang <kevin1.wang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4d1337d2
...@@ -1079,8 +1079,8 @@ static int smu_smc_table_hw_init(struct smu_context *smu, ...@@ -1079,8 +1079,8 @@ static int smu_smc_table_hw_init(struct smu_context *smu,
if (ret) if (ret)
return ret; return ret;
/* issue RunAfllBtc msg */ /* issue Run*Btc msg */
ret = smu_run_afll_btc(smu); ret = smu_run_btc(smu);
if (ret) if (ret)
return ret; return ret;
......
...@@ -112,8 +112,7 @@ static struct smu_11_0_cmn2aisc_mapping arcturus_message_map[SMU_MSG_MAX_COUNT] ...@@ -112,8 +112,7 @@ static struct smu_11_0_cmn2aisc_mapping arcturus_message_map[SMU_MSG_MAX_COUNT]
MSG_MAP(PrepareMp1ForShutdown, PPSMC_MSG_PrepareMp1ForShutdown), MSG_MAP(PrepareMp1ForShutdown, PPSMC_MSG_PrepareMp1ForShutdown),
MSG_MAP(SoftReset, PPSMC_MSG_SoftReset), MSG_MAP(SoftReset, PPSMC_MSG_SoftReset),
MSG_MAP(RunAfllBtc, PPSMC_MSG_RunAfllBtc), MSG_MAP(RunAfllBtc, PPSMC_MSG_RunAfllBtc),
MSG_MAP(RunGfxDcBtc, PPSMC_MSG_RunGfxDcBtc), MSG_MAP(RunDcBtc, PPSMC_MSG_RunDcBtc),
MSG_MAP(RunSocDcBtc, PPSMC_MSG_RunSocDcBtc),
MSG_MAP(DramLogSetDramAddrHigh, PPSMC_MSG_DramLogSetDramAddrHigh), MSG_MAP(DramLogSetDramAddrHigh, PPSMC_MSG_DramLogSetDramAddrHigh),
MSG_MAP(DramLogSetDramAddrLow, PPSMC_MSG_DramLogSetDramAddrLow), MSG_MAP(DramLogSetDramAddrLow, PPSMC_MSG_DramLogSetDramAddrLow),
MSG_MAP(DramLogSetDramSize, PPSMC_MSG_DramLogSetDramSize), MSG_MAP(DramLogSetDramSize, PPSMC_MSG_DramLogSetDramSize),
...@@ -528,9 +527,17 @@ static int arcturus_append_powerplay_table(struct smu_context *smu) ...@@ -528,9 +527,17 @@ static int arcturus_append_powerplay_table(struct smu_context *smu)
return 0; return 0;
} }
static int arcturus_run_btc_afll(struct smu_context *smu) static int arcturus_run_btc(struct smu_context *smu)
{ {
return smu_send_smc_msg(smu, SMU_MSG_RunAfllBtc); int ret = 0;
ret = smu_send_smc_msg(smu, SMU_MSG_RunAfllBtc);
if (ret) {
pr_err("RunAfllBtc failed!\n");
return ret;
}
return smu_send_smc_msg(smu, SMU_MSG_RunDcBtc);
} }
static int arcturus_populate_umd_state_clk(struct smu_context *smu) static int arcturus_populate_umd_state_clk(struct smu_context *smu)
...@@ -1907,7 +1914,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = { ...@@ -1907,7 +1914,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = {
/* init dpm */ /* init dpm */
.get_allowed_feature_mask = arcturus_get_allowed_feature_mask, .get_allowed_feature_mask = arcturus_get_allowed_feature_mask,
/* btc */ /* btc */
.run_afll_btc = arcturus_run_btc_afll, .run_btc = arcturus_run_btc,
/* dpm/clk tables */ /* dpm/clk tables */
.set_default_dpm_table = arcturus_set_default_dpm_table, .set_default_dpm_table = arcturus_set_default_dpm_table,
.populate_umd_state_clk = arcturus_populate_umd_state_clk, .populate_umd_state_clk = arcturus_populate_umd_state_clk,
......
...@@ -396,7 +396,7 @@ struct pptable_funcs { ...@@ -396,7 +396,7 @@ struct pptable_funcs {
int (*get_smu_table_index)(struct smu_context *smu, uint32_t index); int (*get_smu_table_index)(struct smu_context *smu, uint32_t index);
int (*get_smu_power_index)(struct smu_context *smu, uint32_t index); int (*get_smu_power_index)(struct smu_context *smu, uint32_t index);
int (*get_workload_type)(struct smu_context *smu, enum PP_SMC_POWER_PROFILE profile); int (*get_workload_type)(struct smu_context *smu, enum PP_SMC_POWER_PROFILE profile);
int (*run_afll_btc)(struct smu_context *smu); int (*run_btc)(struct smu_context *smu);
int (*get_allowed_feature_mask)(struct smu_context *smu, uint32_t *feature_mask, uint32_t num); int (*get_allowed_feature_mask)(struct smu_context *smu, uint32_t *feature_mask, uint32_t num);
enum amd_pm_state_type (*get_current_power_state)(struct smu_context *smu); enum amd_pm_state_type (*get_current_power_state)(struct smu_context *smu);
int (*set_default_dpm_table)(struct smu_context *smu); int (*set_default_dpm_table)(struct smu_context *smu);
...@@ -696,8 +696,8 @@ struct smu_funcs ...@@ -696,8 +696,8 @@ struct smu_funcs
((smu)->ppt_funcs? ((smu)->ppt_funcs->get_smu_power_index? (smu)->ppt_funcs->get_smu_power_index((smu), (src)) : -EINVAL) : -EINVAL) ((smu)->ppt_funcs? ((smu)->ppt_funcs->get_smu_power_index? (smu)->ppt_funcs->get_smu_power_index((smu), (src)) : -EINVAL) : -EINVAL)
#define smu_workload_get_type(smu, profile) \ #define smu_workload_get_type(smu, profile) \
((smu)->ppt_funcs? ((smu)->ppt_funcs->get_workload_type? (smu)->ppt_funcs->get_workload_type((smu), (profile)) : -EINVAL) : -EINVAL) ((smu)->ppt_funcs? ((smu)->ppt_funcs->get_workload_type? (smu)->ppt_funcs->get_workload_type((smu), (profile)) : -EINVAL) : -EINVAL)
#define smu_run_afll_btc(smu) \ #define smu_run_btc(smu) \
((smu)->ppt_funcs? ((smu)->ppt_funcs->run_afll_btc? (smu)->ppt_funcs->run_afll_btc((smu)) : 0) : 0) ((smu)->ppt_funcs? ((smu)->ppt_funcs->run_btc? (smu)->ppt_funcs->run_btc((smu)) : 0) : 0)
#define smu_get_allowed_feature_mask(smu, feature_mask, num) \ #define smu_get_allowed_feature_mask(smu, feature_mask, num) \
((smu)->ppt_funcs? ((smu)->ppt_funcs->get_allowed_feature_mask? (smu)->ppt_funcs->get_allowed_feature_mask((smu), (feature_mask), (num)) : 0) : 0) ((smu)->ppt_funcs? ((smu)->ppt_funcs->get_allowed_feature_mask? (smu)->ppt_funcs->get_allowed_feature_mask((smu), (feature_mask), (num)) : 0) : 0)
#define smu_set_deep_sleep_dcefclk(smu, clk) \ #define smu_set_deep_sleep_dcefclk(smu, clk) \
......
...@@ -95,8 +95,7 @@ ...@@ -95,8 +95,7 @@
//BTC //BTC
#define PPSMC_MSG_RunAfllBtc 0x30 #define PPSMC_MSG_RunAfllBtc 0x30
#define PPSMC_MSG_RunGfxDcBtc 0x31 #define PPSMC_MSG_RunDcBtc 0x31
#define PPSMC_MSG_RunSocDcBtc 0x32
//Debug //Debug
#define PPSMC_MSG_DramLogSetDramAddrHigh 0x33 #define PPSMC_MSG_DramLogSetDramAddrHigh 0x33
......
...@@ -114,6 +114,7 @@ ...@@ -114,6 +114,7 @@
__SMU_DUMMY_MAP(PowerDownJpeg), \ __SMU_DUMMY_MAP(PowerDownJpeg), \
__SMU_DUMMY_MAP(BacoAudioD3PME), \ __SMU_DUMMY_MAP(BacoAudioD3PME), \
__SMU_DUMMY_MAP(ArmD3), \ __SMU_DUMMY_MAP(ArmD3), \
__SMU_DUMMY_MAP(RunDcBtc), \
__SMU_DUMMY_MAP(RunGfxDcBtc), \ __SMU_DUMMY_MAP(RunGfxDcBtc), \
__SMU_DUMMY_MAP(RunSocDcBtc), \ __SMU_DUMMY_MAP(RunSocDcBtc), \
__SMU_DUMMY_MAP(SetMemoryChannelEnable), \ __SMU_DUMMY_MAP(SetMemoryChannelEnable), \
......
...@@ -3145,7 +3145,7 @@ static const struct pptable_funcs vega20_ppt_funcs = { ...@@ -3145,7 +3145,7 @@ static const struct pptable_funcs vega20_ppt_funcs = {
.get_smu_table_index = vega20_get_smu_table_index, .get_smu_table_index = vega20_get_smu_table_index,
.get_smu_power_index = vega20_get_pwr_src_index, .get_smu_power_index = vega20_get_pwr_src_index,
.get_workload_type = vega20_get_workload_type, .get_workload_type = vega20_get_workload_type,
.run_afll_btc = vega20_run_btc_afll, .run_btc = vega20_run_btc_afll,
.get_allowed_feature_mask = vega20_get_allowed_feature_mask, .get_allowed_feature_mask = vega20_get_allowed_feature_mask,
.get_current_power_state = vega20_get_current_power_state, .get_current_power_state = vega20_get_current_power_state,
.set_default_dpm_table = vega20_set_default_dpm_table, .set_default_dpm_table = vega20_set_default_dpm_table,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment