diff options
author | Hawking Zhang <Hawking.Zhang@amd.com> | 2021-11-22 16:19:06 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-12-14 00:33:15 +0300 |
commit | 32f0e1a3307f1372824dcf28b90fdab5aa11b54f (patch) | |
tree | 480912eb982362b1962c3d34609e5f39b3e6d4f4 /drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | |
parent | f6dcaf0c07480f8b7e7568e3bf3c4b776026edfc (diff) | |
download | linux-32f0e1a3307f1372824dcf28b90fdab5aa11b54f.tar.xz |
drm/amdgpu: add helper to verify ip discovery binary signature
To be used to check ip discovery binary signature
Signed-off-by: Hawking Zhang <Hawking.Zhang@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_discovery.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c index 9ca5f5bac1a6..2ff502a81e87 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c @@ -235,6 +235,14 @@ static inline bool amdgpu_discovery_verify_checksum(uint8_t *data, uint32_t size return !!(amdgpu_discovery_calculate_checksum(data, size) == expected); } +static inline bool amdgpu_discovery_verify_binary_signature(uint8_t *binary) +{ + struct binary_header *bhdr; + bhdr = (struct binary_header *)binary; + + return (le32_to_cpu(bhdr->binary_signature) == BINARY_SIGNATURE); +} + static int amdgpu_discovery_init(struct amdgpu_device *adev) { struct table_info *info; |