Commit 765c50cb authored by Kevin Wang's avatar Kevin Wang Committed by Alex Deucher

drm/amd/powerplay: implement check_fw_version function for smu11

Add function of check firmware version for smu11
Signed-off-by: default avatarKevin Wang <Kevin1.Wang@amd.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7b0031b6
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "amdgpu_smu.h" #include "amdgpu_smu.h"
#include "smu_v11_0.h" #include "smu_v11_0.h"
#include "smu_v11_0_ppsmc.h" #include "smu_v11_0_ppsmc.h"
#include "smu11_driver_if.h"
#include "soc15_common.h" #include "soc15_common.h"
#include "asic_reg/thm/thm_11_0_2_offset.h" #include "asic_reg/thm/thm_11_0_2_offset.h"
...@@ -44,6 +45,14 @@ static int smu_v11_0_send_msg_without_waiting(struct smu_context *smu, ...@@ -44,6 +45,14 @@ static int smu_v11_0_send_msg_without_waiting(struct smu_context *smu,
return 0; return 0;
} }
static int smu_v11_0_read_arg(struct smu_context *smu, uint32_t *arg)
{
struct amdgpu_device *adev = smu->adev;
*arg = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82);
return 0;
}
static int smu_v11_0_wait_for_response(struct smu_context *smu) static int smu_v11_0_wait_for_response(struct smu_context *smu)
{ {
struct amdgpu_device *adev = smu->adev; struct amdgpu_device *adev = smu->adev;
...@@ -182,10 +191,30 @@ static int smu_v11_0_check_fw_status(struct smu_context *smu) ...@@ -182,10 +191,30 @@ static int smu_v11_0_check_fw_status(struct smu_context *smu)
return -EIO; return -EIO;
} }
static int smu_v11_0_check_fw_version(struct smu_context *smu)
{
uint32_t smu_version = 0xff;
int ret = 0;
ret = smu_send_smc_msg(smu, PPSMC_MSG_GetDriverIfVersion);
if (ret)
goto err;
ret = smu_v11_0_read_arg(smu, &smu_version);
if (ret)
goto err;
if (smu_version == SMU11_DRIVER_IF_VERSION)
return 0;
err:
return ret;
}
static const struct smu_funcs smu_v11_0_funcs = { static const struct smu_funcs smu_v11_0_funcs = {
.init_microcode = smu_v11_0_init_microcode, .init_microcode = smu_v11_0_init_microcode,
.load_microcode = smu_v11_0_load_microcode, .load_microcode = smu_v11_0_load_microcode,
.check_fw_status = smu_v11_0_check_fw_status, .check_fw_status = smu_v11_0_check_fw_status,
.check_fw_version = smu_v11_0_check_fw_version,
.send_smc_msg = smu_v11_0_send_msg, .send_smc_msg = smu_v11_0_send_msg,
.send_smc_msg_with_param = smu_v11_0_send_msg_with_param, .send_smc_msg_with_param = smu_v11_0_send_msg_with_param,
}; };
......
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