aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2016-10-10 15:19:06 +0800
committerAlex Deucher <alexander.deucher@amd.com>2017-03-29 23:53:39 -0400
commitdaf42c314dbd70f892f8020d817b46793c0e1b3f (patch)
tree332db7fbec019329695354351f4924932ed23a71 /drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
parentdrm/amdgpu: expand pte flags to uint64_t (diff)
downloadlinux-dev-daf42c314dbd70f892f8020d817b46793c0e1b3f.tar.xz
linux-dev-daf42c314dbd70f892f8020d817b46793c0e1b3f.zip
drm/amdgpu: add a ucode size member into firmware info
This will be used for newer asics. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index 0f0b38191fac..be16377128c3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -232,9 +232,12 @@ static int amdgpu_ucode_init_single_fw(struct amdgpu_firmware_info *ucode,
return 0;
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 +
- le32_to_cpu(header->ucode_array_offset_bytes)),
- le32_to_cpu(header->ucode_size_bytes));
+ le32_to_cpu(header->ucode_array_offset_bytes)),
+ ucode->ucode_size);
return 0;
}