Commit c941e9fe authored by Lijo Lazar's avatar Lijo Lazar Committed by Alex Deucher

drm/amd/pm: Add support for reset completion on aldebaran

v1: On aldebaran, after hardware context restore, another handshake
needs to happen with PMFW so that reset recovery is complete from
PMFW side. Treat this as RESET_COMPLETE event for aldebaran.

v2: Cleanup coding style, info logs
Signed-off-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Reviewed-by: default avatarFeifei Xu <Feifei.Xu@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6d77dd9f
...@@ -100,7 +100,8 @@ ...@@ -100,7 +100,8 @@
#define PPSMC_MSG_SetSystemVirtualSTBtoDramAddrHigh 0x40 #define PPSMC_MSG_SetSystemVirtualSTBtoDramAddrHigh 0x40
#define PPSMC_MSG_SetSystemVirtualSTBtoDramAddrLow 0x41 #define PPSMC_MSG_SetSystemVirtualSTBtoDramAddrLow 0x41
#define PPSMC_Message_Count 0x42 #define PPSMC_MSG_GfxDriverResetRecovery 0x42
#define PPSMC_Message_Count 0x43
//PPSMC Reset Types //PPSMC Reset Types
#define PPSMC_RESET_TYPE_WARM_RESET 0x00 #define PPSMC_RESET_TYPE_WARM_RESET 0x00
......
...@@ -225,6 +225,7 @@ ...@@ -225,6 +225,7 @@
__SMU_DUMMY_MAP(DisableDeterminism), \ __SMU_DUMMY_MAP(DisableDeterminism), \
__SMU_DUMMY_MAP(SetUclkDpmMode), \ __SMU_DUMMY_MAP(SetUclkDpmMode), \
__SMU_DUMMY_MAP(LightSBR), \ __SMU_DUMMY_MAP(LightSBR), \
__SMU_DUMMY_MAP(GfxDriverResetRecovery),
#undef __SMU_DUMMY_MAP #undef __SMU_DUMMY_MAP
#define __SMU_DUMMY_MAP(type) SMU_MSG_##type #define __SMU_DUMMY_MAP(type) SMU_MSG_##type
......
...@@ -268,5 +268,8 @@ int smu_v13_0_get_current_pcie_link_speed(struct smu_context *smu); ...@@ -268,5 +268,8 @@ int smu_v13_0_get_current_pcie_link_speed(struct smu_context *smu);
int smu_v13_0_gfx_ulv_control(struct smu_context *smu, int smu_v13_0_gfx_ulv_control(struct smu_context *smu,
bool enablement); bool enablement);
int smu_v13_0_wait_for_event(struct smu_context *smu, enum smu_event_type event,
uint64_t event_arg);
#endif #endif
#endif #endif
...@@ -127,6 +127,7 @@ static const struct cmn2asic_msg_mapping aldebaran_message_map[SMU_MSG_MAX_COUNT ...@@ -127,6 +127,7 @@ static const struct cmn2asic_msg_mapping aldebaran_message_map[SMU_MSG_MAX_COUNT
MSG_MAP(EnableDeterminism, PPSMC_MSG_EnableDeterminism, 0), MSG_MAP(EnableDeterminism, PPSMC_MSG_EnableDeterminism, 0),
MSG_MAP(DisableDeterminism, PPSMC_MSG_DisableDeterminism, 0), MSG_MAP(DisableDeterminism, PPSMC_MSG_DisableDeterminism, 0),
MSG_MAP(SetUclkDpmMode, PPSMC_MSG_SetUclkDpmMode, 0), MSG_MAP(SetUclkDpmMode, PPSMC_MSG_SetUclkDpmMode, 0),
MSG_MAP(GfxDriverResetRecovery, PPSMC_MSG_GfxDriverResetRecovery, 0),
}; };
static const struct cmn2asic_mapping aldebaran_clk_map[SMU_CLK_COUNT] = { static const struct cmn2asic_mapping aldebaran_clk_map[SMU_CLK_COUNT] = {
...@@ -1583,6 +1584,7 @@ static const struct pptable_funcs aldebaran_ppt_funcs = { ...@@ -1583,6 +1584,7 @@ static const struct pptable_funcs aldebaran_ppt_funcs = {
.mode1_reset = smu_v13_0_mode1_reset, .mode1_reset = smu_v13_0_mode1_reset,
.set_mp1_state = aldebaran_set_mp1_state, .set_mp1_state = aldebaran_set_mp1_state,
.mode2_reset = aldebaran_mode2_reset, .mode2_reset = aldebaran_mode2_reset,
.wait_for_event = smu_v13_0_wait_for_event,
}; };
void aldebaran_set_ppt_funcs(struct smu_context *smu) void aldebaran_set_ppt_funcs(struct smu_context *smu)
......
...@@ -1374,6 +1374,33 @@ int smu_v13_0_mode1_reset(struct smu_context *smu) ...@@ -1374,6 +1374,33 @@ int smu_v13_0_mode1_reset(struct smu_context *smu)
return ret; return ret;
} }
static int smu_v13_0_wait_for_reset_complete(struct smu_context *smu,
uint64_t event_arg)
{
int ret = 0;
dev_dbg(smu->adev->dev, "waiting for smu reset complete\n");
ret = smu_cmn_send_smc_msg(smu, SMU_MSG_GfxDriverResetRecovery, NULL);
return ret;
}
int smu_v13_0_wait_for_event(struct smu_context *smu, enum smu_event_type event,
uint64_t event_arg)
{
int ret = -EINVAL;
switch (event) {
case SMU_EVENT_RESET_COMPLETE:
ret = smu_v13_0_wait_for_reset_complete(smu, event_arg);
break;
default:
break;
}
return ret;
}
int smu_v13_0_mode2_reset(struct smu_context *smu) int smu_v13_0_mode2_reset(struct smu_context *smu)
{ {
int ret; int 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