From 1c100b1e7f4f491322e742242e978bef6f580ad4 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 27 Jul 2017 09:23:49 -0400 Subject: [PATCH 1/2] drm/amdgpu/atom: add a helper to clear asic_init in scratch reg Clears the asic_init completed bit in the bios scratch register so that the driver will run asic_init the next time it tries to load on the card. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 9 +++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index ce44358..32309ee 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -1766,6 +1766,15 @@ bool amdgpu_atombios_scratch_need_asic_init(struct amdgpu_device *adev) return true; } +void amdgpu_atombios_scratch_force_asic_init(struct amdgpu_device *adev) +{ + u32 tmp = RREG32(adev->bios_scratch_reg_offset + 7); + + tmp &= ~ATOM_S7_ASIC_INIT_COMPLETE_MASK; + + WREG32(adev->bios_scratch_reg_offset + 7, tmp); +} + /* Atom needs data in little endian format * so swap as appropriate when copying data to * or from atom. Note that atom operates on diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.h index b0d5d1d..6204203 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.h @@ -201,6 +201,7 @@ void amdgpu_atombios_scratch_regs_restore(struct amdgpu_device *adev); void amdgpu_atombios_scratch_regs_engine_hung(struct amdgpu_device *adev, bool hung); bool amdgpu_atombios_scratch_need_asic_init(struct amdgpu_device *adev); +void amdgpu_atombios_scratch_force_asic_init(struct amdgpu_device *adev); void amdgpu_atombios_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le); int amdgpu_atombios_get_max_vddc(struct amdgpu_device *adev, u8 voltage_type, -- 2.5.5