mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 15:41:36 +00:00
drm/amdgpu: add helper to init rlc firmware
To initialzie rlc firmware according to rlc firmware header version v2: squash in backwards compat fix Signed-off-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>
This commit is contained in:
parent
435d6e6f02
commit
5b41521268
@ -501,3 +501,38 @@ static void amdgpu_gfx_rlc_init_microcode_v2_4(struct amdgpu_device *adev)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int amdgpu_gfx_rlc_init_microcode(struct amdgpu_device *adev,
|
||||
uint16_t version_major,
|
||||
uint16_t version_minor)
|
||||
{
|
||||
int err;
|
||||
|
||||
if (version_major < 2) {
|
||||
/* only support rlc_hdr v2.x and onwards */
|
||||
dev_err(adev->dev, "unsupported rlc fw hdr\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* is_rlc_v2_1 is still used in APU code path */
|
||||
if (version_major == 2 && version_minor == 1)
|
||||
adev->gfx.rlc.is_rlc_v2_1 = true;
|
||||
|
||||
if (version_minor >= 0) {
|
||||
err = amdgpu_gfx_rlc_init_microcode_v2_0(adev);
|
||||
if (err) {
|
||||
dev_err(adev->dev, "fail to init rlc v2_0 microcode\n");
|
||||
return err;
|
||||
}
|
||||
}
|
||||
if (version_minor >= 1)
|
||||
amdgpu_gfx_rlc_init_microcode_v2_1(adev);
|
||||
if (version_minor >= 2)
|
||||
amdgpu_gfx_rlc_init_microcode_v2_2(adev);
|
||||
if (version_minor == 3)
|
||||
amdgpu_gfx_rlc_init_microcode_v2_3(adev);
|
||||
if (version_minor == 4)
|
||||
amdgpu_gfx_rlc_init_microcode_v2_4(adev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -267,5 +267,7 @@ int amdgpu_gfx_rlc_init_csb(struct amdgpu_device *adev);
|
||||
int amdgpu_gfx_rlc_init_cpt(struct amdgpu_device *adev);
|
||||
void amdgpu_gfx_rlc_setup_cp_table(struct amdgpu_device *adev);
|
||||
void amdgpu_gfx_rlc_fini(struct amdgpu_device *adev);
|
||||
|
||||
int amdgpu_gfx_rlc_init_microcode(struct amdgpu_device *adev,
|
||||
uint16_t version_major,
|
||||
uint16_t version_minor);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user