bool is_support_sw_smu(struct amdgpu_device *adev)
{
- if (adev->asic_type >= CHIP_ARCTURUS) {
- if (amdgpu_sriov_is_pp_one_vf(adev) || !amdgpu_sriov_vf(adev))
- return true;
- }
+ if (adev->asic_type >= CHIP_ARCTURUS)
+ return true;
return false;
}
return ret;
/* smu_dump_pptable(smu); */
- if (!amdgpu_sriov_vf(adev)) {
- /*
- * Copy pptable bo in the vram to smc with SMU MSGs such as
- * SetDriverDramAddr and TransferTableDram2Smu.
- */
- ret = smu_write_pptable(smu);
- if (ret)
- return ret;
-
- /* issue Run*Btc msg */
- ret = smu_run_btc(smu);
- if (ret)
- return ret;
- ret = smu_feature_set_allowed_mask(smu);
- if (ret)
- return ret;
+ /*
+ * Copy pptable bo in the vram to smc with SMU MSGs such as
+ * SetDriverDramAddr and TransferTableDram2Smu.
+ */
+ ret = smu_write_pptable(smu);
+ if (ret)
+ return ret;
- ret = smu_system_features_control(smu, true);
- if (ret)
- return ret;
+ /* issue Run*Btc msg */
+ ret = smu_run_btc(smu);
+ if (ret)
+ return ret;
+ ret = smu_feature_set_allowed_mask(smu);
+ if (ret)
+ return ret;
- if (adev->asic_type == CHIP_NAVI10) {
- if ((adev->pdev->device == 0x731f && (adev->pdev->revision == 0xc2 ||
- adev->pdev->revision == 0xc3 ||
- adev->pdev->revision == 0xca ||
- adev->pdev->revision == 0xcb)) ||
- (adev->pdev->device == 0x66af && (adev->pdev->revision == 0xf3 ||
- adev->pdev->revision == 0xf4 ||
- adev->pdev->revision == 0xf5 ||
- adev->pdev->revision == 0xf6))) {
- ret = smu_disable_umc_cdr_12gbps_workaround(smu);
- if (ret) {
- pr_err("Workaround failed to disable UMC CDR feature on 12Gbps SKU!\n");
- return ret;
- }
- }
- }
+ ret = smu_system_features_control(smu, true);
+ if (ret)
+ return ret;
- if (smu->ppt_funcs->set_power_source) {
- /*
- * For Navi1X, manually switch it to AC mode as PMFW
- * may boot it with DC mode.
- */
- if (adev->pm.ac_power)
- ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC);
- else
- ret = smu_set_power_source(smu, SMU_POWER_SOURCE_DC);
+ if (adev->asic_type == CHIP_NAVI10) {
+ if (adev->pdev->device == 0x731f && (adev->pdev->revision == 0xc2 ||
+ adev->pdev->revision == 0xc3 ||
+ adev->pdev->revision == 0xca ||
+ adev->pdev->revision == 0xcb)) {
+ ret = smu_disable_umc_cdr_12gbps_workaround(smu);
if (ret) {
- pr_err("Failed to switch to %s mode!\n", adev->pm.ac_power ? "AC" : "DC");
+ pr_err("Workaround failed to disable UMC CDR feature on 12Gbps SKU!\n");
return ret;
}
}
}
+
+ if (smu->ppt_funcs->set_power_source) {
+ /*
+ * For Navi1X, manually switch it to AC mode as PMFW
+ * may boot it with DC mode.
+ */
+ if (adev->pm.ac_power)
+ ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC);
+ else
+ ret = smu_set_power_source(smu, SMU_POWER_SOURCE_DC);
+ if (ret) {
+ pr_err("Failed to switch to %s mode!\n", adev->pm.ac_power ? "AC" : "DC");
+ return ret;
+ }
+ }
+
if (adev->asic_type != CHIP_ARCTURUS) {
ret = smu_notify_display_change(smu);
if (ret)
/*
* Set PMSTATUSLOG table bo address with SetToolsDramAddr MSG for tools.
*/
- if (!amdgpu_sriov_vf(adev)) {
- ret = smu_set_tool_table_location(smu);
- }
+ ret = smu_set_tool_table_location(smu);
+
if (!smu_is_dpm_running(smu))
pr_info("dpm has been disabled\n");
static int smu_stop_dpms(struct smu_context *smu)
{
- if (amdgpu_sriov_vf(smu->adev))
- return 0;
-
return smu_system_features_control(smu, false);
}
adev->pm.dpm_enabled = false;
- if (!amdgpu_sriov_vf(adev)){
+ if (!amdgpu_sriov_vf(adev)) {
smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);
+ }
+
+ ret = smu_stop_thermal_control(smu);
+ if (ret) {
+ pr_warn("Fail to stop thermal control!\n");
+ return ret;
+ }
- ret = smu_stop_thermal_control(smu);
+ /*
+ * For custom pptable uploading, skip the DPM features
+ * disable process on Navi1x ASICs.
+ * - As the gfx related features are under control of
+ * RLC on those ASICs. RLC reinitialization will be
+ * needed to reenable them. That will cost much more
+ * efforts.
+ *
+ * - SMU firmware can handle the DPM reenablement
+ * properly.
+ */
+ if (!smu->uploading_custom_pp_table ||
+ !((adev->asic_type >= CHIP_NAVI10) &&
+ (adev->asic_type <= CHIP_NAVI12))) {
+ ret = smu_stop_dpms(smu);
if (ret) {
- pr_warn("Fail to stop thermal control!\n");
+ pr_warn("Fail to stop Dpms!\n");
return ret;
}
-
- /*
- * For custom pptable uploading, skip the DPM features
- * disable process on Navi1x ASICs.
- * - As the gfx related features are under control of
- * RLC on those ASICs. RLC reinitialization will be
- * needed to reenable them. That will cost much more
- * efforts.
- *
- * - SMU firmware can handle the DPM reenablement
- * properly.
- */
- if (!smu->uploading_custom_pp_table ||
- !((adev->asic_type >= CHIP_NAVI10) &&
- (adev->asic_type <= CHIP_NAVI12))) {
- ret = smu_stop_dpms(smu);
- if (ret) {
- pr_warn("Fail to stop Dpms!\n");
- return ret;
- }
- }
}
kfree(table_context->driver_pptable);
if (!amdgpu_sriov_vf(adev)) {
smu_i2c_eeprom_fini(smu, &adev->pm.smu_i2c);
-
- ret = smu_disable_dpm(smu);
- if (ret)
- return ret;
}
+ ret = smu_disable_dpm(smu);
+ if (ret)
+ return ret;
+
smu->watermarks_bitmap &= ~(WATERMARKS_LOADED);
if (adev->asic_type >= CHIP_NAVI10 &&
static int arcturus_get_power_profile_mode(struct smu_context *smu,
char *buf)
{
- struct amdgpu_device *adev = smu->adev;
DpmActivityMonitorCoeffInt_t activity_monitor;
static const char *profile_name[] = {
"BOOTUP_DEFAULT",
if (result)
return result;
- if (smu_version >= 0x360d00 && !amdgpu_sriov_vf(adev))
+ if (smu_version >= 0x360d00)
size += sprintf(buf + size, "%16s %s %s %s %s %s %s %s %s %s %s\n",
title[0], title[1], title[2], title[3], title[4], title[5],
title[6], title[7], title[8], title[9], title[10]);
if (workload_type < 0)
continue;
- if (smu_version >= 0x360d00 && !amdgpu_sriov_vf(adev)) {
+ if (smu_version >= 0x360d00) {
result = smu_update_table(smu,
SMU_TABLE_ACTIVITY_MONITOR_COEFF,
workload_type,
size += sprintf(buf + size, "%2d %14s%s\n",
i, profile_name[i], (i == smu->power_profile_mode) ? "*" : " ");
- if (smu_version >= 0x360d00 && !amdgpu_sriov_vf(adev)) {
+ if (smu_version >= 0x360d00) {
size += sprintf(buf + size, "%19s %d(%13s) %7d %7d %7d %7d %7d %7d %7d %7d %7d\n",
" ",
0,
{
int ret;
- if (amdgpu_sriov_vf(smu->adev))
- return 0;
-
ret = smu_send_smc_msg_with_param(smu,
SMU_MSG_SetMinDeepSleepDcefclk, clk, NULL);
if (ret)
int ret = 0;
struct smu_table *tool_table = &smu->smu_table.tables[SMU_TABLE_PMSTATUSLOG];
- if (amdgpu_sriov_vf(smu->adev))
- return 0;
-
if (tool_table->mc_address) {
ret = smu_send_smc_msg_with_param(smu,
SMU_MSG_SetToolsDramAddrHigh,
{
int ret = 0;
- if (amdgpu_sriov_vf(smu->adev))
- return 0;
-
if (!smu->pm_enabled)
return ret;
int ret = 0;
uint32_t feature_mask[2];
- if (amdgpu_sriov_vf(smu->adev))
- return 0;
-
mutex_lock(&feature->mutex);
if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->feature_num < 64)
goto failed;
struct smu_feature *feature = &smu->smu_feature;
int ret = 0;
- if (amdgpu_sriov_vf(smu->adev) && !amdgpu_sriov_is_pp_one_vf(smu->adev))
- return 0;
-
if (!feature_mask || num < 2)
return -EINVAL;
{
int ret = 0;
- if (amdgpu_sriov_vf(smu->adev))
- return 0;
-
if (!smu->pm_enabled)
return ret;
int ret = 0;
uint32_t max_power_limit;
- if (amdgpu_sriov_vf(smu->adev))
- return 0;
-
max_power_limit = smu_v11_0_get_max_power_limit(smu);
if (n > max_power_limit) {
uint32_t pcie_gen = 0, pcie_width = 0;
int ret;
- if (amdgpu_sriov_vf(smu->adev))
- return 0;
-
if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4)
pcie_gen = 3;
else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)