aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-04-26 23:40:37 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-05-24 17:39:35 -0400
commit8ae1a33648969531d93008dda508f1715f1fdbf0 (patch)
tree67a4926b6cb9745349448126d805e44fcc19573e /drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
parent2f590f8419c6abb6d87d89c99931a13404a7dbe1 (diff)
drm/amdgpu: add gpu_info firmware (v3)
Add a new gpu info firmware to store gpu specific configuration data. This allows us to store hw constants in a unified place. v2: adjust structure and elements v3: further restructure Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Tested-by: Junwei Zhang <Jerry.Zhang@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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index dfd1c98efa7c..38e3ba6e6467 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -197,6 +197,27 @@ void amdgpu_ucode_print_sdma_hdr(const struct common_firmware_header *hdr)
197 } 197 }
198} 198}
199 199
200void amdgpu_ucode_print_gpu_info_hdr(const struct common_firmware_header *hdr)
201{
202 uint16_t version_major = le16_to_cpu(hdr->header_version_major);
203 uint16_t version_minor = le16_to_cpu(hdr->header_version_minor);
204
205 DRM_DEBUG("GPU_INFO\n");
206 amdgpu_ucode_print_common_hdr(hdr);
207
208 if (version_major == 1) {
209 const struct gpu_info_firmware_header_v1_0 *gpu_info_hdr =
210 container_of(hdr, struct gpu_info_firmware_header_v1_0, header);
211
212 DRM_DEBUG("version_major: %u\n",
213 le16_to_cpu(gpu_info_hdr->version_major));
214 DRM_DEBUG("version_minor: %u\n",
215 le16_to_cpu(gpu_info_hdr->version_minor));
216 } else {
217 DRM_ERROR("Unknown gpu_info ucode version: %u.%u\n", version_major, version_minor);
218 }
219}
220
200int amdgpu_ucode_validate(const struct firmware *fw) 221int amdgpu_ucode_validate(const struct firmware *fw)
201{ 222{
202 const struct common_firmware_header *hdr = 223 const struct common_firmware_header *hdr =