drm/amd/pm: Use common smu fw check function for smu15

Use common smu fw check function for smu15 and remove dedicated ones

v2: Remove dedicated functions and directly use common one

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Asad Kamal 2026-03-12 15:40:13 +08:00 committed by Alex Deucher
parent fba3ad6f93
commit 3d0b7f5da0
3 changed files with 2 additions and 55 deletions

View File

@ -142,8 +142,6 @@ int smu_v15_0_setup_pptable(struct smu_context *smu);
int smu_v15_0_get_vbios_bootup_values(struct smu_context *smu);
int smu_v15_0_check_fw_version(struct smu_context *smu);
int smu_v15_0_set_driver_table_location(struct smu_context *smu);
int smu_v15_0_set_tool_table_location(struct smu_context *smu);

View File

@ -207,58 +207,6 @@ int smu_v15_0_check_fw_status(struct smu_context *smu)
return -EIO;
}
int smu_v15_0_check_fw_version(struct smu_context *smu)
{
struct amdgpu_device *adev = smu->adev;
uint32_t if_version = 0xff, smu_version = 0xff;
uint8_t smu_program, smu_major, smu_minor, smu_debug;
int ret = 0;
ret = smu_cmn_get_smc_version(smu, &if_version, &smu_version);
if (ret)
return ret;
smu_program = (smu_version >> 24) & 0xff;
smu_major = (smu_version >> 16) & 0xff;
smu_minor = (smu_version >> 8) & 0xff;
smu_debug = (smu_version >> 0) & 0xff;
if (smu->is_apu)
adev->pm.fw_version = smu_version;
switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {
case IP_VERSION(15, 0, 0):
smu->smc_driver_if_version = SMU15_DRIVER_IF_VERSION_SMU_V15_0;
break;
default:
dev_err(adev->dev, "smu unsupported IP version: 0x%x.\n",
amdgpu_ip_version(adev, MP1_HWIP, 0));
smu->smc_driver_if_version = SMU15_DRIVER_IF_VERSION_INV;
break;
}
if (adev->pm.fw)
dev_dbg(smu->adev->dev, "smu fw reported program %d, version = 0x%08x (%d.%d.%d)\n",
smu_program, smu_version, smu_major, smu_minor, smu_debug);
/*
* 1. if_version mismatch is not critical as our fw is designed
* to be backward compatible.
* 2. New fw usually brings some optimizations. But that's visible
* only on the paired driver.
* Considering above, we just leave user a verbal message instead
* of halt driver loading.
*/
if (if_version != smu->smc_driver_if_version) {
dev_info(adev->dev, "smu driver if version = 0x%08x, smu fw if version = 0x%08x, "
"smu fw program = %d, smu fw version = 0x%08x (%d.%d.%d)\n",
smu->smc_driver_if_version, if_version,
smu_program, smu_version, smu_major, smu_minor, smu_debug);
dev_info(adev->dev, "SMU driver if version not matched\n");
}
return ret;
}
static int smu_v15_0_set_pptable_v2_0(struct smu_context *smu, void **table, uint32_t *size)
{
struct amdgpu_device *adev = smu->adev;

View File

@ -1416,7 +1416,7 @@ static int smu_v15_0_common_get_dpm_table(struct smu_context *smu, struct dpm_cl
static const struct pptable_funcs smu_v15_0_0_ppt_funcs = {
.check_fw_status = smu_v15_0_check_fw_status,
.check_fw_version = smu_v15_0_check_fw_version,
.check_fw_version = smu_cmn_check_fw_version,
.init_smc_tables = smu_v15_0_0_init_smc_tables,
.fini_smc_tables = smu_v15_0_0_fini_smc_tables,
.get_vbios_bootup_values = smu_v15_0_get_vbios_bootup_values,
@ -1468,6 +1468,7 @@ void smu_v15_0_0_set_ppt_funcs(struct smu_context *smu)
smu->feature_map = smu_v15_0_0_feature_mask_map;
smu->table_map = smu_v15_0_0_table_map;
smu->is_apu = true;
smu->smc_driver_if_version = SMU15_DRIVER_IF_VERSION_SMU_V15_0;
smu_v15_0_0_init_msg_ctl(smu);
}