diff options
author | Hawking Zhang <Hawking.Zhang@amd.com> | 2018-10-23 05:46:17 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-06-20 22:46:49 -0400 |
commit | 6fa405646de66de83ee5166230793cc463815c17 (patch) | |
tree | 8e798b5dd2f0f804912f16b1967244284c4f7531 /drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | |
parent | 4a94ba8f376e6923fd36651b9f2f0b54b4a4608d (diff) |
drm/amdgpu: add helper function to print psp hdr
print the psp header data like we do for other firmwares.
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Le Ma <Le.Ma@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.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c index 9f50d65b350a..04d007db06f7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | |||
@@ -227,6 +227,30 @@ void amdgpu_ucode_print_sdma_hdr(const struct common_firmware_header *hdr) | |||
227 | } | 227 | } |
228 | } | 228 | } |
229 | 229 | ||
230 | void amdgpu_ucode_print_psp_hdr(const struct common_firmware_header *hdr) | ||
231 | { | ||
232 | uint16_t version_major = le16_to_cpu(hdr->header_version_major); | ||
233 | uint16_t version_minor = le16_to_cpu(hdr->header_version_minor); | ||
234 | |||
235 | DRM_DEBUG("PSP\n"); | ||
236 | amdgpu_ucode_print_common_hdr(hdr); | ||
237 | |||
238 | if (version_major == 1) { | ||
239 | const struct psp_firmware_header_v1_0 *psp_hdr = | ||
240 | container_of(hdr, struct psp_firmware_header_v1_0, header); | ||
241 | |||
242 | DRM_DEBUG("ucode_feature_version: %u\n", | ||
243 | le32_to_cpu(psp_hdr->ucode_feature_version)); | ||
244 | DRM_DEBUG("sos_offset_bytes: %u\n", | ||
245 | le32_to_cpu(psp_hdr->sos_offset_bytes)); | ||
246 | DRM_DEBUG("sos_size_bytes: %u\n", | ||
247 | le32_to_cpu(psp_hdr->sos_size_bytes)); | ||
248 | } else { | ||
249 | DRM_ERROR("Unknown PSP ucode version: %u.%u\n", | ||
250 | version_major, version_minor); | ||
251 | } | ||
252 | } | ||
253 | |||
230 | void amdgpu_ucode_print_gpu_info_hdr(const struct common_firmware_header *hdr) | 254 | void amdgpu_ucode_print_gpu_info_hdr(const struct common_firmware_header *hdr) |
231 | { | 255 | { |
232 | uint16_t version_major = le16_to_cpu(hdr->header_version_major); | 256 | uint16_t version_major = le16_to_cpu(hdr->header_version_major); |