Commit 6b544962 authored by Mario Limonciello's avatar Mario Limonciello Committed by Alex Deucher

drm/amd: Convert SMUv11 microcode to use `amdgpu_ucode_ip_version_decode`

Remove the special casing from SMU v11 code. No intended functional
changes.
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 54a3e032
...@@ -93,7 +93,7 @@ static void smu_v11_0_poll_baco_exit(struct smu_context *smu) ...@@ -93,7 +93,7 @@ static void smu_v11_0_poll_baco_exit(struct smu_context *smu)
int smu_v11_0_init_microcode(struct smu_context *smu) int smu_v11_0_init_microcode(struct smu_context *smu)
{ {
struct amdgpu_device *adev = smu->adev; struct amdgpu_device *adev = smu->adev;
const char *chip_name; char ucode_prefix[30];
char fw_name[SMU_FW_NAME_LEN]; char fw_name[SMU_FW_NAME_LEN];
int err = 0; int err = 0;
const struct smc_firmware_header_v1_0 *hdr; const struct smc_firmware_header_v1_0 *hdr;
...@@ -105,38 +105,9 @@ int smu_v11_0_init_microcode(struct smu_context *smu) ...@@ -105,38 +105,9 @@ int smu_v11_0_init_microcode(struct smu_context *smu)
(adev->ip_versions[MP1_HWIP][0] == IP_VERSION(11, 0, 7)))) (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(11, 0, 7))))
return 0; return 0;
switch (adev->ip_versions[MP1_HWIP][0]) { amdgpu_ucode_ip_version_decode(adev, MP1_HWIP, ucode_prefix, sizeof(ucode_prefix));
case IP_VERSION(11, 0, 0):
chip_name = "navi10";
break;
case IP_VERSION(11, 0, 5):
chip_name = "navi14";
break;
case IP_VERSION(11, 0, 9):
chip_name = "navi12";
break;
case IP_VERSION(11, 0, 7):
chip_name = "sienna_cichlid";
break;
case IP_VERSION(11, 0, 11):
chip_name = "navy_flounder";
break;
case IP_VERSION(11, 0, 12):
chip_name = "dimgrey_cavefish";
break;
case IP_VERSION(11, 0, 13):
chip_name = "beige_goby";
break;
case IP_VERSION(11, 0, 2):
chip_name = "arcturus";
break;
default:
dev_err(adev->dev, "Unsupported IP version 0x%x\n",
adev->ip_versions[MP1_HWIP][0]);
return -EINVAL;
}
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_smc.bin", chip_name); snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
err = request_firmware(&adev->pm.fw, fw_name, adev->dev); err = request_firmware(&adev->pm.fw, fw_name, adev->dev);
if (err) if (err)
......
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