drm/amd/display: Wait for clean shutdown in DMCUB reset
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Thu, 16 Jan 2020 14:16:18 +0000 (09:16 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Feb 2020 20:04:37 +0000 (15:04 -0500)
commitb1e9da7f7dd4a7bfeb8c0819cfd97db672229e42
tree415c1eb2cff8f44a3455bc948fc2deb21b76daf1
parentfbbd3f8f6b8fd0165ed95cc0236cd482175a0403
drm/amd/display: Wait for clean shutdown in DMCUB reset

[Why]
The DMCUB may be currently executing commands when the reset is
triggered.

Before issuing a reset we should first wait for the DMCUB to finish
its work.

[How]
Send the GPINT command for halting the firmware before reset.

Get the ack for the command then wait for the scratch register to
become the correct value.

We want this to take under ~40us or so at most before we force reset
to cover PHY delay sequence max time.

Each register read will be at least ~1-3us so don't bother using udelay.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dmub/inc/dmub_gpint_cmd.h
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c