Commit 88bab90f authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher
Browse files

drm/amd/pm: drop the pptable related workarounds for SMU 13.0.0



The pptable in the vbios is fully ready. The related workarounds
in driver are not needed any more.

Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Acked-by: default avatarGuchun Chen <guchun.chen@amd.com>
Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent dd4bc65c
Loading
Loading
Loading
Loading
+2 −42
Original line number Diff line number Diff line
@@ -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 */
+3 −51
Original line number Diff line number Diff line
@@ -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);
	}
	if (ret)
		return ret;