]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amd/pm: drop the pptable related workarounds for SMU 13.0.0
authorEvan Quan <evan.quan@amd.com>
Fri, 16 Sep 2022 05:30:44 +0000 (13:30 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Sep 2022 21:35:37 +0000 (17:35 -0400)
The pptable in the vbios is fully ready. The related workarounds
in driver are not needed any more.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Guchun Chen <guchun.chen@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/smu13/smu_v13_0.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c

index 24488f4cb78ccb08b07019bd84aa127ee25e74e0..93f9b8377539a4c618da67770495f9febe55a5b4 100644 (file)
@@ -209,7 +209,8 @@ int smu_v13_0_init_pptable_microcode(struct smu_context *smu)
        if (!adev->scpm_enabled)
                return 0;
 
-       if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 7))
+       if ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 7)) ||
+           (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 0)))
                return 0;
 
        /* override pptable_id from driver parameter */
@@ -218,27 +219,6 @@ int smu_v13_0_init_pptable_microcode(struct smu_context *smu)
                dev_info(adev->dev, "override pptable id %d\n", pptable_id);
        } else {
                pptable_id = smu->smu_table.boot_values.pp_table_id;
-
-               /*
-                * Temporary solution for SMU V13.0.0 with SCPM enabled:
-                *   - use vbios carried pptable when pptable_id is 3664, 3715 or 3795
-                *   - use 36831 soft pptable when pptable_id is 3683
-                */
-               if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 0)) {
-                       switch (pptable_id) {
-                       case 3664:
-                       case 3715:
-                       case 3795:
-                               pptable_id = 0;
-                               break;
-                       case 3683:
-                               pptable_id = 36831;
-                               break;
-                       default:
-                               dev_err(adev->dev, "Unsupported pptable id %d\n", pptable_id);
-                               return -EINVAL;
-                       }
-               }
        }
 
        /* "pptable_id == 0" means vbios carries the pptable. */
@@ -471,26 +451,6 @@ int smu_v13_0_setup_pptable(struct smu_context *smu)
        } else {
                pptable_id = smu->smu_table.boot_values.pp_table_id;
 
-               /*
-                * Temporary solution for SMU V13.0.0 with SCPM disabled:
-                *   - use 3664, 3683 or 3715 on request
-                *   - use 3664 when pptable_id is 0
-                * TODO: drop these when the pptable carried in vbios is ready.
-                */
-               if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 0)) {
-                       switch (pptable_id) {
-                       case 0:
-                               pptable_id = 3664;
-                               break;
-                       case 3664:
-                       case 3683:
-                       case 3715:
-                               break;
-                       default:
-                               dev_err(adev->dev, "Unsupported pptable id %d\n", pptable_id);
-                               return -EINVAL;
-                       }
-               }
        }
 
        /* force using vbios pptable in sriov mode */
index fb5af45ff56e1e828f5e753677a57e670e3ea1e1..096327513dd09d9d65167836b81ab0c5c7d94dda 100644 (file)
@@ -410,59 +410,11 @@ static int smu_v13_0_0_setup_pptable(struct smu_context *smu)
 {
        struct smu_table_context *smu_table = &smu->smu_table;
        struct amdgpu_device *adev = smu->adev;
-       uint32_t pptable_id;
        int ret = 0;
 
-       /*
-        * With SCPM enabled, the pptable used will be signed. It cannot
-        * be used directly by driver. To get the raw pptable, we need to
-        * rely on the combo pptable(and its revelant SMU message).
-        */
-       if (adev->scpm_enabled) {
-               ret = smu_v13_0_0_get_pptable_from_pmfw(smu,
-                                                       &smu_table->power_play_table,
-                                                       &smu_table->power_play_table_size);
-       } else {
-               /* override pptable_id from driver parameter */
-               if (amdgpu_smu_pptable_id >= 0) {
-                       pptable_id = amdgpu_smu_pptable_id;
-                       dev_info(adev->dev, "override pptable id %d\n", pptable_id);
-               } else {
-                       pptable_id = smu_table->boot_values.pp_table_id;
-               }
-
-               /*
-                * Temporary solution for SMU V13.0.0 with SCPM disabled:
-                *   - use vbios carried pptable when pptable_id is 3664, 3715 or 3795
-                *   - use soft pptable when pptable_id is 3683
-                */
-               if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 0)) {
-                       switch (pptable_id) {
-                       case 3664:
-                       case 3715:
-                       case 3795:
-                       case 3794:
-                               pptable_id = 0;
-                               break;
-                       case 3683:
-                               break;
-                       default:
-                               dev_err(adev->dev, "Unsupported pptable id %d\n", pptable_id);
-                               return -EINVAL;
-                       }
-               }
-
-               /* force using vbios pptable in sriov mode */
-               if ((amdgpu_sriov_vf(adev) || !pptable_id) && (amdgpu_emu_mode != 1))
-                       ret = smu_v13_0_0_get_pptable_from_pmfw(smu,
-                                                               &smu_table->power_play_table,
-                                                               &smu_table->power_play_table_size);
-               else
-                       ret = smu_v13_0_get_pptable_from_firmware(smu,
-                                                                 &smu_table->power_play_table,
-                                                                 &smu_table->power_play_table_size,
-                                                                 pptable_id);
-       }
+       ret = smu_v13_0_0_get_pptable_from_pmfw(smu,
+                                               &smu_table->power_play_table,
+                                               &smu_table->power_play_table_size);
        if (ret)
                return ret;