Commit 61b396b9 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/pm/smu_v13.0: convert IP version checking

Use IP versions rather than asic_type to differentiate
IP version specific features.
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6b726a0a
...@@ -89,12 +89,13 @@ int smu_v13_0_init_microcode(struct smu_context *smu) ...@@ -89,12 +89,13 @@ int smu_v13_0_init_microcode(struct smu_context *smu)
if (amdgpu_sriov_vf(adev)) if (amdgpu_sriov_vf(adev))
return 0; return 0;
switch (adev->asic_type) { switch (adev->ip_versions[MP1_HWIP]) {
case CHIP_ALDEBARAN: case IP_VERSION(13, 0, 2):
chip_name = "aldebaran"; chip_name = "aldebaran";
break; break;
default: default:
dev_err(adev->dev, "Unsupported ASIC type %d\n", adev->asic_type); dev_err(adev->dev, "Unsupported IP version 0x%x\n",
adev->ip_versions[MP1_HWIP]);
return -EINVAL; return -EINVAL;
} }
...@@ -210,15 +211,17 @@ int smu_v13_0_check_fw_version(struct smu_context *smu) ...@@ -210,15 +211,17 @@ int smu_v13_0_check_fw_version(struct smu_context *smu)
smu_minor = (smu_version >> 8) & 0xff; smu_minor = (smu_version >> 8) & 0xff;
smu_debug = (smu_version >> 0) & 0xff; smu_debug = (smu_version >> 0) & 0xff;
switch (smu->adev->asic_type) { switch (smu->adev->ip_versions[MP1_HWIP]) {
case CHIP_ALDEBARAN: case IP_VERSION(13, 0, 2):
smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_ALDE; smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_ALDE;
break; break;
case CHIP_YELLOW_CARP: case IP_VERSION(13, 0, 1):
case IP_VERSION(13, 0, 3):
smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_YELLOW_CARP; smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_YELLOW_CARP;
break; break;
default: default:
dev_err(smu->adev->dev, "smu unsupported asic type:%d.\n", smu->adev->asic_type); dev_err(smu->adev->dev, "smu unsupported IP version: 0x%x.\n",
smu->adev->ip_versions[MP1_HWIP]);
smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_INV; smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_INV;
break; break;
} }
...@@ -740,8 +743,9 @@ int smu_v13_0_gfx_off_control(struct smu_context *smu, bool enable) ...@@ -740,8 +743,9 @@ int smu_v13_0_gfx_off_control(struct smu_context *smu, bool enable)
int ret = 0; int ret = 0;
struct amdgpu_device *adev = smu->adev; struct amdgpu_device *adev = smu->adev;
switch (adev->asic_type) { switch (adev->ip_versions[MP1_HWIP]) {
case CHIP_YELLOW_CARP: case IP_VERSION(13, 0, 1):
case IP_VERSION(13, 0, 3):
if (!(adev->pm.pp_feature & PP_GFXOFF_MASK)) if (!(adev->pm.pp_feature & PP_GFXOFF_MASK))
return 0; return 0;
if (enable) if (enable)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment