Commit 7d38d9dc authored by Aaron Liu's avatar Aaron Liu Committed by Alex Deucher

drm/amdgpu: add mode2 reset support for yellow carp

This patch adds mode2 reset support for yellow carp.
Signed-off-by: default avatarAaron Liu <aaron.liu@amd.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6c83a015
...@@ -633,6 +633,7 @@ nv_asic_reset_method(struct amdgpu_device *adev) ...@@ -633,6 +633,7 @@ nv_asic_reset_method(struct amdgpu_device *adev)
switch (adev->asic_type) { switch (adev->asic_type) {
case CHIP_VANGOGH: case CHIP_VANGOGH:
case CHIP_YELLOW_CARP:
return AMD_RESET_METHOD_MODE2; return AMD_RESET_METHOD_MODE2;
case CHIP_SIENNA_CICHLID: case CHIP_SIENNA_CICHLID:
case CHIP_NAVY_FLOUNDER: case CHIP_NAVY_FLOUNDER:
......
...@@ -272,6 +272,31 @@ static int yellow_carp_post_smu_init(struct smu_context *smu) ...@@ -272,6 +272,31 @@ static int yellow_carp_post_smu_init(struct smu_context *smu)
return ret; return ret;
} }
static int yellow_carp_mode_reset(struct smu_context *smu, int type)
{
int ret = 0, index = 0;
index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG,
SMU_MSG_GfxDeviceDriverReset);
if (index < 0)
return index == -EACCES ? 0 : index;
mutex_lock(&smu->message_lock);
ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, type);
mutex_unlock(&smu->message_lock);
mdelay(10);
return ret;
}
static int yellow_carp_mode2_reset(struct smu_context *smu)
{
return yellow_carp_mode_reset(smu, SMU_RESET_MODE_2);
}
static int yellow_carp_get_smu_metrics_data(struct smu_context *smu, static int yellow_carp_get_smu_metrics_data(struct smu_context *smu,
MetricsMember_t member, MetricsMember_t member,
uint32_t *value) uint32_t *value)
...@@ -1167,6 +1192,7 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = { ...@@ -1167,6 +1192,7 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = {
.set_driver_table_location = smu_v13_0_1_set_driver_table_location, .set_driver_table_location = smu_v13_0_1_set_driver_table_location,
.gfx_off_control = smu_v13_0_1_gfx_off_control, .gfx_off_control = smu_v13_0_1_gfx_off_control,
.post_init = yellow_carp_post_smu_init, .post_init = yellow_carp_post_smu_init,
.mode2_reset = yellow_carp_mode2_reset,
.get_dpm_ultimate_freq = yellow_carp_get_dpm_ultimate_freq, .get_dpm_ultimate_freq = yellow_carp_get_dpm_ultimate_freq,
.od_edit_dpm_table = yellow_carp_od_edit_dpm_table, .od_edit_dpm_table = yellow_carp_od_edit_dpm_table,
.print_clk_levels = yellow_carp_print_clk_levels, .print_clk_levels = yellow_carp_print_clk_levels,
......
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