aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-07-05 15:17:00 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-07-14 11:06:17 -0400
commit6c8855541492b3d812d55c9fe5a2ed17ddf022b8 (patch)
treee1c5d6f772126c4bd4494589b6c35565f88cadcf /drivers/gpu/drm/amd/amdgpu
parenta5d20c405a37db7e59089422e795ad58feb37638 (diff)
drm/amdgpu/atom: fix atom_fw check
Not all vbios images seem to set the version appropriately. Switch the check based on asic type instead. Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index 365e735f6647..ea3a2501c7cd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -86,19 +86,6 @@ static bool check_atom_bios(uint8_t *bios, size_t size)
86 return false; 86 return false;
87} 87}
88 88
89static bool is_atom_fw(uint8_t *bios)
90{
91 uint16_t bios_header_start = bios[0x48] | (bios[0x49] << 8);
92 uint8_t frev = bios[bios_header_start + 2];
93 uint8_t crev = bios[bios_header_start + 3];
94
95 if ((frev < 3) ||
96 ((frev == 3) && (crev < 3)))
97 return false;
98
99 return true;
100}
101
102/* If you boot an IGP board with a discrete card as the primary, 89/* If you boot an IGP board with a discrete card as the primary,
103 * the IGP rom is not accessible via the rom bar as the IGP rom is 90 * the IGP rom is not accessible via the rom bar as the IGP rom is
104 * part of the system bios. On boot, the system bios puts a 91 * part of the system bios. On boot, the system bios puts a
@@ -455,6 +442,6 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
455 return false; 442 return false;
456 443
457success: 444success:
458 adev->is_atom_fw = is_atom_fw(adev->bios); 445 adev->is_atom_fw = (adev->asic_type >= CHIP_VEGA10) ? true : false;
459 return true; 446 return true;
460} 447}