summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse.zhang@amd.com <Jesse.zhang@amd.com>2025-01-18 12:38:22 +0300
committerAlex Deucher <alexander.deucher@amd.com>2025-01-24 17:54:17 +0300
commit875596b984c509a2ab3eba7ce054e5278171a701 (patch)
treef530779d207d4bac8af0a40c4790d8d3cfa60ab8
parent2e7618457c3871c8657ed1e8bc16e09a3aff39c2 (diff)
downloadlinux-875596b984c509a2ab3eba7ce054e5278171a701.tar.xz
drm/amd/pm: Refactor SMU 13.0.6 SDMA reset firmware version checks
This patch refactors the firmware version checks in `smu_v13_0_6_reset_sdma` to support multiple SMU programs with different firmware version thresholds. V2: return -EOPNOTSUPP for unspported pmfw Suggested-by: Lazar Lijo <Lijo.Lazar@amd.com> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index 86cd2bdd64ef..819c363bb8dc 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -2834,12 +2834,19 @@ static int smu_v13_0_6_reset_sdma(struct smu_context *smu, uint32_t inst_mask)
{
struct amdgpu_device *adev = smu->adev;
int ret = 0;
-
- /* the message is only valid on SMU 13.0.6 with pmfw 85.121.00 and above */
- if ((adev->flags & AMD_IS_APU) ||
- amdgpu_ip_version(adev, MP1_HWIP, 0) != IP_VERSION(13, 0, 6) ||
- smu->smc_fw_version < 0x00557900)
- return 0;
+ uint32_t smu_program;
+
+ smu_program = (smu->smc_fw_version >> 24) & 0xff;
+ /* the message is only valid on SMU 13.0.6/12/14 with these pmfw and above */
+ if (((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 12)) &&
+ (smu->smc_fw_version < 0x00561700)) ||
+ ((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 14)) &&
+ (smu->smc_fw_version < 0x5551200)) ||
+ ((amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 6)) &&
+ (((smu_program == 0) && (smu->smc_fw_version < 0x00557900)) ||
+ ((smu_program == 4) && (smu->smc_fw_version < 0x4557000)) ||
+ ((smu_program == 7) && (smu->smc_fw_version < 0x7550700)))))
+ return -EOPNOTSUPP;
ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_ResetSDMA, inst_mask, NULL);