Commit daf42c31 authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher

drm/amdgpu: add a ucode size member into firmware info

This will be used for newer asics.
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6b777607
...@@ -232,9 +232,12 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_firmware_info *ucode, ...@@ -232,9 +232,12 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_firmware_info *ucode,
return 0; return 0;
header = (const struct common_firmware_header *)ucode->fw->data; header = (const struct common_firmware_header *)ucode->fw->data;
ucode->ucode_size = le32_to_cpu(header->ucode_size_bytes);
memcpy(ucode->kaddr, (void *)((uint8_t *)ucode->fw->data + memcpy(ucode->kaddr, (void *)((uint8_t *)ucode->fw->data +
le32_to_cpu(header->ucode_array_offset_bytes)), le32_to_cpu(header->ucode_array_offset_bytes)),
le32_to_cpu(header->ucode_size_bytes)); ucode->ucode_size);
return 0; return 0;
} }
......
...@@ -161,6 +161,8 @@ struct amdgpu_firmware_info { ...@@ -161,6 +161,8 @@ struct amdgpu_firmware_info {
uint64_t mc_addr; uint64_t mc_addr;
/* kernel linear address */ /* kernel linear address */
void *kaddr; void *kaddr;
/* ucode_size_bytes */
uint32_t ucode_size;
}; };
void amdgpu_ucode_print_mc_hdr(const struct common_firmware_header *hdr); void amdgpu_ucode_print_mc_hdr(const struct common_firmware_header *hdr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment