We need this prior to the firmware being loaded so fetch
from the header.
v2: fetch directly from the firmware
v3: store both fw versions
Reviewed-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
        char ucode_prefix[30];
        char fw_name[50];
        bool need_retry = false;
+       u32 *ucode_ptr;
        int r;
 
        amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix,
        adev->mes.data_start_addr[pipe] =
                le32_to_cpu(mes_hdr->mes_data_start_addr_lo) |
                ((uint64_t)(le32_to_cpu(mes_hdr->mes_data_start_addr_hi)) << 32);
+       ucode_ptr = (u32 *)(adev->mes.fw[pipe]->data +
+                         sizeof(union amdgpu_firmware_header));
+       adev->mes.fw_version[pipe] =
+               le32_to_cpu(ucode_ptr[24]) & AMDGPU_MES_VERSION_MASK;
 
        if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
                int ucode, ucode_data;
 
 
        uint32_t                        sched_version;
        uint32_t                        kiq_version;
+       uint32_t                        fw_version[AMDGPU_MAX_MES_PIPES];
        bool                            enable_legacy_queue_map;
 
        uint32_t                        total_max_queue;