Skip to content

Commit e89bd36

Browse files
committed
drm/amdgpu/mes: fetch fw version from firmware header
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>
1 parent cfffd98 commit e89bd36

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,6 +1594,7 @@ int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe)
15941594
char ucode_prefix[30];
15951595
char fw_name[50];
15961596
bool need_retry = false;
1597+
u32 *ucode_ptr;
15971598
int r;
15981599

15991600
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)
16311632
adev->mes.data_start_addr[pipe] =
16321633
le32_to_cpu(mes_hdr->mes_data_start_addr_lo) |
16331634
((uint64_t)(le32_to_cpu(mes_hdr->mes_data_start_addr_hi)) << 32);
1635+
ucode_ptr = (u32 *)(adev->mes.fw[pipe]->data +
1636+
sizeof(union amdgpu_firmware_header));
1637+
adev->mes.fw_version[pipe] =
1638+
le32_to_cpu(ucode_ptr[24]) & AMDGPU_MES_VERSION_MASK;
16341639

16351640
if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
16361641
int ucode, ucode_data;

drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ struct amdgpu_mes {
7575

7676
uint32_t sched_version;
7777
uint32_t kiq_version;
78+
uint32_t fw_version[AMDGPU_MAX_MES_PIPES];
7879
bool enable_legacy_queue_map;
7980

8081
uint32_t total_max_queue;

0 commit comments

Comments
 (0)