Commit a0ec2256 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: unified interfaces for message issuing and response checking

This can avoid potential race condition between them.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarKenneth Feng <kenneth.feng@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5964f3fe
...@@ -29,14 +29,16 @@ static int smu7_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable) ...@@ -29,14 +29,16 @@ static int smu7_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable)
{ {
return smum_send_msg_to_smc(hwmgr, enable ? return smum_send_msg_to_smc(hwmgr, enable ?
PPSMC_MSG_UVDDPM_Enable : PPSMC_MSG_UVDDPM_Enable :
PPSMC_MSG_UVDDPM_Disable); PPSMC_MSG_UVDDPM_Disable,
NULL);
} }
static int smu7_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable) static int smu7_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable)
{ {
return smum_send_msg_to_smc(hwmgr, enable ? return smum_send_msg_to_smc(hwmgr, enable ?
PPSMC_MSG_VCEDPM_Enable : PPSMC_MSG_VCEDPM_Enable :
PPSMC_MSG_VCEDPM_Disable); PPSMC_MSG_VCEDPM_Disable,
NULL);
} }
static int smu7_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate) static int smu7_update_uvd_dpm(struct pp_hwmgr *hwmgr, bool bgate)
...@@ -57,7 +59,8 @@ int smu7_powerdown_uvd(struct pp_hwmgr *hwmgr) ...@@ -57,7 +59,8 @@ int smu7_powerdown_uvd(struct pp_hwmgr *hwmgr)
{ {
if (phm_cf_want_uvd_power_gating(hwmgr)) if (phm_cf_want_uvd_power_gating(hwmgr))
return smum_send_msg_to_smc(hwmgr, return smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_UVDPowerOFF); PPSMC_MSG_UVDPowerOFF,
NULL);
return 0; return 0;
} }
...@@ -67,10 +70,10 @@ static int smu7_powerup_uvd(struct pp_hwmgr *hwmgr) ...@@ -67,10 +70,10 @@ static int smu7_powerup_uvd(struct pp_hwmgr *hwmgr)
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_UVDDynamicPowerGating)) { PHM_PlatformCaps_UVDDynamicPowerGating)) {
return smum_send_msg_to_smc_with_parameter(hwmgr, return smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_UVDPowerON, 1); PPSMC_MSG_UVDPowerON, 1, NULL);
} else { } else {
return smum_send_msg_to_smc_with_parameter(hwmgr, return smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_UVDPowerON, 0); PPSMC_MSG_UVDPowerON, 0, NULL);
} }
} }
...@@ -81,7 +84,8 @@ static int smu7_powerdown_vce(struct pp_hwmgr *hwmgr) ...@@ -81,7 +84,8 @@ static int smu7_powerdown_vce(struct pp_hwmgr *hwmgr)
{ {
if (phm_cf_want_vce_power_gating(hwmgr)) if (phm_cf_want_vce_power_gating(hwmgr))
return smum_send_msg_to_smc(hwmgr, return smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_VCEPowerOFF); PPSMC_MSG_VCEPowerOFF,
NULL);
return 0; return 0;
} }
...@@ -89,7 +93,8 @@ static int smu7_powerup_vce(struct pp_hwmgr *hwmgr) ...@@ -89,7 +93,8 @@ static int smu7_powerup_vce(struct pp_hwmgr *hwmgr)
{ {
if (phm_cf_want_vce_power_gating(hwmgr)) if (phm_cf_want_vce_power_gating(hwmgr))
return smum_send_msg_to_smc(hwmgr, return smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_VCEPowerON); PPSMC_MSG_VCEPowerON,
NULL);
return 0; return 0;
} }
...@@ -181,7 +186,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -181,7 +186,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_GFX_CGCG_MASK; value = CG_GFX_CGCG_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
if (PP_STATE_SUPPORT_LS & *msg_id) { if (PP_STATE_SUPPORT_LS & *msg_id) {
...@@ -191,7 +196,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -191,7 +196,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_GFX_CGLS_MASK; value = CG_GFX_CGLS_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -204,7 +209,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -204,7 +209,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_GFX_3DCG_MASK; value = CG_GFX_3DCG_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
...@@ -215,7 +220,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -215,7 +220,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_GFX_3DLS_MASK; value = CG_GFX_3DLS_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -228,7 +233,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -228,7 +233,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_GFX_RLC_LS_MASK; value = CG_GFX_RLC_LS_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -241,7 +246,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -241,7 +246,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_GFX_CP_LS_MASK; value = CG_GFX_CP_LS_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -255,7 +260,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -255,7 +260,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
CG_GFX_OTHERS_MGCG_MASK); CG_GFX_OTHERS_MGCG_MASK);
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -275,7 +280,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -275,7 +280,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_BIF_MGCG_MASK; value = CG_SYS_BIF_MGCG_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
if (PP_STATE_SUPPORT_LS & *msg_id) { if (PP_STATE_SUPPORT_LS & *msg_id) {
...@@ -285,7 +290,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -285,7 +290,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_BIF_MGLS_MASK; value = CG_SYS_BIF_MGLS_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -298,7 +303,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -298,7 +303,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_MC_MGCG_MASK; value = CG_SYS_MC_MGCG_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
...@@ -309,7 +314,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -309,7 +314,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_MC_MGLS_MASK; value = CG_SYS_MC_MGLS_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -322,7 +327,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -322,7 +327,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_DRM_MGCG_MASK; value = CG_SYS_DRM_MGCG_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
if (PP_STATE_SUPPORT_LS & *msg_id) { if (PP_STATE_SUPPORT_LS & *msg_id) {
...@@ -332,7 +337,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -332,7 +337,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_DRM_MGLS_MASK; value = CG_SYS_DRM_MGLS_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -345,7 +350,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -345,7 +350,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_HDP_MGCG_MASK; value = CG_SYS_HDP_MGCG_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
...@@ -356,7 +361,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -356,7 +361,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_HDP_MGLS_MASK; value = CG_SYS_HDP_MGLS_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -369,7 +374,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -369,7 +374,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_SDMA_MGCG_MASK; value = CG_SYS_SDMA_MGCG_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
...@@ -380,7 +385,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -380,7 +385,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_SDMA_MGLS_MASK; value = CG_SYS_SDMA_MGLS_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -393,7 +398,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr, ...@@ -393,7 +398,7 @@ int smu7_update_clock_gatings(struct pp_hwmgr *hwmgr,
value = CG_SYS_ROM_MASK; value = CG_SYS_ROM_MASK;
if (smum_send_msg_to_smc_with_parameter( if (smum_send_msg_to_smc_with_parameter(
hwmgr, msg, value)) hwmgr, msg, value, NULL))
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -423,8 +428,10 @@ int smu7_powergate_gfx(struct pp_hwmgr *hwmgr, bool enable) ...@@ -423,8 +428,10 @@ int smu7_powergate_gfx(struct pp_hwmgr *hwmgr, bool enable)
if (enable) if (enable)
return smum_send_msg_to_smc_with_parameter(hwmgr, return smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_GFX_CU_PG_ENABLE, PPSMC_MSG_GFX_CU_PG_ENABLE,
adev->gfx.cu_info.number); adev->gfx.cu_info.number,
NULL);
else else
return smum_send_msg_to_smc(hwmgr, return smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GFX_CU_PG_DISABLE); PPSMC_MSG_GFX_CU_PG_DISABLE,
NULL);
} }
...@@ -887,7 +887,10 @@ static int smu7_enable_didt(struct pp_hwmgr *hwmgr, const bool enable) ...@@ -887,7 +887,10 @@ static int smu7_enable_didt(struct pp_hwmgr *hwmgr, const bool enable)
didt_block |= block_en << TCP_Enable_SHIFT; didt_block |= block_en << TCP_Enable_SHIFT;
if (enable) if (enable)
result = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_Didt_Block_Function, didt_block); result = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_Didt_Block_Function,
didt_block,
NULL);
return result; return result;
} }
...@@ -1009,7 +1012,8 @@ int smu7_enable_didt_config(struct pp_hwmgr *hwmgr) ...@@ -1009,7 +1012,8 @@ int smu7_enable_didt_config(struct pp_hwmgr *hwmgr)
if (hwmgr->chip_id == CHIP_POLARIS11) { if (hwmgr->chip_id == CHIP_POLARIS11) {
result = smum_send_msg_to_smc(hwmgr, result = smum_send_msg_to_smc(hwmgr,
(uint16_t)(PPSMC_MSG_EnableDpmDidt)); (uint16_t)(PPSMC_MSG_EnableDpmDidt),
NULL);
PP_ASSERT_WITH_CODE((0 == result), PP_ASSERT_WITH_CODE((0 == result),
"Failed to enable DPM DIDT.", goto error); "Failed to enable DPM DIDT.", goto error);
} }
...@@ -1042,7 +1046,8 @@ int smu7_disable_didt_config(struct pp_hwmgr *hwmgr) ...@@ -1042,7 +1046,8 @@ int smu7_disable_didt_config(struct pp_hwmgr *hwmgr)
goto error); goto error);
if (hwmgr->chip_id == CHIP_POLARIS11) { if (hwmgr->chip_id == CHIP_POLARIS11) {
result = smum_send_msg_to_smc(hwmgr, result = smum_send_msg_to_smc(hwmgr,
(uint16_t)(PPSMC_MSG_DisableDpmDidt)); (uint16_t)(PPSMC_MSG_DisableDpmDidt),
NULL);
PP_ASSERT_WITH_CODE((0 == result), PP_ASSERT_WITH_CODE((0 == result),
"Failed to disable DPM DIDT.", goto error); "Failed to disable DPM DIDT.", goto error);
} }
...@@ -1063,7 +1068,8 @@ int smu7_enable_smc_cac(struct pp_hwmgr *hwmgr) ...@@ -1063,7 +1068,8 @@ int smu7_enable_smc_cac(struct pp_hwmgr *hwmgr)
if (PP_CAP(PHM_PlatformCaps_CAC)) { if (PP_CAP(PHM_PlatformCaps_CAC)) {
int smc_result; int smc_result;
smc_result = smum_send_msg_to_smc(hwmgr, smc_result = smum_send_msg_to_smc(hwmgr,
(uint16_t)(PPSMC_MSG_EnableCac)); (uint16_t)(PPSMC_MSG_EnableCac),
NULL);
PP_ASSERT_WITH_CODE((0 == smc_result), PP_ASSERT_WITH_CODE((0 == smc_result),
"Failed to enable CAC in SMC.", result = -1); "Failed to enable CAC in SMC.", result = -1);
...@@ -1079,7 +1085,8 @@ int smu7_disable_smc_cac(struct pp_hwmgr *hwmgr) ...@@ -1079,7 +1085,8 @@ int smu7_disable_smc_cac(struct pp_hwmgr *hwmgr)
if (PP_CAP(PHM_PlatformCaps_CAC) && data->cac_enabled) { if (PP_CAP(PHM_PlatformCaps_CAC) && data->cac_enabled) {
int smc_result = smum_send_msg_to_smc(hwmgr, int smc_result = smum_send_msg_to_smc(hwmgr,
(uint16_t)(PPSMC_MSG_DisableCac)); (uint16_t)(PPSMC_MSG_DisableCac),
NULL);
PP_ASSERT_WITH_CODE((smc_result == 0), PP_ASSERT_WITH_CODE((smc_result == 0),
"Failed to disable CAC in SMC.", result = -1); "Failed to disable CAC in SMC.", result = -1);
...@@ -1095,7 +1102,9 @@ int smu7_set_power_limit(struct pp_hwmgr *hwmgr, uint32_t n) ...@@ -1095,7 +1102,9 @@ int smu7_set_power_limit(struct pp_hwmgr *hwmgr, uint32_t n)
if (data->power_containment_features & if (data->power_containment_features &
POWERCONTAINMENT_FEATURE_PkgPwrLimit) POWERCONTAINMENT_FEATURE_PkgPwrLimit)
return smum_send_msg_to_smc_with_parameter(hwmgr, return smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_PkgPwrSetLimit, n<<8); PPSMC_MSG_PkgPwrSetLimit,
n<<8,
NULL);
return 0; return 0;
} }
...@@ -1103,7 +1112,9 @@ static int smu7_set_overdriver_target_tdp(struct pp_hwmgr *hwmgr, ...@@ -1103,7 +1112,9 @@ static int smu7_set_overdriver_target_tdp(struct pp_hwmgr *hwmgr,
uint32_t target_tdp) uint32_t target_tdp)
{ {
return smum_send_msg_to_smc_with_parameter(hwmgr, return smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_OverDriveSetTargetTdp, target_tdp); PPSMC_MSG_OverDriveSetTargetTdp,
target_tdp,
NULL);
} }
int smu7_enable_power_containment(struct pp_hwmgr *hwmgr) int smu7_enable_power_containment(struct pp_hwmgr *hwmgr)
...@@ -1124,7 +1135,8 @@ int smu7_enable_power_containment(struct pp_hwmgr *hwmgr) ...@@ -1124,7 +1135,8 @@ int smu7_enable_power_containment(struct pp_hwmgr *hwmgr)
if (PP_CAP(PHM_PlatformCaps_PowerContainment)) { if (PP_CAP(PHM_PlatformCaps_PowerContainment)) {
if (data->enable_tdc_limit_feature) { if (data->enable_tdc_limit_feature) {
smc_result = smum_send_msg_to_smc(hwmgr, smc_result = smum_send_msg_to_smc(hwmgr,
(uint16_t)(PPSMC_MSG_TDCLimitEnable)); (uint16_t)(PPSMC_MSG_TDCLimitEnable),
NULL);
PP_ASSERT_WITH_CODE((0 == smc_result), PP_ASSERT_WITH_CODE((0 == smc_result),
"Failed to enable TDCLimit in SMC.", result = -1;); "Failed to enable TDCLimit in SMC.", result = -1;);
if (0 == smc_result) if (0 == smc_result)
...@@ -1134,7 +1146,8 @@ int smu7_enable_power_containment(struct pp_hwmgr *hwmgr) ...@@ -1134,7 +1146,8 @@ int smu7_enable_power_containment(struct pp_hwmgr *hwmgr)
if (data->enable_pkg_pwr_tracking_feature) { if (data->enable_pkg_pwr_tracking_feature) {
smc_result = smum_send_msg_to_smc(hwmgr, smc_result = smum_send_msg_to_smc(hwmgr,
(uint16_t)(PPSMC_MSG_PkgPwrLimitEnable)); (uint16_t)(PPSMC_MSG_PkgPwrLimitEnable),
NULL);
PP_ASSERT_WITH_CODE((0 == smc_result), PP_ASSERT_WITH_CODE((0 == smc_result),
"Failed to enable PkgPwrTracking in SMC.", result = -1;); "Failed to enable PkgPwrTracking in SMC.", result = -1;);
if (0 == smc_result) { if (0 == smc_result) {
...@@ -1163,7 +1176,8 @@ int smu7_disable_power_containment(struct pp_hwmgr *hwmgr) ...@@ -1163,7 +1176,8 @@ int smu7_disable_power_containment(struct pp_hwmgr *hwmgr)
if (data->power_containment_features & if (data->power_containment_features &
POWERCONTAINMENT_FEATURE_TDCLimit) { POWERCONTAINMENT_FEATURE_TDCLimit) {
smc_result = smum_send_msg_to_smc(hwmgr, smc_result = smum_send_msg_to_smc(hwmgr,
(uint16_t)(PPSMC_MSG_TDCLimitDisable)); (uint16_t)(PPSMC_MSG_TDCLimitDisable),
NULL);
PP_ASSERT_WITH_CODE((smc_result == 0), PP_ASSERT_WITH_CODE((smc_result == 0),
"Failed to disable TDCLimit in SMC.", "Failed to disable TDCLimit in SMC.",
result = smc_result); result = smc_result);
...@@ -1172,7 +1186,8 @@ int smu7_disable_power_containment(struct pp_hwmgr *hwmgr) ...@@ -1172,7 +1186,8 @@ int smu7_disable_power_containment(struct pp_hwmgr *hwmgr)
if (data->power_containment_features & if (data->power_containment_features &
POWERCONTAINMENT_FEATURE_DTE) { POWERCONTAINMENT_FEATURE_DTE) {
smc_result = smum_send_msg_to_smc(hwmgr, smc_result = smum_send_msg_to_smc(hwmgr,
(uint16_t)(PPSMC_MSG_DisableDTE)); (uint16_t)(PPSMC_MSG_DisableDTE),
NULL);
PP_ASSERT_WITH_CODE((smc_result == 0), PP_ASSERT_WITH_CODE((smc_result == 0),
"Failed to disable DTE in SMC.", "Failed to disable DTE in SMC.",
result = smc_result); result = smc_result);
...@@ -1181,7 +1196,8 @@ int smu7_disable_power_containment(struct pp_hwmgr *hwmgr) ...@@ -1181,7 +1196,8 @@ int smu7_disable_power_containment(struct pp_hwmgr *hwmgr)
if (data->power_containment_features & if (data->power_containment_features &
POWERCONTAINMENT_FEATURE_PkgPwrLimit) { POWERCONTAINMENT_FEATURE_PkgPwrLimit) {
smc_result = smum_send_msg_to_smc(hwmgr, smc_result = smum_send_msg_to_smc(hwmgr,
(uint16_t)(PPSMC_MSG_PkgPwrLimitDisable)); (uint16_t)(PPSMC_MSG_PkgPwrLimitDisable),
NULL);
PP_ASSERT_WITH_CODE((smc_result == 0), PP_ASSERT_WITH_CODE((smc_result == 0),
"Failed to disable PkgPwrTracking in SMC.", "Failed to disable PkgPwrTracking in SMC.",
result = smc_result); result = smc_result);
......
...@@ -152,7 +152,7 @@ int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr) ...@@ -152,7 +152,7 @@ int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr)
if (PP_CAP(PHM_PlatformCaps_ODFuzzyFanControlSupport)) { if (PP_CAP(PHM_PlatformCaps_ODFuzzyFanControlSupport)) {
result = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_StartFanControl, result = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_StartFanControl,
FAN_CONTROL_FUZZY); FAN_CONTROL_FUZZY, NULL);
if (PP_CAP(PHM_PlatformCaps_FanSpeedInTableIsRPM)) if (PP_CAP(PHM_PlatformCaps_FanSpeedInTableIsRPM))
hwmgr->hwmgr_func->set_max_fan_rpm_output(hwmgr, hwmgr->hwmgr_func->set_max_fan_rpm_output(hwmgr,
...@@ -165,7 +165,7 @@ int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr) ...@@ -165,7 +165,7 @@ int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr)
} else { } else {
result = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_StartFanControl, result = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_StartFanControl,
FAN_CONTROL_TABLE); FAN_CONTROL_TABLE, NULL);
} }
if (!result && hwmgr->thermal_controller. if (!result && hwmgr->thermal_controller.
...@@ -173,7 +173,8 @@ int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr) ...@@ -173,7 +173,8 @@ int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr)
result = smum_send_msg_to_smc_with_parameter(hwmgr, result = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetFanTemperatureTarget, PPSMC_MSG_SetFanTemperatureTarget,
hwmgr->thermal_controller. hwmgr->thermal_controller.
advanceFanControlParameters.ucTargetTemperature); advanceFanControlParameters.ucTargetTemperature,
NULL);
hwmgr->fan_ctrl_enabled = true; hwmgr->fan_ctrl_enabled = true;
return result; return result;
...@@ -183,7 +184,7 @@ int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr) ...@@ -183,7 +184,7 @@ int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr)
int smu7_fan_ctrl_stop_smc_fan_control(struct pp_hwmgr *hwmgr) int smu7_fan_ctrl_stop_smc_fan_control(struct pp_hwmgr *hwmgr)
{ {
hwmgr->fan_ctrl_enabled = false; hwmgr->fan_ctrl_enabled = false;
return smum_send_msg_to_smc(hwmgr, PPSMC_StopFanControl); return smum_send_msg_to_smc(hwmgr, PPSMC_StopFanControl, NULL);
} }
/** /**
...@@ -372,7 +373,7 @@ static void smu7_thermal_enable_alert(struct pp_hwmgr *hwmgr) ...@@ -372,7 +373,7 @@ static void smu7_thermal_enable_alert(struct pp_hwmgr *hwmgr)
CG_THERMAL_INT, THERM_INT_MASK, alert); CG_THERMAL_INT, THERM_INT_MASK, alert);
/* send message to SMU to enable internal thermal interrupts */ /* send message to SMU to enable internal thermal interrupts */
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_Thermal_Cntl_Enable); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_Thermal_Cntl_Enable, NULL);
} }
/** /**
...@@ -390,7 +391,7 @@ int smu7_thermal_disable_alert(struct pp_hwmgr *hwmgr) ...@@ -390,7 +391,7 @@ int smu7_thermal_disable_alert(struct pp_hwmgr *hwmgr)
CG_THERMAL_INT, THERM_INT_MASK, alert); CG_THERMAL_INT, THERM_INT_MASK, alert);
/* send message to SMU to disable internal thermal interrupts */ /* send message to SMU to disable internal thermal interrupts */
return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_Thermal_Cntl_Disable); return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_Thermal_Cntl_Disable, NULL);
} }
/** /**
......
...@@ -557,7 +557,9 @@ void phm_apply_dal_min_voltage_request(struct pp_hwmgr *hwmgr) ...@@ -557,7 +557,9 @@ void phm_apply_dal_min_voltage_request(struct pp_hwmgr *hwmgr)
if (req_vddc <= vddc_table->entries[i].vddc) { if (req_vddc <= vddc_table->entries[i].vddc) {
req_volt = (((uint32_t)vddc_table->entries[i].vddc) * VOLTAGE_SCALE); req_volt = (((uint32_t)vddc_table->entries[i].vddc) * VOLTAGE_SCALE);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_VddC_Request, req_volt); PPSMC_MSG_VddC_Request,
req_volt,
NULL);
return; return;
} }
} }
......
...@@ -98,7 +98,7 @@ int vega10_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state) ...@@ -98,7 +98,7 @@ int vega10_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
if (state == BACO_STATE_IN) { if (state == BACO_STATE_IN) {
if (soc15_baco_program_registers(hwmgr, pre_baco_tbl, if (soc15_baco_program_registers(hwmgr, pre_baco_tbl,
ARRAY_SIZE(pre_baco_tbl))) { ARRAY_SIZE(pre_baco_tbl))) {
if (smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnterBaco)) if (smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnterBaco, NULL))
return -EINVAL; return -EINVAL;
if (soc15_baco_program_registers(hwmgr, enter_baco_tbl, if (soc15_baco_program_registers(hwmgr, enter_baco_tbl,
......
...@@ -925,7 +925,8 @@ static void vega10_didt_set_mask(struct pp_hwmgr *hwmgr, const bool enable) ...@@ -925,7 +925,8 @@ static void vega10_didt_set_mask(struct pp_hwmgr *hwmgr, const bool enable)
/* For Vega10, SMC does not support any mask yet. */ /* For Vega10, SMC does not support any mask yet. */
if (enable) if (enable)
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ConfigureGfxDidt, didt_block_info); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ConfigureGfxDidt, didt_block_info,
NULL);
} }
...@@ -1327,7 +1328,8 @@ int vega10_set_power_limit(struct pp_hwmgr *hwmgr, uint32_t n) ...@@ -1327,7 +1328,8 @@ int vega10_set_power_limit(struct pp_hwmgr *hwmgr, uint32_t n)
if (data->registry_data.enable_pkg_pwr_tracking_feature) if (data->registry_data.enable_pkg_pwr_tracking_feature)
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetPptLimit, n); PPSMC_MSG_SetPptLimit, n,
NULL);
return 0; return 0;
} }
...@@ -1393,7 +1395,8 @@ static void vega10_set_overdrive_target_percentage(struct pp_hwmgr *hwmgr, ...@@ -1393,7 +1395,8 @@ static void vega10_set_overdrive_target_percentage(struct pp_hwmgr *hwmgr,
uint32_t adjust_percent) uint32_t adjust_percent)
{ {
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_OverDriveSetPercentage, adjust_percent); PPSMC_MSG_OverDriveSetPercentage, adjust_percent,
NULL);
} }
int vega10_power_control_set_level(struct pp_hwmgr *hwmgr) int vega10_power_control_set_level(struct pp_hwmgr *hwmgr)
......
...@@ -31,8 +31,7 @@ ...@@ -31,8 +31,7 @@
static int vega10_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm) static int vega10_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm)
{ {
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetCurrentRpm); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetCurrentRpm, current_rpm);
*current_rpm = smum_get_argument(hwmgr);
return 0; return 0;
} }
...@@ -520,7 +519,8 @@ int vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) ...@@ -520,7 +519,8 @@ int vega10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetFanTemperatureTarget, PPSMC_MSG_SetFanTemperatureTarget,
(uint32_t)table->FanTargetTemperature); (uint32_t)table->FanTargetTemperature,
NULL);
table->FanPwmMin = hwmgr->thermal_controller. table->FanPwmMin = hwmgr->thermal_controller.
advanceFanControlParameters.usPWMMin * 255 / 100; advanceFanControlParameters.usPWMMin * 255 / 100;
......
...@@ -96,7 +96,7 @@ int vega12_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state) ...@@ -96,7 +96,7 @@ int vega12_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
if (state == BACO_STATE_IN) { if (state == BACO_STATE_IN) {
if (soc15_baco_program_registers(hwmgr, pre_baco_tbl, if (soc15_baco_program_registers(hwmgr, pre_baco_tbl,
ARRAY_SIZE(pre_baco_tbl))) { ARRAY_SIZE(pre_baco_tbl))) {
if (smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_EnterBaco, 0)) if (smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_EnterBaco, 0, NULL))
return -EINVAL; return -EINVAL;
if (soc15_baco_program_registers(hwmgr, enter_baco_tbl, if (soc15_baco_program_registers(hwmgr, enter_baco_tbl,
......
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
static int vega12_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm) static int vega12_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm)
{ {
PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr, PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetCurrentRpm), PPSMC_MSG_GetCurrentRpm,
current_rpm),
"Attempt to get current RPM from SMC Failed!", "Attempt to get current RPM from SMC Failed!",
return -EINVAL); return -EINVAL);
*current_rpm = smum_get_argument(hwmgr);
return 0; return 0;
} }
...@@ -259,7 +259,8 @@ int vega12_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) ...@@ -259,7 +259,8 @@ int vega12_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
ret = smum_send_msg_to_smc_with_parameter(hwmgr, ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetFanTemperatureTarget, PPSMC_MSG_SetFanTemperatureTarget,
(uint32_t)table->FanTargetTemperature); (uint32_t)table->FanTargetTemperature,
NULL);
return ret; return ret;
} }
......
...@@ -91,16 +91,16 @@ int vega20_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state) ...@@ -91,16 +91,16 @@ int vega20_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
WREG32_SOC15(THM, 0, mmTHM_BACO_CNTL, data); WREG32_SOC15(THM, 0, mmTHM_BACO_CNTL, data);
if(smum_send_msg_to_smc_with_parameter(hwmgr, if(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_EnterBaco, 0)) PPSMC_MSG_EnterBaco, 0, NULL))
return -EINVAL; return -EINVAL;
} else { } else {
if(smum_send_msg_to_smc_with_parameter(hwmgr, if(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_EnterBaco, 1)) PPSMC_MSG_EnterBaco, 1, NULL))
return -EINVAL; return -EINVAL;
} }
} else if (state == BACO_STATE_OUT) { } else if (state == BACO_STATE_OUT) {
if (smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ExitBaco)) if (smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ExitBaco, NULL))
return -EINVAL; return -EINVAL;
if (!soc15_baco_program_registers(hwmgr, clean_baco_tbl, if (!soc15_baco_program_registers(hwmgr, clean_baco_tbl,
ARRAY_SIZE(clean_baco_tbl))) ARRAY_SIZE(clean_baco_tbl)))
...@@ -118,5 +118,5 @@ int vega20_baco_apply_vdci_flush_workaround(struct pp_hwmgr *hwmgr) ...@@ -118,5 +118,5 @@ int vega20_baco_apply_vdci_flush_workaround(struct pp_hwmgr *hwmgr)
if (ret) if (ret)
return ret; return ret;
return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_BacoWorkAroundFlushVDCI); return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_BacoWorkAroundFlushVDCI, NULL);
} }
...@@ -36,7 +36,8 @@ int vega20_set_power_limit(struct pp_hwmgr *hwmgr, uint32_t n) ...@@ -36,7 +36,8 @@ int vega20_set_power_limit(struct pp_hwmgr *hwmgr, uint32_t n)
if (data->smu_features[GNLD_PPT].enabled) if (data->smu_features[GNLD_PPT].enabled)
return smum_send_msg_to_smc_with_parameter(hwmgr, return smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetPptLimit, n); PPSMC_MSG_SetPptLimit, n,
NULL);
return 0; return 0;
} }
...@@ -51,7 +52,8 @@ static int vega20_set_overdrive_target_percentage(struct pp_hwmgr *hwmgr, ...@@ -51,7 +52,8 @@ static int vega20_set_overdrive_target_percentage(struct pp_hwmgr *hwmgr,
uint32_t adjust_percent) uint32_t adjust_percent)
{ {
return smum_send_msg_to_smc_with_parameter(hwmgr, return smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_OverDriveSetPercentage, adjust_percent); PPSMC_MSG_OverDriveSetPercentage, adjust_percent,
NULL);
} }
int vega20_power_control_set_level(struct pp_hwmgr *hwmgr) int vega20_power_control_set_level(struct pp_hwmgr *hwmgr)
......
...@@ -106,10 +106,10 @@ static int vega20_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm) ...@@ -106,10 +106,10 @@ static int vega20_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm)
int ret = 0; int ret = 0;
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetCurrentRpm)) == 0, PPSMC_MSG_GetCurrentRpm,
current_rpm)) == 0,
"Attempt to get current RPM from SMC Failed!", "Attempt to get current RPM from SMC Failed!",
return ret); return ret);
*current_rpm = smum_get_argument(hwmgr);
return 0; return 0;
} }
...@@ -329,7 +329,8 @@ static int vega20_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) ...@@ -329,7 +329,8 @@ static int vega20_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
ret = smum_send_msg_to_smc_with_parameter(hwmgr, ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetFanTemperatureTarget, PPSMC_MSG_SetFanTemperatureTarget,
(uint32_t)table->FanTargetTemperature); (uint32_t)table->FanTargetTemperature,
NULL);
return ret; return ret;
} }
......
...@@ -81,16 +81,15 @@ enum SMU10_TABLE_ID { ...@@ -81,16 +81,15 @@ enum SMU10_TABLE_ID {
SMU10_CLOCKTABLE, SMU10_CLOCKTABLE,
}; };
extern uint32_t smum_get_argument(struct pp_hwmgr *hwmgr);
extern int smum_download_powerplay_table(struct pp_hwmgr *hwmgr, void **table); extern int smum_download_powerplay_table(struct pp_hwmgr *hwmgr, void **table);
extern int smum_upload_powerplay_table(struct pp_hwmgr *hwmgr); extern int smum_upload_powerplay_table(struct pp_hwmgr *hwmgr);
extern int smum_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg); extern int smum_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg, uint32_t *resp);
extern int smum_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr, extern int smum_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr,
uint16_t msg, uint32_t parameter); uint16_t msg, uint32_t parameter,
uint32_t *resp);
extern int smum_update_sclk_threshold(struct pp_hwmgr *hwmgr); extern int smum_update_sclk_threshold(struct pp_hwmgr *hwmgr);
......
...@@ -2780,7 +2780,7 @@ static int ci_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -2780,7 +2780,7 @@ static int ci_update_dpm_settings(struct pp_hwmgr *hwmgr,
if (setting->bupdate_sclk) { if (setting->bupdate_sclk) {
if (!data->sclk_dpm_key_disabled) if (!data->sclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_FreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_FreezeLevel, NULL);
for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount; i++) { for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount; i++) {
if (levels[i].ActivityLevel != if (levels[i].ActivityLevel !=
cpu_to_be16(setting->sclk_activity)) { cpu_to_be16(setting->sclk_activity)) {
...@@ -2810,12 +2810,12 @@ static int ci_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -2810,12 +2810,12 @@ static int ci_update_dpm_settings(struct pp_hwmgr *hwmgr,
} }
} }
if (!data->sclk_dpm_key_disabled) if (!data->sclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_UnfreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_UnfreezeLevel, NULL);
} }
if (setting->bupdate_mclk) { if (setting->bupdate_mclk) {
if (!data->mclk_dpm_key_disabled) if (!data->mclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_FreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_FreezeLevel, NULL);
for (i = 0; i < smu_data->smc_state_table.MemoryDpmLevelCount; i++) { for (i = 0; i < smu_data->smc_state_table.MemoryDpmLevelCount; i++) {
if (mclk_levels[i].ActivityLevel != if (mclk_levels[i].ActivityLevel !=
cpu_to_be16(setting->mclk_activity)) { cpu_to_be16(setting->mclk_activity)) {
...@@ -2845,7 +2845,7 @@ static int ci_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -2845,7 +2845,7 @@ static int ci_update_dpm_settings(struct pp_hwmgr *hwmgr,
} }
} }
if (!data->mclk_dpm_key_disabled) if (!data->mclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_UnfreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_UnfreezeLevel, NULL);
} }
return 0; return 0;
} }
...@@ -2882,7 +2882,8 @@ static int ci_update_uvd_smc_table(struct pp_hwmgr *hwmgr) ...@@ -2882,7 +2882,8 @@ static int ci_update_uvd_smc_table(struct pp_hwmgr *hwmgr)
break; break;
} }
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_UVDDPM_SetEnabledMask, smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_UVDDPM_SetEnabledMask,
data->dpm_level_enable_mask.uvd_dpm_enable_mask); data->dpm_level_enable_mask.uvd_dpm_enable_mask,
NULL);
return 0; return 0;
} }
...@@ -2913,7 +2914,8 @@ static int ci_update_vce_smc_table(struct pp_hwmgr *hwmgr) ...@@ -2913,7 +2914,8 @@ static int ci_update_vce_smc_table(struct pp_hwmgr *hwmgr)
break; break;
} }
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_VCEDPM_SetEnabledMask, smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_VCEDPM_SetEnabledMask,
data->dpm_level_enable_mask.vce_dpm_enable_mask); data->dpm_level_enable_mask.vce_dpm_enable_mask,
NULL);
return 0; return 0;
} }
......
...@@ -137,7 +137,7 @@ static int fiji_start_smu_in_protection_mode(struct pp_hwmgr *hwmgr) ...@@ -137,7 +137,7 @@ static int fiji_start_smu_in_protection_mode(struct pp_hwmgr *hwmgr)
PHM_WAIT_VFPF_INDIRECT_FIELD(hwmgr, SMC_IND, RCU_UC_EVENTS, PHM_WAIT_VFPF_INDIRECT_FIELD(hwmgr, SMC_IND, RCU_UC_EVENTS,
INTERRUPTS_ENABLED, 1); INTERRUPTS_ENABLED, 1);
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_Test, 0x20000); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_Test, 0x20000, NULL);
/* Wait for done bit to be set */ /* Wait for done bit to be set */
PHM_WAIT_VFPF_INDIRECT_FIELD_UNEQUAL(hwmgr, SMC_IND, PHM_WAIT_VFPF_INDIRECT_FIELD_UNEQUAL(hwmgr, SMC_IND,
...@@ -202,7 +202,8 @@ static int fiji_start_avfs_btc(struct pp_hwmgr *hwmgr) ...@@ -202,7 +202,8 @@ static int fiji_start_avfs_btc(struct pp_hwmgr *hwmgr)
if (0 != smu_data->avfs_btc_param) { if (0 != smu_data->avfs_btc_param) {
if (0 != smum_send_msg_to_smc_with_parameter(hwmgr, if (0 != smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_PerformBtc, smu_data->avfs_btc_param)) { PPSMC_MSG_PerformBtc, smu_data->avfs_btc_param,
NULL)) {
pr_info("[AVFS][Fiji_PerformBtc] PerformBTC SMU msg failed"); pr_info("[AVFS][Fiji_PerformBtc] PerformBTC SMU msg failed");
result = -EINVAL; result = -EINVAL;
} }
...@@ -1911,7 +1912,8 @@ static int fiji_setup_dpm_led_config(struct pp_hwmgr *hwmgr) ...@@ -1911,7 +1912,8 @@ static int fiji_setup_dpm_led_config(struct pp_hwmgr *hwmgr)
if (mask) if (mask)
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_LedConfig, PPSMC_MSG_LedConfig,
mask); mask,
NULL);
return 0; return 0;
} }
...@@ -2218,14 +2220,16 @@ static int fiji_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) ...@@ -2218,14 +2220,16 @@ static int fiji_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
res = smum_send_msg_to_smc_with_parameter(hwmgr, res = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetFanMinPwm, PPSMC_MSG_SetFanMinPwm,
hwmgr->thermal_controller. hwmgr->thermal_controller.
advanceFanControlParameters.ucMinimumPWMLimit); advanceFanControlParameters.ucMinimumPWMLimit,
NULL);
if (!res && hwmgr->thermal_controller. if (!res && hwmgr->thermal_controller.
advanceFanControlParameters.ulMinFanSCLKAcousticLimit) advanceFanControlParameters.ulMinFanSCLKAcousticLimit)
res = smum_send_msg_to_smc_with_parameter(hwmgr, res = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetFanSclkTarget, PPSMC_MSG_SetFanSclkTarget,
hwmgr->thermal_controller. hwmgr->thermal_controller.
advanceFanControlParameters.ulMinFanSCLKAcousticLimit); advanceFanControlParameters.ulMinFanSCLKAcousticLimit,
NULL);
if (res) if (res)
phm_cap_unset(hwmgr->platform_descriptor.platformCaps, phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
...@@ -2240,7 +2244,7 @@ static int fiji_thermal_avfs_enable(struct pp_hwmgr *hwmgr) ...@@ -2240,7 +2244,7 @@ static int fiji_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
if (!hwmgr->avfs_supported) if (!hwmgr->avfs_supported)
return 0; return 0;
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs, NULL);
return 0; return 0;
} }
...@@ -2388,7 +2392,8 @@ static int fiji_update_uvd_smc_table(struct pp_hwmgr *hwmgr) ...@@ -2388,7 +2392,8 @@ static int fiji_update_uvd_smc_table(struct pp_hwmgr *hwmgr)
PHM_PlatformCaps_StablePState)) PHM_PlatformCaps_StablePState))
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_UVDDPM_SetEnabledMask, PPSMC_MSG_UVDDPM_SetEnabledMask,
(uint32_t)(1 << smu_data->smc_state_table.UvdBootLevel)); (uint32_t)(1 << smu_data->smc_state_table.UvdBootLevel),
NULL);
return 0; return 0;
} }
...@@ -2420,7 +2425,8 @@ static int fiji_update_vce_smc_table(struct pp_hwmgr *hwmgr) ...@@ -2420,7 +2425,8 @@ static int fiji_update_vce_smc_table(struct pp_hwmgr *hwmgr)
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_StablePState)) if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_StablePState))
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_VCEDPM_SetEnabledMask, PPSMC_MSG_VCEDPM_SetEnabledMask,
(uint32_t)1 << smu_data->smc_state_table.VceBootLevel); (uint32_t)1 << smu_data->smc_state_table.VceBootLevel,
NULL);
return 0; return 0;
} }
...@@ -2567,7 +2573,7 @@ static int fiji_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -2567,7 +2573,7 @@ static int fiji_update_dpm_settings(struct pp_hwmgr *hwmgr,
if (setting->bupdate_sclk) { if (setting->bupdate_sclk) {
if (!data->sclk_dpm_key_disabled) if (!data->sclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_FreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_FreezeLevel, NULL);
for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount; i++) { for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount; i++) {
if (levels[i].ActivityLevel != if (levels[i].ActivityLevel !=
cpu_to_be16(setting->sclk_activity)) { cpu_to_be16(setting->sclk_activity)) {
...@@ -2597,12 +2603,12 @@ static int fiji_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -2597,12 +2603,12 @@ static int fiji_update_dpm_settings(struct pp_hwmgr *hwmgr,
} }
} }
if (!data->sclk_dpm_key_disabled) if (!data->sclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_UnfreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_UnfreezeLevel, NULL);
} }
if (setting->bupdate_mclk) { if (setting->bupdate_mclk) {
if (!data->mclk_dpm_key_disabled) if (!data->mclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_FreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_FreezeLevel, NULL);
for (i = 0; i < smu_data->smc_state_table.MemoryDpmLevelCount; i++) { for (i = 0; i < smu_data->smc_state_table.MemoryDpmLevelCount; i++) {
if (mclk_levels[i].ActivityLevel != if (mclk_levels[i].ActivityLevel !=
cpu_to_be16(setting->mclk_activity)) { cpu_to_be16(setting->mclk_activity)) {
...@@ -2632,7 +2638,7 @@ static int fiji_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -2632,7 +2638,7 @@ static int fiji_update_dpm_settings(struct pp_hwmgr *hwmgr,
} }
} }
if (!data->mclk_dpm_key_disabled) if (!data->mclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_UnfreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_UnfreezeLevel, NULL);
} }
return 0; return 0;
} }
......
...@@ -99,7 +99,8 @@ static int polaris10_perform_btc(struct pp_hwmgr *hwmgr) ...@@ -99,7 +99,8 @@ static int polaris10_perform_btc(struct pp_hwmgr *hwmgr)
struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend); struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend);
if (0 != smu_data->avfs_btc_param) { if (0 != smu_data->avfs_btc_param) {
if (0 != smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_PerformBtc, smu_data->avfs_btc_param)) { if (0 != smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_PerformBtc, smu_data->avfs_btc_param,
NULL)) {
pr_info("[AVFS][SmuPolaris10_PerformBtc] PerformBTC SMU msg failed"); pr_info("[AVFS][SmuPolaris10_PerformBtc] PerformBTC SMU msg failed");
result = -1; result = -1;
} }
...@@ -2049,15 +2050,16 @@ int polaris10_thermal_avfs_enable(struct pp_hwmgr *hwmgr) ...@@ -2049,15 +2050,16 @@ int polaris10_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
return 0; return 0;
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetGBDroopSettings, data->avfs_vdroop_override_setting); PPSMC_MSG_SetGBDroopSettings, data->avfs_vdroop_override_setting,
NULL);
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs, NULL);
/* Apply avfs cks-off voltages to avoid the overshoot /* Apply avfs cks-off voltages to avoid the overshoot
* when switching to the highest sclk frequency * when switching to the highest sclk frequency
*/ */
if (data->apply_avfs_cks_off_voltage) if (data->apply_avfs_cks_off_voltage)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ApplyAvfsCksOffVoltage); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ApplyAvfsCksOffVoltage, NULL);
return 0; return 0;
} }
...@@ -2158,14 +2160,16 @@ static int polaris10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) ...@@ -2158,14 +2160,16 @@ static int polaris10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
res = smum_send_msg_to_smc_with_parameter(hwmgr, res = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetFanMinPwm, PPSMC_MSG_SetFanMinPwm,
hwmgr->thermal_controller. hwmgr->thermal_controller.
advanceFanControlParameters.ucMinimumPWMLimit); advanceFanControlParameters.ucMinimumPWMLimit,
NULL);
if (!res && hwmgr->thermal_controller. if (!res && hwmgr->thermal_controller.
advanceFanControlParameters.ulMinFanSCLKAcousticLimit) advanceFanControlParameters.ulMinFanSCLKAcousticLimit)
res = smum_send_msg_to_smc_with_parameter(hwmgr, res = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetFanSclkTarget, PPSMC_MSG_SetFanSclkTarget,
hwmgr->thermal_controller. hwmgr->thermal_controller.
advanceFanControlParameters.ulMinFanSCLKAcousticLimit); advanceFanControlParameters.ulMinFanSCLKAcousticLimit,
NULL);
if (res) if (res)
phm_cap_unset(hwmgr->platform_descriptor.platformCaps, phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
...@@ -2202,7 +2206,8 @@ static int polaris10_update_uvd_smc_table(struct pp_hwmgr *hwmgr) ...@@ -2202,7 +2206,8 @@ static int polaris10_update_uvd_smc_table(struct pp_hwmgr *hwmgr)
PHM_PlatformCaps_StablePState)) PHM_PlatformCaps_StablePState))
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_UVDDPM_SetEnabledMask, PPSMC_MSG_UVDDPM_SetEnabledMask,
(uint32_t)(1 << smu_data->smc_state_table.UvdBootLevel)); (uint32_t)(1 << smu_data->smc_state_table.UvdBootLevel),
NULL);
return 0; return 0;
} }
...@@ -2234,7 +2239,8 @@ static int polaris10_update_vce_smc_table(struct pp_hwmgr *hwmgr) ...@@ -2234,7 +2239,8 @@ static int polaris10_update_vce_smc_table(struct pp_hwmgr *hwmgr)
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_StablePState)) if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_StablePState))
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_VCEDPM_SetEnabledMask, PPSMC_MSG_VCEDPM_SetEnabledMask,
(uint32_t)1 << smu_data->smc_state_table.VceBootLevel); (uint32_t)1 << smu_data->smc_state_table.VceBootLevel,
NULL);
return 0; return 0;
} }
...@@ -2485,7 +2491,7 @@ static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -2485,7 +2491,7 @@ static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr,
if (setting->bupdate_sclk) { if (setting->bupdate_sclk) {
if (!data->sclk_dpm_key_disabled) if (!data->sclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_FreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_FreezeLevel, NULL);
for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount; i++) { for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount; i++) {
if (levels[i].ActivityLevel != if (levels[i].ActivityLevel !=
cpu_to_be16(setting->sclk_activity)) { cpu_to_be16(setting->sclk_activity)) {
...@@ -2515,12 +2521,12 @@ static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -2515,12 +2521,12 @@ static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr,
} }
} }
if (!data->sclk_dpm_key_disabled) if (!data->sclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_UnfreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_UnfreezeLevel, NULL);
} }
if (setting->bupdate_mclk) { if (setting->bupdate_mclk) {
if (!data->mclk_dpm_key_disabled) if (!data->mclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_FreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_FreezeLevel, NULL);
for (i = 0; i < smu_data->smc_state_table.MemoryDpmLevelCount; i++) { for (i = 0; i < smu_data->smc_state_table.MemoryDpmLevelCount; i++) {
if (mclk_levels[i].ActivityLevel != if (mclk_levels[i].ActivityLevel !=
cpu_to_be16(setting->mclk_activity)) { cpu_to_be16(setting->mclk_activity)) {
...@@ -2550,7 +2556,7 @@ static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -2550,7 +2556,7 @@ static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr,
} }
} }
if (!data->mclk_dpm_key_disabled) if (!data->mclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_UnfreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_UnfreezeLevel, NULL);
} }
return 0; return 0;
} }
......
...@@ -128,13 +128,16 @@ static int smu10_copy_table_from_smc(struct pp_hwmgr *hwmgr, ...@@ -128,13 +128,16 @@ static int smu10_copy_table_from_smc(struct pp_hwmgr *hwmgr,
"Invalid SMU Table Length!", return -EINVAL;); "Invalid SMU Table Length!", return -EINVAL;);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[table_id].mc_addr)); upper_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[table_id].mc_addr)); lower_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableSmu2Dram, PPSMC_MSG_TransferTableSmu2Dram,
priv->smu_tables.entry[table_id].table_id); priv->smu_tables.entry[table_id].table_id,
NULL);
/* flush hdp cache */ /* flush hdp cache */
amdgpu_asic_flush_hdp(adev, NULL); amdgpu_asic_flush_hdp(adev, NULL);
...@@ -166,13 +169,16 @@ static int smu10_copy_table_to_smc(struct pp_hwmgr *hwmgr, ...@@ -166,13 +169,16 @@ static int smu10_copy_table_to_smc(struct pp_hwmgr *hwmgr,
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[table_id].mc_addr)); upper_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[table_id].mc_addr)); lower_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableDram2Smu, PPSMC_MSG_TransferTableDram2Smu,
priv->smu_tables.entry[table_id].table_id); priv->smu_tables.entry[table_id].table_id,
NULL);
return 0; return 0;
} }
...@@ -182,8 +188,8 @@ static int smu10_verify_smc_interface(struct pp_hwmgr *hwmgr) ...@@ -182,8 +188,8 @@ static int smu10_verify_smc_interface(struct pp_hwmgr *hwmgr)
uint32_t smc_driver_if_version; uint32_t smc_driver_if_version;
smum_send_msg_to_smc(hwmgr, smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetDriverIfVersion); PPSMC_MSG_GetDriverIfVersion,
smc_driver_if_version = smum_get_argument(hwmgr); &smc_driver_if_version);
if ((smc_driver_if_version != SMU10_DRIVER_IF_VERSION) && if ((smc_driver_if_version != SMU10_DRIVER_IF_VERSION) &&
(smc_driver_if_version != SMU10_DRIVER_IF_VERSION + 1)) { (smc_driver_if_version != SMU10_DRIVER_IF_VERSION + 1)) {
...@@ -217,8 +223,7 @@ static int smu10_start_smu(struct pp_hwmgr *hwmgr) ...@@ -217,8 +223,7 @@ static int smu10_start_smu(struct pp_hwmgr *hwmgr)
{ {
struct amdgpu_device *adev = hwmgr->adev; struct amdgpu_device *adev = hwmgr->adev;
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetSmuVersion); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetSmuVersion, &hwmgr->smu_version);
hwmgr->smu_version = smum_get_argument(hwmgr);
adev->pm.fw_version = hwmgr->smu_version >> 8; adev->pm.fw_version = hwmgr->smu_version >> 8;
if (adev->rev_id < 0x8 && adev->pdev->device != 0x15d8 && if (adev->rev_id < 0x8 && adev->pdev->device != 0x15d8 &&
......
...@@ -207,7 +207,7 @@ uint32_t smu7_get_argument(struct pp_hwmgr *hwmgr) ...@@ -207,7 +207,7 @@ uint32_t smu7_get_argument(struct pp_hwmgr *hwmgr)
int smu7_send_msg_to_smc_offset(struct pp_hwmgr *hwmgr) int smu7_send_msg_to_smc_offset(struct pp_hwmgr *hwmgr)
{ {
return smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_Test, 0x20000); return smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_Test, 0x20000, NULL);
} }
enum cgs_ucode_id smu7_convert_fw_type_to_cgs(uint32_t fw_type) enum cgs_ucode_id smu7_convert_fw_type_to_cgs(uint32_t fw_type)
...@@ -337,10 +337,12 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) ...@@ -337,10 +337,12 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)
if (hwmgr->not_vf) { if (hwmgr->not_vf) {
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SMU_DRAM_ADDR_HI, PPSMC_MSG_SMU_DRAM_ADDR_HI,
upper_32_bits(smu_data->smu_buffer.mc_addr)); upper_32_bits(smu_data->smu_buffer.mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SMU_DRAM_ADDR_LO, PPSMC_MSG_SMU_DRAM_ADDR_LO,
lower_32_bits(smu_data->smu_buffer.mc_addr)); lower_32_bits(smu_data->smu_buffer.mc_addr),
NULL);
} }
fw_to_load = UCODE_ID_RLC_G_MASK fw_to_load = UCODE_ID_RLC_G_MASK
+ UCODE_ID_SDMA0_MASK + UCODE_ID_SDMA0_MASK
...@@ -405,10 +407,16 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) ...@@ -405,10 +407,16 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)
} }
memcpy_toio(smu_data->header_buffer.kaddr, smu_data->toc, memcpy_toio(smu_data->header_buffer.kaddr, smu_data->toc,
sizeof(struct SMU_DRAMData_TOC)); sizeof(struct SMU_DRAMData_TOC));
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_DRV_DRAM_ADDR_HI, upper_32_bits(smu_data->header_buffer.mc_addr)); smum_send_msg_to_smc_with_parameter(hwmgr,
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_DRV_DRAM_ADDR_LO, lower_32_bits(smu_data->header_buffer.mc_addr)); PPSMC_MSG_DRV_DRAM_ADDR_HI,
upper_32_bits(smu_data->header_buffer.mc_addr),
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_LoadUcodes, fw_to_load); NULL);
smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_DRV_DRAM_ADDR_LO,
lower_32_bits(smu_data->header_buffer.mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_LoadUcodes, fw_to_load, NULL);
r = smu7_check_fw_load_finish(hwmgr, fw_to_load); r = smu7_check_fw_load_finish(hwmgr, fw_to_load);
if (!r) if (!r)
......
...@@ -612,16 +612,19 @@ static int smu8_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table) ...@@ -612,16 +612,19 @@ static int smu8_download_pptable_settings(struct pp_hwmgr *hwmgr, void **table)
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetClkTableAddrHi, PPSMC_MSG_SetClkTableAddrHi,
upper_32_bits(smu8_smu->scratch_buffer[i].mc_addr)); upper_32_bits(smu8_smu->scratch_buffer[i].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetClkTableAddrLo, PPSMC_MSG_SetClkTableAddrLo,
lower_32_bits(smu8_smu->scratch_buffer[i].mc_addr)); lower_32_bits(smu8_smu->scratch_buffer[i].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ExecuteJob, smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ExecuteJob,
smu8_smu->toc_entry_clock_table); smu8_smu->toc_entry_clock_table,
NULL);
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ClkTableXferToDram); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ClkTableXferToDram, NULL);
return 0; return 0;
} }
...@@ -639,16 +642,19 @@ static int smu8_upload_pptable_settings(struct pp_hwmgr *hwmgr) ...@@ -639,16 +642,19 @@ static int smu8_upload_pptable_settings(struct pp_hwmgr *hwmgr)
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetClkTableAddrHi, PPSMC_MSG_SetClkTableAddrHi,
upper_32_bits(smu8_smu->scratch_buffer[i].mc_addr)); upper_32_bits(smu8_smu->scratch_buffer[i].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetClkTableAddrLo, PPSMC_MSG_SetClkTableAddrLo,
lower_32_bits(smu8_smu->scratch_buffer[i].mc_addr)); lower_32_bits(smu8_smu->scratch_buffer[i].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ExecuteJob, smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ExecuteJob,
smu8_smu->toc_entry_clock_table); smu8_smu->toc_entry_clock_table,
NULL);
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ClkTableXferToSmu); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ClkTableXferToSmu, NULL);
return 0; return 0;
} }
...@@ -673,23 +679,28 @@ static int smu8_request_smu_load_fw(struct pp_hwmgr *hwmgr) ...@@ -673,23 +679,28 @@ static int smu8_request_smu_load_fw(struct pp_hwmgr *hwmgr)
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_DriverDramAddrHi, PPSMC_MSG_DriverDramAddrHi,
upper_32_bits(smu8_smu->toc_buffer.mc_addr)); upper_32_bits(smu8_smu->toc_buffer.mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_DriverDramAddrLo, PPSMC_MSG_DriverDramAddrLo,
lower_32_bits(smu8_smu->toc_buffer.mc_addr)); lower_32_bits(smu8_smu->toc_buffer.mc_addr),
NULL);
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_InitJobs); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_InitJobs, NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_ExecuteJob, PPSMC_MSG_ExecuteJob,
smu8_smu->toc_entry_aram); smu8_smu->toc_entry_aram,
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ExecuteJob, smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_ExecuteJob,
smu8_smu->toc_entry_power_profiling_index); smu8_smu->toc_entry_power_profiling_index,
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_ExecuteJob, PPSMC_MSG_ExecuteJob,
smu8_smu->toc_entry_initialize_index); smu8_smu->toc_entry_initialize_index,
NULL);
fw_to_check = UCODE_ID_RLC_G_MASK | fw_to_check = UCODE_ID_RLC_G_MASK |
UCODE_ID_SDMA0_MASK | UCODE_ID_SDMA0_MASK |
...@@ -860,11 +871,13 @@ static bool smu8_dpm_check_smu_features(struct pp_hwmgr *hwmgr, ...@@ -860,11 +871,13 @@ static bool smu8_dpm_check_smu_features(struct pp_hwmgr *hwmgr,
unsigned long check_feature) unsigned long check_feature)
{ {
int result; int result;
unsigned long features; uint32_t features;
result = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetFeatureStatus, 0); result = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_GetFeatureStatus,
0,
&features);
if (result == 0) { if (result == 0) {
features = smum_get_argument(hwmgr);
if (features & check_feature) if (features & check_feature)
return true; return true;
} }
......
...@@ -103,14 +103,6 @@ int smum_process_firmware_header(struct pp_hwmgr *hwmgr) ...@@ -103,14 +103,6 @@ int smum_process_firmware_header(struct pp_hwmgr *hwmgr)
return 0; return 0;
} }
uint32_t smum_get_argument(struct pp_hwmgr *hwmgr)
{
if (NULL != hwmgr->smumgr_funcs->get_argument)
return hwmgr->smumgr_funcs->get_argument(hwmgr);
return 0;
}
uint32_t smum_get_mac_definition(struct pp_hwmgr *hwmgr, uint32_t value) uint32_t smum_get_mac_definition(struct pp_hwmgr *hwmgr, uint32_t value)
{ {
if (NULL != hwmgr->smumgr_funcs->get_mac_definition) if (NULL != hwmgr->smumgr_funcs->get_mac_definition)
...@@ -135,22 +127,46 @@ int smum_upload_powerplay_table(struct pp_hwmgr *hwmgr) ...@@ -135,22 +127,46 @@ int smum_upload_powerplay_table(struct pp_hwmgr *hwmgr)
return 0; return 0;
} }
int smum_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg) int smum_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg, uint32_t *resp)
{ {
if (hwmgr == NULL || hwmgr->smumgr_funcs->send_msg_to_smc == NULL) int ret = 0;
if (hwmgr == NULL ||
hwmgr->smumgr_funcs->send_msg_to_smc == NULL ||
(resp && !hwmgr->smumgr_funcs->get_argument))
return -EINVAL; return -EINVAL;
return hwmgr->smumgr_funcs->send_msg_to_smc(hwmgr, msg); ret = hwmgr->smumgr_funcs->send_msg_to_smc(hwmgr, msg);
if (ret)
return ret;
if (resp)
*resp = hwmgr->smumgr_funcs->get_argument(hwmgr);
return ret;
} }
int smum_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr, int smum_send_msg_to_smc_with_parameter(struct pp_hwmgr *hwmgr,
uint16_t msg, uint32_t parameter) uint16_t msg,
uint32_t parameter,
uint32_t *resp)
{ {
int ret = 0;
if (hwmgr == NULL || if (hwmgr == NULL ||
hwmgr->smumgr_funcs->send_msg_to_smc_with_parameter == NULL) hwmgr->smumgr_funcs->send_msg_to_smc_with_parameter == NULL ||
(resp && !hwmgr->smumgr_funcs->get_argument))
return -EINVAL; return -EINVAL;
return hwmgr->smumgr_funcs->send_msg_to_smc_with_parameter(
ret = hwmgr->smumgr_funcs->send_msg_to_smc_with_parameter(
hwmgr, msg, parameter); hwmgr, msg, parameter);
if (ret)
return ret;
if (resp)
*resp = hwmgr->smumgr_funcs->get_argument(hwmgr);
return ret;
} }
int smum_init_smc_table(struct pp_hwmgr *hwmgr) int smum_init_smc_table(struct pp_hwmgr *hwmgr)
......
...@@ -2702,7 +2702,8 @@ static int tonga_update_uvd_smc_table(struct pp_hwmgr *hwmgr) ...@@ -2702,7 +2702,8 @@ static int tonga_update_uvd_smc_table(struct pp_hwmgr *hwmgr)
PHM_PlatformCaps_StablePState)) PHM_PlatformCaps_StablePState))
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_UVDDPM_SetEnabledMask, PPSMC_MSG_UVDDPM_SetEnabledMask,
(uint32_t)(1 << smu_data->smc_state_table.UvdBootLevel)); (uint32_t)(1 << smu_data->smc_state_table.UvdBootLevel),
NULL);
return 0; return 0;
} }
...@@ -2733,7 +2734,8 @@ static int tonga_update_vce_smc_table(struct pp_hwmgr *hwmgr) ...@@ -2733,7 +2734,8 @@ static int tonga_update_vce_smc_table(struct pp_hwmgr *hwmgr)
PHM_PlatformCaps_StablePState)) PHM_PlatformCaps_StablePState))
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_VCEDPM_SetEnabledMask, PPSMC_MSG_VCEDPM_SetEnabledMask,
(uint32_t)1 << smu_data->smc_state_table.VceBootLevel); (uint32_t)1 << smu_data->smc_state_table.VceBootLevel,
NULL);
return 0; return 0;
} }
...@@ -3168,7 +3170,7 @@ static int tonga_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -3168,7 +3170,7 @@ static int tonga_update_dpm_settings(struct pp_hwmgr *hwmgr,
if (setting->bupdate_sclk) { if (setting->bupdate_sclk) {
if (!data->sclk_dpm_key_disabled) if (!data->sclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_FreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_FreezeLevel, NULL);
for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount; i++) { for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount; i++) {
if (levels[i].ActivityLevel != if (levels[i].ActivityLevel !=
cpu_to_be16(setting->sclk_activity)) { cpu_to_be16(setting->sclk_activity)) {
...@@ -3198,12 +3200,12 @@ static int tonga_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -3198,12 +3200,12 @@ static int tonga_update_dpm_settings(struct pp_hwmgr *hwmgr,
} }
} }
if (!data->sclk_dpm_key_disabled) if (!data->sclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_UnfreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_SCLKDPM_UnfreezeLevel, NULL);
} }
if (setting->bupdate_mclk) { if (setting->bupdate_mclk) {
if (!data->mclk_dpm_key_disabled) if (!data->mclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_FreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_FreezeLevel, NULL);
for (i = 0; i < smu_data->smc_state_table.MemoryDpmLevelCount; i++) { for (i = 0; i < smu_data->smc_state_table.MemoryDpmLevelCount; i++) {
if (mclk_levels[i].ActivityLevel != if (mclk_levels[i].ActivityLevel !=
cpu_to_be16(setting->mclk_activity)) { cpu_to_be16(setting->mclk_activity)) {
...@@ -3233,7 +3235,7 @@ static int tonga_update_dpm_settings(struct pp_hwmgr *hwmgr, ...@@ -3233,7 +3235,7 @@ static int tonga_update_dpm_settings(struct pp_hwmgr *hwmgr,
} }
} }
if (!data->mclk_dpm_key_disabled) if (!data->mclk_dpm_key_disabled)
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_UnfreezeLevel); smum_send_msg_to_smc(hwmgr, PPSMC_MSG_MCLKDPM_UnfreezeLevel, NULL);
} }
return 0; return 0;
} }
......
...@@ -49,13 +49,16 @@ static int vega10_copy_table_from_smc(struct pp_hwmgr *hwmgr, ...@@ -49,13 +49,16 @@ static int vega10_copy_table_from_smc(struct pp_hwmgr *hwmgr,
"Invalid SMU Table Length!", return -EINVAL); "Invalid SMU Table Length!", return -EINVAL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[table_id].mc_addr)); upper_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[table_id].mc_addr)); lower_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableSmu2Dram, PPSMC_MSG_TransferTableSmu2Dram,
priv->smu_tables.entry[table_id].table_id); priv->smu_tables.entry[table_id].table_id,
NULL);
/* flush hdp cache */ /* flush hdp cache */
amdgpu_asic_flush_hdp(adev, NULL); amdgpu_asic_flush_hdp(adev, NULL);
...@@ -92,13 +95,16 @@ static int vega10_copy_table_to_smc(struct pp_hwmgr *hwmgr, ...@@ -92,13 +95,16 @@ static int vega10_copy_table_to_smc(struct pp_hwmgr *hwmgr,
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[table_id].mc_addr)); upper_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[table_id].mc_addr)); lower_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableDram2Smu, PPSMC_MSG_TransferTableDram2Smu,
priv->smu_tables.entry[table_id].table_id); priv->smu_tables.entry[table_id].table_id,
NULL);
return 0; return 0;
} }
...@@ -118,17 +124,21 @@ int vega10_enable_smc_features(struct pp_hwmgr *hwmgr, ...@@ -118,17 +124,21 @@ int vega10_enable_smc_features(struct pp_hwmgr *hwmgr,
return 0; return 0;
return smum_send_msg_to_smc_with_parameter(hwmgr, return smum_send_msg_to_smc_with_parameter(hwmgr,
msg, feature_mask); msg, feature_mask, NULL);
} }
int vega10_get_enabled_smc_features(struct pp_hwmgr *hwmgr, int vega10_get_enabled_smc_features(struct pp_hwmgr *hwmgr,
uint64_t *features_enabled) uint64_t *features_enabled)
{ {
uint32_t enabled_features;
if (features_enabled == NULL) if (features_enabled == NULL)
return -EINVAL; return -EINVAL;
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetEnabledSmuFeatures); smum_send_msg_to_smc(hwmgr,
*features_enabled = smum_get_argument(hwmgr); PPSMC_MSG_GetEnabledSmuFeatures,
&enabled_features);
*features_enabled = enabled_features;
return 0; return 0;
} }
...@@ -152,10 +162,12 @@ static int vega10_set_tools_address(struct pp_hwmgr *hwmgr) ...@@ -152,10 +162,12 @@ static int vega10_set_tools_address(struct pp_hwmgr *hwmgr)
if (priv->smu_tables.entry[TOOLSTABLE].mc_addr) { if (priv->smu_tables.entry[TOOLSTABLE].mc_addr) {
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetToolsDramAddrHigh, PPSMC_MSG_SetToolsDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[TOOLSTABLE].mc_addr)); upper_32_bits(priv->smu_tables.entry[TOOLSTABLE].mc_addr),
NULL);
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetToolsDramAddrLow, PPSMC_MSG_SetToolsDramAddrLow,
lower_32_bits(priv->smu_tables.entry[TOOLSTABLE].mc_addr)); lower_32_bits(priv->smu_tables.entry[TOOLSTABLE].mc_addr),
NULL);
} }
return 0; return 0;
} }
...@@ -168,10 +180,10 @@ static int vega10_verify_smc_interface(struct pp_hwmgr *hwmgr) ...@@ -168,10 +180,10 @@ static int vega10_verify_smc_interface(struct pp_hwmgr *hwmgr)
uint32_t rev_id; uint32_t rev_id;
PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr, PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetDriverIfVersion), PPSMC_MSG_GetDriverIfVersion,
&smc_driver_if_version),
"Attempt to get SMC IF Version Number Failed!", "Attempt to get SMC IF Version Number Failed!",
return -EINVAL); return -EINVAL);
smc_driver_if_version = smum_get_argument(hwmgr);
dev_id = adev->pdev->device; dev_id = adev->pdev->device;
rev_id = adev->pdev->revision; rev_id = adev->pdev->revision;
......
...@@ -52,16 +52,19 @@ static int vega12_copy_table_from_smc(struct pp_hwmgr *hwmgr, ...@@ -52,16 +52,19 @@ static int vega12_copy_table_from_smc(struct pp_hwmgr *hwmgr,
"Invalid SMU Table Length!", return -EINVAL); "Invalid SMU Table Length!", return -EINVAL);
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[table_id].mc_addr)) == 0, upper_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL) == 0,
"[CopyTableFromSMC] Attempt to Set Dram Addr High Failed!", return -EINVAL); "[CopyTableFromSMC] Attempt to Set Dram Addr High Failed!", return -EINVAL);
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[table_id].mc_addr)) == 0, lower_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL) == 0,
"[CopyTableFromSMC] Attempt to Set Dram Addr Low Failed!", "[CopyTableFromSMC] Attempt to Set Dram Addr Low Failed!",
return -EINVAL); return -EINVAL);
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableSmu2Dram, PPSMC_MSG_TransferTableSmu2Dram,
table_id) == 0, table_id,
NULL) == 0,
"[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!", "[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!",
return -EINVAL); return -EINVAL);
...@@ -100,17 +103,20 @@ static int vega12_copy_table_to_smc(struct pp_hwmgr *hwmgr, ...@@ -100,17 +103,20 @@ static int vega12_copy_table_to_smc(struct pp_hwmgr *hwmgr,
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[table_id].mc_addr)) == 0, upper_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL) == 0,
"[CopyTableToSMC] Attempt to Set Dram Addr High Failed!", "[CopyTableToSMC] Attempt to Set Dram Addr High Failed!",
return -EINVAL;); return -EINVAL;);
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[table_id].mc_addr)) == 0, lower_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL) == 0,
"[CopyTableToSMC] Attempt to Set Dram Addr Low Failed!", "[CopyTableToSMC] Attempt to Set Dram Addr Low Failed!",
return -EINVAL); return -EINVAL);
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableDram2Smu, PPSMC_MSG_TransferTableDram2Smu,
table_id) == 0, table_id,
NULL) == 0,
"[CopyTableToSMC] Attempt to Transfer Table To SMU Failed!", "[CopyTableToSMC] Attempt to Transfer Table To SMU Failed!",
return -EINVAL); return -EINVAL);
...@@ -127,20 +133,20 @@ int vega12_enable_smc_features(struct pp_hwmgr *hwmgr, ...@@ -127,20 +133,20 @@ int vega12_enable_smc_features(struct pp_hwmgr *hwmgr,
if (enable) { if (enable) {
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_EnableSmuFeaturesLow, smu_features_low) == 0, PPSMC_MSG_EnableSmuFeaturesLow, smu_features_low, NULL) == 0,
"[EnableDisableSMCFeatures] Attempt to enable SMU features Low failed!", "[EnableDisableSMCFeatures] Attempt to enable SMU features Low failed!",
return -EINVAL); return -EINVAL);
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_EnableSmuFeaturesHigh, smu_features_high) == 0, PPSMC_MSG_EnableSmuFeaturesHigh, smu_features_high, NULL) == 0,
"[EnableDisableSMCFeatures] Attempt to enable SMU features High failed!", "[EnableDisableSMCFeatures] Attempt to enable SMU features High failed!",
return -EINVAL); return -EINVAL);
} else { } else {
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_DisableSmuFeaturesLow, smu_features_low) == 0, PPSMC_MSG_DisableSmuFeaturesLow, smu_features_low, NULL) == 0,
"[EnableDisableSMCFeatures] Attempt to disable SMU features Low failed!", "[EnableDisableSMCFeatures] Attempt to disable SMU features Low failed!",
return -EINVAL); return -EINVAL);
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_DisableSmuFeaturesHigh, smu_features_high) == 0, PPSMC_MSG_DisableSmuFeaturesHigh, smu_features_high, NULL) == 0,
"[EnableDisableSMCFeatures] Attempt to disable SMU features High failed!", "[EnableDisableSMCFeatures] Attempt to disable SMU features High failed!",
return -EINVAL); return -EINVAL);
} }
...@@ -157,16 +163,16 @@ int vega12_get_enabled_smc_features(struct pp_hwmgr *hwmgr, ...@@ -157,16 +163,16 @@ int vega12_get_enabled_smc_features(struct pp_hwmgr *hwmgr,
return -EINVAL; return -EINVAL;
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetEnabledSmuFeaturesLow) == 0, PPSMC_MSG_GetEnabledSmuFeaturesLow,
&smc_features_low) == 0,
"[GetEnabledSMCFeatures] Attempt to get SMU features Low failed!", "[GetEnabledSMCFeatures] Attempt to get SMU features Low failed!",
return -EINVAL); return -EINVAL);
smc_features_low = smum_get_argument(hwmgr);
PP_ASSERT_WITH_CODE(smum_send_msg_to_smc(hwmgr, PP_ASSERT_WITH_CODE(smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetEnabledSmuFeaturesHigh) == 0, PPSMC_MSG_GetEnabledSmuFeaturesHigh,
&smc_features_high) == 0,
"[GetEnabledSMCFeatures] Attempt to get SMU features High failed!", "[GetEnabledSMCFeatures] Attempt to get SMU features High failed!",
return -EINVAL); return -EINVAL);
smc_features_high = smum_get_argument(hwmgr);
*features_enabled = ((((uint64_t)smc_features_low << SMU_FEATURES_LOW_SHIFT) & SMU_FEATURES_LOW_MASK) | *features_enabled = ((((uint64_t)smc_features_low << SMU_FEATURES_LOW_SHIFT) & SMU_FEATURES_LOW_MASK) |
(((uint64_t)smc_features_high << SMU_FEATURES_HIGH_SHIFT) & SMU_FEATURES_HIGH_MASK)); (((uint64_t)smc_features_high << SMU_FEATURES_HIGH_SHIFT) & SMU_FEATURES_HIGH_MASK));
...@@ -194,10 +200,12 @@ static int vega12_set_tools_address(struct pp_hwmgr *hwmgr) ...@@ -194,10 +200,12 @@ static int vega12_set_tools_address(struct pp_hwmgr *hwmgr)
if (priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr) { if (priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr) {
if (!smum_send_msg_to_smc_with_parameter(hwmgr, if (!smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetToolsDramAddrHigh, PPSMC_MSG_SetToolsDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr))) upper_32_bits(priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr),
NULL))
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetToolsDramAddrLow, PPSMC_MSG_SetToolsDramAddrLow,
lower_32_bits(priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr)); lower_32_bits(priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr),
NULL);
} }
return 0; return 0;
} }
......
...@@ -177,16 +177,18 @@ static int vega20_copy_table_from_smc(struct pp_hwmgr *hwmgr, ...@@ -177,16 +177,18 @@ static int vega20_copy_table_from_smc(struct pp_hwmgr *hwmgr,
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[table_id].mc_addr))) == 0, upper_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL)) == 0,
"[CopyTableFromSMC] Attempt to Set Dram Addr High Failed!", "[CopyTableFromSMC] Attempt to Set Dram Addr High Failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[table_id].mc_addr))) == 0, lower_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL)) == 0,
"[CopyTableFromSMC] Attempt to Set Dram Addr Low Failed!", "[CopyTableFromSMC] Attempt to Set Dram Addr Low Failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableSmu2Dram, table_id)) == 0, PPSMC_MSG_TransferTableSmu2Dram, table_id, NULL)) == 0,
"[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!", "[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!",
return ret); return ret);
...@@ -226,16 +228,18 @@ static int vega20_copy_table_to_smc(struct pp_hwmgr *hwmgr, ...@@ -226,16 +228,18 @@ static int vega20_copy_table_to_smc(struct pp_hwmgr *hwmgr,
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[table_id].mc_addr))) == 0, upper_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL)) == 0,
"[CopyTableToSMC] Attempt to Set Dram Addr High Failed!", "[CopyTableToSMC] Attempt to Set Dram Addr High Failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[table_id].mc_addr))) == 0, lower_32_bits(priv->smu_tables.entry[table_id].mc_addr),
NULL)) == 0,
"[CopyTableToSMC] Attempt to Set Dram Addr Low Failed!", "[CopyTableToSMC] Attempt to Set Dram Addr Low Failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableDram2Smu, table_id)) == 0, PPSMC_MSG_TransferTableDram2Smu, table_id, NULL)) == 0,
"[CopyTableToSMC] Attempt to Transfer Table To SMU Failed!", "[CopyTableToSMC] Attempt to Transfer Table To SMU Failed!",
return ret); return ret);
...@@ -257,16 +261,20 @@ int vega20_set_activity_monitor_coeff(struct pp_hwmgr *hwmgr, ...@@ -257,16 +261,20 @@ int vega20_set_activity_monitor_coeff(struct pp_hwmgr *hwmgr,
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].mc_addr))) == 0, upper_32_bits(priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].mc_addr),
NULL)) == 0,
"[SetActivityMonitor] Attempt to Set Dram Addr High Failed!", "[SetActivityMonitor] Attempt to Set Dram Addr High Failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].mc_addr))) == 0, lower_32_bits(priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].mc_addr),
NULL)) == 0,
"[SetActivityMonitor] Attempt to Set Dram Addr Low Failed!", "[SetActivityMonitor] Attempt to Set Dram Addr Low Failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableDram2Smu, TABLE_ACTIVITY_MONITOR_COEFF | (workload_type << 16))) == 0, PPSMC_MSG_TransferTableDram2Smu,
TABLE_ACTIVITY_MONITOR_COEFF | (workload_type << 16),
NULL)) == 0,
"[SetActivityMonitor] Attempt to Transfer Table To SMU Failed!", "[SetActivityMonitor] Attempt to Transfer Table To SMU Failed!",
return ret); return ret);
...@@ -283,17 +291,19 @@ int vega20_get_activity_monitor_coeff(struct pp_hwmgr *hwmgr, ...@@ -283,17 +291,19 @@ int vega20_get_activity_monitor_coeff(struct pp_hwmgr *hwmgr,
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].mc_addr))) == 0, upper_32_bits(priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].mc_addr),
NULL)) == 0,
"[GetActivityMonitor] Attempt to Set Dram Addr High Failed!", "[GetActivityMonitor] Attempt to Set Dram Addr High Failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].mc_addr))) == 0, lower_32_bits(priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF].mc_addr),
NULL)) == 0,
"[GetActivityMonitor] Attempt to Set Dram Addr Low Failed!", "[GetActivityMonitor] Attempt to Set Dram Addr Low Failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_TransferTableSmu2Dram, PPSMC_MSG_TransferTableSmu2Dram,
TABLE_ACTIVITY_MONITOR_COEFF | (workload_type << 16))) == 0, TABLE_ACTIVITY_MONITOR_COEFF | (workload_type << 16), NULL)) == 0,
"[GetActivityMonitor] Attempt to Transfer Table From SMU Failed!", "[GetActivityMonitor] Attempt to Transfer Table From SMU Failed!",
return ret); return ret);
...@@ -317,20 +327,20 @@ int vega20_enable_smc_features(struct pp_hwmgr *hwmgr, ...@@ -317,20 +327,20 @@ int vega20_enable_smc_features(struct pp_hwmgr *hwmgr,
if (enable) { if (enable) {
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_EnableSmuFeaturesLow, smu_features_low)) == 0, PPSMC_MSG_EnableSmuFeaturesLow, smu_features_low, NULL)) == 0,
"[EnableDisableSMCFeatures] Attempt to enable SMU features Low failed!", "[EnableDisableSMCFeatures] Attempt to enable SMU features Low failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_EnableSmuFeaturesHigh, smu_features_high)) == 0, PPSMC_MSG_EnableSmuFeaturesHigh, smu_features_high, NULL)) == 0,
"[EnableDisableSMCFeatures] Attempt to enable SMU features High failed!", "[EnableDisableSMCFeatures] Attempt to enable SMU features High failed!",
return ret); return ret);
} else { } else {
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_DisableSmuFeaturesLow, smu_features_low)) == 0, PPSMC_MSG_DisableSmuFeaturesLow, smu_features_low, NULL)) == 0,
"[EnableDisableSMCFeatures] Attempt to disable SMU features Low failed!", "[EnableDisableSMCFeatures] Attempt to disable SMU features Low failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_DisableSmuFeaturesHigh, smu_features_high)) == 0, PPSMC_MSG_DisableSmuFeaturesHigh, smu_features_high, NULL)) == 0,
"[EnableDisableSMCFeatures] Attempt to disable SMU features High failed!", "[EnableDisableSMCFeatures] Attempt to disable SMU features High failed!",
return ret); return ret);
} }
...@@ -348,15 +358,15 @@ int vega20_get_enabled_smc_features(struct pp_hwmgr *hwmgr, ...@@ -348,15 +358,15 @@ int vega20_get_enabled_smc_features(struct pp_hwmgr *hwmgr,
return -EINVAL; return -EINVAL;
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetEnabledSmuFeaturesLow)) == 0, PPSMC_MSG_GetEnabledSmuFeaturesLow,
&smc_features_low)) == 0,
"[GetEnabledSMCFeatures] Attempt to get SMU features Low failed!", "[GetEnabledSMCFeatures] Attempt to get SMU features Low failed!",
return ret); return ret);
smc_features_low = smum_get_argument(hwmgr);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetEnabledSmuFeaturesHigh)) == 0, PPSMC_MSG_GetEnabledSmuFeaturesHigh,
&smc_features_high)) == 0,
"[GetEnabledSMCFeatures] Attempt to get SMU features High failed!", "[GetEnabledSMCFeatures] Attempt to get SMU features High failed!",
return ret); return ret);
smc_features_high = smum_get_argument(hwmgr);
*features_enabled = ((((uint64_t)smc_features_low << SMU_FEATURES_LOW_SHIFT) & SMU_FEATURES_LOW_MASK) | *features_enabled = ((((uint64_t)smc_features_low << SMU_FEATURES_LOW_SHIFT) & SMU_FEATURES_LOW_MASK) |
(((uint64_t)smc_features_high << SMU_FEATURES_HIGH_SHIFT) & SMU_FEATURES_HIGH_MASK)); (((uint64_t)smc_features_high << SMU_FEATURES_HIGH_SHIFT) & SMU_FEATURES_HIGH_MASK));
...@@ -373,11 +383,13 @@ static int vega20_set_tools_address(struct pp_hwmgr *hwmgr) ...@@ -373,11 +383,13 @@ static int vega20_set_tools_address(struct pp_hwmgr *hwmgr)
if (priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr) { if (priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr) {
ret = smum_send_msg_to_smc_with_parameter(hwmgr, ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetToolsDramAddrHigh, PPSMC_MSG_SetToolsDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr)); upper_32_bits(priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr),
NULL);
if (!ret) if (!ret)
ret = smum_send_msg_to_smc_with_parameter(hwmgr, ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetToolsDramAddrLow, PPSMC_MSG_SetToolsDramAddrLow,
lower_32_bits(priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr)); lower_32_bits(priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr),
NULL);
} }
return ret; return ret;
...@@ -391,12 +403,14 @@ int vega20_set_pptable_driver_address(struct pp_hwmgr *hwmgr) ...@@ -391,12 +403,14 @@ int vega20_set_pptable_driver_address(struct pp_hwmgr *hwmgr)
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh,
upper_32_bits(priv->smu_tables.entry[TABLE_PPTABLE].mc_addr))) == 0, upper_32_bits(priv->smu_tables.entry[TABLE_PPTABLE].mc_addr),
NULL)) == 0,
"[SetPPtabeDriverAddress] Attempt to Set Dram Addr High Failed!", "[SetPPtabeDriverAddress] Attempt to Set Dram Addr High Failed!",
return ret); return ret);
PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr, PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_SetDriverDramAddrLow, PPSMC_MSG_SetDriverDramAddrLow,
lower_32_bits(priv->smu_tables.entry[TABLE_PPTABLE].mc_addr))) == 0, lower_32_bits(priv->smu_tables.entry[TABLE_PPTABLE].mc_addr),
NULL)) == 0,
"[SetPPtabeDriverAddress] Attempt to Set Dram Addr Low Failed!", "[SetPPtabeDriverAddress] Attempt to Set Dram Addr Low Failed!",
return ret); return ret);
......
...@@ -356,7 +356,8 @@ static int vegam_update_uvd_smc_table(struct pp_hwmgr *hwmgr) ...@@ -356,7 +356,8 @@ static int vegam_update_uvd_smc_table(struct pp_hwmgr *hwmgr)
PHM_PlatformCaps_StablePState)) PHM_PlatformCaps_StablePState))
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_UVDDPM_SetEnabledMask, PPSMC_MSG_UVDDPM_SetEnabledMask,
(uint32_t)(1 << smu_data->smc_state_table.UvdBootLevel)); (uint32_t)(1 << smu_data->smc_state_table.UvdBootLevel),
NULL);
return 0; return 0;
} }
...@@ -388,7 +389,8 @@ static int vegam_update_vce_smc_table(struct pp_hwmgr *hwmgr) ...@@ -388,7 +389,8 @@ static int vegam_update_vce_smc_table(struct pp_hwmgr *hwmgr)
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_StablePState)) if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_StablePState))
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_VCEDPM_SetEnabledMask, PPSMC_MSG_VCEDPM_SetEnabledMask,
(uint32_t)1 << smu_data->smc_state_table.VceBootLevel); (uint32_t)1 << smu_data->smc_state_table.VceBootLevel,
NULL);
return 0; return 0;
} }
...@@ -1906,7 +1908,8 @@ static int vegam_enable_reconfig_cus(struct pp_hwmgr *hwmgr) ...@@ -1906,7 +1908,8 @@ static int vegam_enable_reconfig_cus(struct pp_hwmgr *hwmgr)
smum_send_msg_to_smc_with_parameter(hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr,
PPSMC_MSG_EnableModeSwitchRLCNotification, PPSMC_MSG_EnableModeSwitchRLCNotification,
adev->gfx.cu_info.number); adev->gfx.cu_info.number,
NULL);
return 0; return 0;
} }
...@@ -2060,7 +2063,7 @@ static int vegam_init_smc_table(struct pp_hwmgr *hwmgr) ...@@ -2060,7 +2063,7 @@ static int vegam_init_smc_table(struct pp_hwmgr *hwmgr)
table->AcDcGpio = gpio_pin.uc_gpio_pin_bit_shift; table->AcDcGpio = gpio_pin.uc_gpio_pin_bit_shift;
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_AutomaticDCTransition) && PHM_PlatformCaps_AutomaticDCTransition) &&
!smum_send_msg_to_smc(hwmgr, PPSMC_MSG_UseNewGPIOScheme)) !smum_send_msg_to_smc(hwmgr, PPSMC_MSG_UseNewGPIOScheme, NULL))
phm_cap_set(hwmgr->platform_descriptor.platformCaps, phm_cap_set(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_SMCtoPPLIBAcdcGpioScheme); PHM_PlatformCaps_SMCtoPPLIBAcdcGpioScheme);
} else { } else {
...@@ -2250,10 +2253,12 @@ int vegam_thermal_avfs_enable(struct pp_hwmgr *hwmgr) ...@@ -2250,10 +2253,12 @@ int vegam_thermal_avfs_enable(struct pp_hwmgr *hwmgr)
if (!hwmgr->avfs_supported) if (!hwmgr->avfs_supported)
return 0; return 0;
ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs); ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs, NULL);
if (!ret) { if (!ret) {
if (data->apply_avfs_cks_off_voltage) if (data->apply_avfs_cks_off_voltage)
ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ApplyAvfsCksOffVoltage); ret = smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_ApplyAvfsCksOffVoltage,
NULL);
} }
return ret; return ret;
......
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