]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/pm: Use common smu fw check function for smu13
authorAsad Kamal <asad.kamal@amd.com>
Thu, 12 Mar 2026 07:33:07 +0000 (15:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Mar 2026 14:36:15 +0000 (10:36 -0400)
Use common smu fw check function for smu13 and remove deicated 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_v13_0.h
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c

index b0d6b7b0946d858ed44198795f60b7d5ab7edb7a..89bbda0670ef1d3e47b8912119aaf122c53ac401 100644 (file)
@@ -132,8 +132,6 @@ int smu_v13_0_setup_pptable(struct smu_context *smu);
 
 int smu_v13_0_get_vbios_bootup_values(struct smu_context *smu);
 
-int smu_v13_0_check_fw_version(struct smu_context *smu);
-
 int smu_v13_0_set_driver_table_location(struct smu_context *smu);
 
 int smu_v13_0_set_tool_table_location(struct smu_context *smu);
index 2b4faab376930b62e8fe7bc8d516c322009e6c23..dc056f1e4b64fc836173022b62760d024ec3848d 100644 (file)
@@ -1988,7 +1988,7 @@ static const struct pptable_funcs aldebaran_ppt_funcs = {
        /* pptable related */
        .setup_pptable = aldebaran_setup_pptable,
        .get_vbios_bootup_values = smu_v13_0_get_vbios_bootup_values,
-       .check_fw_version = smu_v13_0_check_fw_version,
+       .check_fw_version = smu_cmn_check_fw_version,
        .write_pptable = smu_cmn_write_pptable,
        .set_driver_table_location = smu_v13_0_set_driver_table_location,
        .set_tool_table_location = smu_v13_0_set_tool_table_location,
index 4e09eda77d8b8acf4dcd29b47cf0c257c4287577..a3b755c61b1f5d36d373c8d3052c45a658bc632a 100644 (file)
@@ -258,49 +258,6 @@ int smu_v13_0_check_fw_status(struct smu_context *smu)
        return -EIO;
 }
 
-int smu_v13_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;
-       adev->pm.fw_version = smu_version;
-
-       /* only for dGPU w/ SMU13*/
-       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.
-        */
-       dev_info_once(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);
-
-       if (smu->smc_driver_if_version != SMU_IGNORE_IF_VERSION &&
-           if_version != smu->smc_driver_if_version) {
-               dev_info(adev->dev, "SMU driver if version not matched\n");
-       }
-
-       return ret;
-}
-
 static int smu_v13_0_set_pptable_v2_0(struct smu_context *smu, void **table, uint32_t *size)
 {
        struct amdgpu_device *adev = smu->adev;
index a8d63d4d1f6e24829b05fbaa1b4a5fb338fbeb29..59720372fc17a86d81d63ddfba066cf03e43faeb 100644 (file)
@@ -3133,7 +3133,7 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = {
        .fini_power = smu_v13_0_fini_power,
        .check_fw_status = smu_v13_0_check_fw_status,
        .setup_pptable = smu_v13_0_0_setup_pptable,
-       .check_fw_version = smu_v13_0_check_fw_version,
+       .check_fw_version = smu_cmn_check_fw_version,
        .write_pptable = smu_cmn_write_pptable,
        .set_driver_table_location = smu_v13_0_set_driver_table_location,
        .system_features_control = smu_v13_0_0_system_features_control,
index 5b1a038d6a19a5c51047d82ed92c23c90ae35258..ba91bf590eed6a8b9c0cb3d5662e604402cc528d 100644 (file)
@@ -1098,7 +1098,7 @@ static int smu_v13_0_4_set_fine_grain_gfx_freq_parameters(struct smu_context *sm
 
 static const struct pptable_funcs smu_v13_0_4_ppt_funcs = {
        .check_fw_status = smu_v13_0_check_fw_status,
-       .check_fw_version = smu_v13_0_check_fw_version,
+       .check_fw_version = smu_cmn_check_fw_version,
        .init_smc_tables = smu_v13_0_4_init_smc_tables,
        .fini_smc_tables = smu_v13_0_4_fini_smc_tables,
        .get_vbios_bootup_values = smu_v13_0_get_vbios_bootup_values,
index d534723fef913f5c100c8dbe5e8862f1a1cff155..27372a60e83d452abaa41db55763c1f539560068 100644 (file)
@@ -1102,7 +1102,7 @@ static int smu_v13_0_5_set_fine_grain_gfx_freq_parameters(struct smu_context *sm
 
 static const struct pptable_funcs smu_v13_0_5_ppt_funcs = {
        .check_fw_status = smu_v13_0_check_fw_status,
-       .check_fw_version = smu_v13_0_check_fw_version,
+       .check_fw_version = smu_cmn_check_fw_version,
        .init_smc_tables = smu_v13_0_5_init_smc_tables,
        .fini_smc_tables = smu_v13_0_5_fini_smc_tables,
        .get_vbios_bootup_values = smu_v13_0_get_vbios_bootup_values,
index 8dc8674b7ce16e06421ad0dad7184675f1af9ad8..bc361fee57775bd258d182e7988cbc661418e34e 100644 (file)
@@ -481,7 +481,7 @@ static int smu_v13_0_6_check_fw_version(struct smu_context *smu)
 {
        int r;
 
-       r = smu_v13_0_check_fw_version(smu);
+       r = smu_cmn_check_fw_version(smu);
        /* Initialize caps flags once fw version is fetched */
        if (!r)
                smu_v13_0_x_init_caps(smu);
index 5500a0f12f0e9d7ae1233ef07e61bb7e24af542b..88e0d99b8ad25b58ef81e280541cd5e077e5c3a0 100644 (file)
@@ -2788,7 +2788,7 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = {
        .fini_power = smu_v13_0_fini_power,
        .check_fw_status = smu_v13_0_7_check_fw_status,
        .setup_pptable = smu_v13_0_7_setup_pptable,
-       .check_fw_version = smu_v13_0_check_fw_version,
+       .check_fw_version = smu_cmn_check_fw_version,
        .write_pptable = smu_cmn_write_pptable,
        .set_driver_table_location = smu_v13_0_set_driver_table_location,
        .system_features_control = smu_v13_0_system_features_control,
index f43a91ac6970216f515744d858f4679baddd072f..7bf88ffd311b67bd00c12b9ae7e6abf85e66b633 100644 (file)
@@ -1331,7 +1331,7 @@ static int yellow_carp_set_fine_grain_gfx_freq_parameters(struct smu_context *sm
 
 static const struct pptable_funcs yellow_carp_ppt_funcs = {
        .check_fw_status = smu_v13_0_check_fw_status,
-       .check_fw_version = smu_v13_0_check_fw_version,
+       .check_fw_version = smu_cmn_check_fw_version,
        .init_smc_tables = yellow_carp_init_smc_tables,
        .fini_smc_tables = yellow_carp_fini_smc_tables,
        .get_vbios_bootup_values = smu_v13_0_get_vbios_bootup_values,