drm/amdgpu: correct ta header v2 ucode init start address
authorJohn Clements <john.clements@amd.com>
Wed, 15 Jul 2020 07:10:09 +0000 (15:10 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 15 Jul 2020 16:45:18 +0000 (12:45 -0400)
resolve bug calculating fw start address within binary

Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 4070633..6e41d89 100644 (file)
@@ -2286,7 +2286,9 @@ int parse_ta_bin_descriptor(struct psp_context *psp,
        if (!psp || !desc || !ta_hdr)
                return -EINVAL;
 
-       ucode_start_addr  = (uint8_t *)ta_hdr + le32_to_cpu(desc->offset_bytes);
+       ucode_start_addr  = (uint8_t *)ta_hdr +
+                           le32_to_cpu(desc->offset_bytes) +
+                           le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
 
        switch (desc->fw_type) {
        case TA_FW_TYPE_PSP_ASD: