]> Git Repo - linux.git/commitdiff
drm/amdgpu/mes: fetch fw version from firmware header
authorAlex Deucher <[email protected]>
Thu, 31 Oct 2024 02:54:38 +0000 (22:54 -0400)
committerAlex Deucher <[email protected]>
Tue, 5 Nov 2024 15:33:39 +0000 (10:33 -0500)
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 <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h

index 6909af56fcad2c26d70f483b8e76ca1d8f8503b0..b10383f83d73dd7c8f0d72bda9ad0b066d6b146f 100644 (file)
@@ -1594,6 +1594,7 @@ int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe)
        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,
@@ -1631,6 +1632,10 @@ int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe)
        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;
index 96788c0f42f1be6725462bcece58a5c2af64515d..0684e482a204eee83c0cb193b401a1039d090cf4 100644 (file)
@@ -75,6 +75,7 @@ struct amdgpu_mes {
 
        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;
This page took 0.068283 seconds and 4 git commands to generate.