Commit fa4b5471 authored by Alex Deucher's avatar Alex Deucher

drm/radeon/dpm: add dpm_enable failure output (7xx-ni)

Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a9e61410
...@@ -2353,15 +2353,19 @@ int btc_dpm_enable(struct radeon_device *rdev) ...@@ -2353,15 +2353,19 @@ int btc_dpm_enable(struct radeon_device *rdev)
if (pi->voltage_control) { if (pi->voltage_control) {
rv770_enable_voltage_control(rdev, true); rv770_enable_voltage_control(rdev, true);
ret = cypress_construct_voltage_tables(rdev); ret = cypress_construct_voltage_tables(rdev);
if (ret) if (ret) {
DRM_ERROR("cypress_construct_voltage_tables failed\n");
return ret; return ret;
} }
}
if (pi->mvdd_control) { if (pi->mvdd_control) {
ret = cypress_get_mvdd_configuration(rdev); ret = cypress_get_mvdd_configuration(rdev);
if (ret) if (ret) {
DRM_ERROR("cypress_get_mvdd_configuration failed\n");
return ret; return ret;
} }
}
if (eg_pi->dynamic_ac_timing) { if (eg_pi->dynamic_ac_timing) {
ret = btc_initialize_mc_reg_table(rdev); ret = btc_initialize_mc_reg_table(rdev);
...@@ -2391,27 +2395,34 @@ int btc_dpm_enable(struct radeon_device *rdev) ...@@ -2391,27 +2395,34 @@ int btc_dpm_enable(struct radeon_device *rdev)
btc_enable_dynamic_pcie_gen2(rdev, true); btc_enable_dynamic_pcie_gen2(rdev, true);
ret = rv770_upload_firmware(rdev); ret = rv770_upload_firmware(rdev);
if (ret) if (ret) {
DRM_ERROR("rv770_upload_firmware failed\n");
return ret; return ret;
}
ret = cypress_get_table_locations(rdev); ret = cypress_get_table_locations(rdev);
if (ret) if (ret) {
DRM_ERROR("cypress_get_table_locations failed\n");
return ret; return ret;
}
ret = btc_init_smc_table(rdev, boot_ps); ret = btc_init_smc_table(rdev, boot_ps);
if (ret) if (ret)
return ret; return ret;
if (eg_pi->dynamic_ac_timing) { if (eg_pi->dynamic_ac_timing) {
ret = cypress_populate_mc_reg_table(rdev, boot_ps); ret = cypress_populate_mc_reg_table(rdev, boot_ps);
if (ret) if (ret) {
DRM_ERROR("cypress_populate_mc_reg_table failed\n");
return ret; return ret;
} }
}
cypress_program_response_times(rdev); cypress_program_response_times(rdev);
r7xx_start_smc(rdev); r7xx_start_smc(rdev);
ret = cypress_notify_smc_display_change(rdev, false); ret = cypress_notify_smc_display_change(rdev, false);
if (ret) if (ret) {
DRM_ERROR("cypress_notify_smc_display_change failed\n");
return ret; return ret;
}
cypress_enable_sclk_control(rdev, true); cypress_enable_sclk_control(rdev, true);
if (eg_pi->memory_transition) if (eg_pi->memory_transition)
......
...@@ -1813,15 +1813,19 @@ int cypress_dpm_enable(struct radeon_device *rdev) ...@@ -1813,15 +1813,19 @@ int cypress_dpm_enable(struct radeon_device *rdev)
if (pi->voltage_control) { if (pi->voltage_control) {
rv770_enable_voltage_control(rdev, true); rv770_enable_voltage_control(rdev, true);
ret = cypress_construct_voltage_tables(rdev); ret = cypress_construct_voltage_tables(rdev);
if (ret) if (ret) {
DRM_ERROR("cypress_construct_voltage_tables failed\n");
return ret; return ret;
} }
}
if (pi->mvdd_control) { if (pi->mvdd_control) {
ret = cypress_get_mvdd_configuration(rdev); ret = cypress_get_mvdd_configuration(rdev);
if (ret) if (ret) {
DRM_ERROR("cypress_get_mvdd_configuration failed\n");
return ret; return ret;
} }
}
if (eg_pi->dynamic_ac_timing) { if (eg_pi->dynamic_ac_timing) {
cypress_set_mc_reg_address_table(rdev); cypress_set_mc_reg_address_table(rdev);
...@@ -1854,31 +1858,38 @@ int cypress_dpm_enable(struct radeon_device *rdev) ...@@ -1854,31 +1858,38 @@ int cypress_dpm_enable(struct radeon_device *rdev)
cypress_enable_dynamic_pcie_gen2(rdev, true); cypress_enable_dynamic_pcie_gen2(rdev, true);
ret = rv770_upload_firmware(rdev); ret = rv770_upload_firmware(rdev);
if (ret) if (ret) {
DRM_ERROR("rv770_upload_firmware failed\n");
return ret; return ret;
}
ret = cypress_get_table_locations(rdev); ret = cypress_get_table_locations(rdev);
if (ret) if (ret) {
DRM_ERROR("cypress_get_table_locations failed\n");
return ret; return ret;
}
ret = cypress_init_smc_table(rdev, boot_ps); ret = cypress_init_smc_table(rdev, boot_ps);
if (ret) if (ret) {
DRM_ERROR("cypress_init_smc_table failed\n");
return ret; return ret;
}
if (eg_pi->dynamic_ac_timing) { if (eg_pi->dynamic_ac_timing) {
ret = cypress_populate_mc_reg_table(rdev, boot_ps); ret = cypress_populate_mc_reg_table(rdev, boot_ps);
if (ret) if (ret) {
DRM_ERROR("cypress_populate_mc_reg_table failed\n");
return ret; return ret;
} }
}
cypress_program_response_times(rdev); cypress_program_response_times(rdev);
r7xx_start_smc(rdev); r7xx_start_smc(rdev);
ret = cypress_notify_smc_display_change(rdev, false); ret = cypress_notify_smc_display_change(rdev, false);
if (ret) if (ret) {
DRM_ERROR("cypress_notify_smc_display_change failed\n");
return ret; return ret;
}
cypress_enable_sclk_control(rdev, true); cypress_enable_sclk_control(rdev, true);
if (eg_pi->memory_transition) if (eg_pi->memory_transition)
......
...@@ -3530,9 +3530,11 @@ int ni_dpm_enable(struct radeon_device *rdev) ...@@ -3530,9 +3530,11 @@ int ni_dpm_enable(struct radeon_device *rdev)
if (pi->voltage_control) { if (pi->voltage_control) {
rv770_enable_voltage_control(rdev, true); rv770_enable_voltage_control(rdev, true);
ret = cypress_construct_voltage_tables(rdev); ret = cypress_construct_voltage_tables(rdev);
if (ret) if (ret) {
DRM_ERROR("cypress_construct_voltage_tables failed\n");
return ret; return ret;
} }
}
if (eg_pi->dynamic_ac_timing) { if (eg_pi->dynamic_ac_timing) {
ret = ni_initialize_mc_reg_table(rdev); ret = ni_initialize_mc_reg_table(rdev);
if (ret) if (ret)
...@@ -3552,42 +3554,64 @@ int ni_dpm_enable(struct radeon_device *rdev) ...@@ -3552,42 +3554,64 @@ int ni_dpm_enable(struct radeon_device *rdev)
if (pi->dynamic_pcie_gen2) if (pi->dynamic_pcie_gen2)
ni_enable_dynamic_pcie_gen2(rdev, true); ni_enable_dynamic_pcie_gen2(rdev, true);
ret = rv770_upload_firmware(rdev); ret = rv770_upload_firmware(rdev);
if (ret) if (ret) {
DRM_ERROR("rv770_upload_firmware failed\n");
return ret; return ret;
}
ret = ni_process_firmware_header(rdev); ret = ni_process_firmware_header(rdev);
if (ret) if (ret) {
DRM_ERROR("ni_process_firmware_header failed\n");
return ret; return ret;
}
ret = ni_initial_switch_from_arb_f0_to_f1(rdev); ret = ni_initial_switch_from_arb_f0_to_f1(rdev);
if (ret) if (ret) {
DRM_ERROR("ni_initial_switch_from_arb_f0_to_f1 failed\n");
return ret; return ret;
}
ret = ni_init_smc_table(rdev); ret = ni_init_smc_table(rdev);
if (ret) if (ret) {
DRM_ERROR("ni_init_smc_table failed\n");
return ret; return ret;
}
ret = ni_init_smc_spll_table(rdev); ret = ni_init_smc_spll_table(rdev);
if (ret) if (ret) {
DRM_ERROR("ni_init_smc_spll_table failed\n");
return ret; return ret;
}
ret = ni_init_arb_table_index(rdev); ret = ni_init_arb_table_index(rdev);
if (ret) if (ret) {
DRM_ERROR("ni_init_arb_table_index failed\n");
return ret; return ret;
}
if (eg_pi->dynamic_ac_timing) { if (eg_pi->dynamic_ac_timing) {
ret = ni_populate_mc_reg_table(rdev, boot_ps); ret = ni_populate_mc_reg_table(rdev, boot_ps);
if (ret) if (ret) {
DRM_ERROR("ni_populate_mc_reg_table failed\n");
return ret; return ret;
} }
}
ret = ni_initialize_smc_cac_tables(rdev); ret = ni_initialize_smc_cac_tables(rdev);
if (ret) if (ret) {
DRM_ERROR("ni_initialize_smc_cac_tables failed\n");
return ret; return ret;
}
ret = ni_initialize_hardware_cac_manager(rdev); ret = ni_initialize_hardware_cac_manager(rdev);
if (ret) if (ret) {
DRM_ERROR("ni_initialize_hardware_cac_manager failed\n");
return ret; return ret;
}
ret = ni_populate_smc_tdp_limits(rdev, boot_ps); ret = ni_populate_smc_tdp_limits(rdev, boot_ps);
if (ret) if (ret) {
DRM_ERROR("ni_populate_smc_tdp_limits failed\n");
return ret; return ret;
}
ni_program_response_times(rdev); ni_program_response_times(rdev);
r7xx_start_smc(rdev); r7xx_start_smc(rdev);
ret = cypress_notify_smc_display_change(rdev, false); ret = cypress_notify_smc_display_change(rdev, false);
if (ret) if (ret) {
DRM_ERROR("cypress_notify_smc_display_change failed\n");
return ret; return ret;
}
cypress_enable_sclk_control(rdev, true); cypress_enable_sclk_control(rdev, true);
if (eg_pi->memory_transition) if (eg_pi->memory_transition)
cypress_enable_mclk_control(rdev, true); cypress_enable_mclk_control(rdev, true);
......
...@@ -1886,18 +1886,22 @@ int rv770_dpm_enable(struct radeon_device *rdev) ...@@ -1886,18 +1886,22 @@ int rv770_dpm_enable(struct radeon_device *rdev)
if (pi->voltage_control) { if (pi->voltage_control) {
rv770_enable_voltage_control(rdev, true); rv770_enable_voltage_control(rdev, true);
ret = rv770_construct_vddc_table(rdev); ret = rv770_construct_vddc_table(rdev);
if (ret) if (ret) {
DRM_ERROR("rv770_construct_vddc_table failed\n");
return ret; return ret;
} }
}
if (pi->dcodt) if (pi->dcodt)
rv770_retrieve_odt_values(rdev); rv770_retrieve_odt_values(rdev);
if (pi->mvdd_control) { if (pi->mvdd_control) {
ret = rv770_get_mvdd_configuration(rdev); ret = rv770_get_mvdd_configuration(rdev);
if (ret) if (ret) {
DRM_ERROR("rv770_get_mvdd_configuration failed\n");
return ret; return ret;
} }
}
if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_BACKBIAS) if (rdev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_BACKBIAS)
rv770_enable_backbias(rdev, true); rv770_enable_backbias(rdev, true);
...@@ -1921,12 +1925,15 @@ int rv770_dpm_enable(struct radeon_device *rdev) ...@@ -1921,12 +1925,15 @@ int rv770_dpm_enable(struct radeon_device *rdev)
rv770_enable_dynamic_pcie_gen2(rdev, true); rv770_enable_dynamic_pcie_gen2(rdev, true);
ret = rv770_upload_firmware(rdev); ret = rv770_upload_firmware(rdev);
if (ret) if (ret) {
DRM_ERROR("rv770_upload_firmware failed\n");
return ret; return ret;
}
ret = rv770_init_smc_table(rdev, boot_ps); ret = rv770_init_smc_table(rdev, boot_ps);
if (ret) if (ret) {
DRM_ERROR("rv770_init_smc_table failed\n");
return ret; return ret;
}
rv770_program_response_times(rdev); rv770_program_response_times(rdev);
r7xx_start_smc(rdev); r7xx_start_smc(rdev);
......
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