drm/amdgpu/psp11: skip ta firmware for navi10
authorHawking Zhang <Hawking.Zhang@amd.com>
Sat, 16 Feb 2019 14:22:46 +0000 (22:22 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Jun 2019 02:46:50 +0000 (21:46 -0500)
Not used on Navi10.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c

index 25853ac85e735d8658faae7f0b73491bbb5d6be3..da293d84e0a9a24a20a1782044c5cc3c195e1bf1 100644 (file)
@@ -126,30 +126,36 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
        adev->psp.asd_start_addr = (uint8_t *)asd_hdr +
                                le32_to_cpu(asd_hdr->header.ucode_array_offset_bytes);
 
-       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name);
-       err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev);
-       if (err) {
-               release_firmware(adev->psp.ta_fw);
-               adev->psp.ta_fw = NULL;
-               dev_info(adev->dev,
-                        "psp v11.0: Failed to load firmware \"%s\"\n", fw_name);
-       } else {
-               err = amdgpu_ucode_validate(adev->psp.ta_fw);
-               if (err)
-                       goto out2;
-
-               ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data;
-               adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version);
-               adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes);
-               adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr +
-                       le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
-
-               adev->psp.ta_fw_version = le32_to_cpu(ta_hdr->header.ucode_version);
-
-               adev->psp.ta_ras_ucode_version = le32_to_cpu(ta_hdr->ta_ras_ucode_version);
-               adev->psp.ta_ras_ucode_size = le32_to_cpu(ta_hdr->ta_ras_size_bytes);
-               adev->psp.ta_ras_start_addr = (uint8_t *)adev->psp.ta_xgmi_start_addr +
-                       le32_to_cpu(ta_hdr->ta_ras_offset_bytes);
+       switch (adev->asic_type) {
+       case CHIP_VEGA20:
+               snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name);
+               err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev);
+               if (err) {
+                       release_firmware(adev->psp.ta_fw);
+                       adev->psp.ta_fw = NULL;
+                       dev_info(adev->dev,
+                                "psp v11.0: Failed to load firmware \"%s\"\n", fw_name);
+               } else {
+                       err = amdgpu_ucode_validate(adev->psp.ta_fw);
+                       if (err)
+                               goto out2;
+
+                       ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data;
+                       adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version);
+                       adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes);
+                       adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr +
+                               le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
+                       adev->psp.ta_fw_version = le32_to_cpu(ta_hdr->header.ucode_version);
+                       adev->psp.ta_ras_ucode_version = le32_to_cpu(ta_hdr->ta_ras_ucode_version);
+                       adev->psp.ta_ras_ucode_size = le32_to_cpu(ta_hdr->ta_ras_size_bytes);
+                       adev->psp.ta_ras_start_addr = (uint8_t *)adev->psp.ta_xgmi_start_addr +
+                               le32_to_cpu(ta_hdr->ta_ras_offset_bytes);
+               }
+               break;
+       case CHIP_NAVI10:
+               break;
+       default:
+               BUG();
        }
 
        return 0;