]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/pm: Use common smu fw check function for smu15
authorAsad Kamal <asad.kamal@amd.com>
Thu, 12 Mar 2026 07:40:13 +0000 (15:40 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Mar 2026 14:36:20 +0000 (10:36 -0400)
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>
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c

index ab4a64f54e797432b58808e1462cb90770e4c7b5..09743ccd0d15c9164b5d6353703815c6a5945008 100644 (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);
index 3fd84dd85e9b299574fb4a3eb6c1a4cb96482d04..09bb3d91a0014381d18345c3019e345d3947cb15 100644 (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;
index 49cf2b9d931e106d9f4b5e2837af2b6bcec6387d..8d092c347076e00e37029c132c449ef3b1935fd0 100644 (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);
 }