drm/i915/dg1: Wait for pcode/uncore handshake at startup
authorMatt Roper <matthew.d.roper@intel.com>
Thu, 1 Oct 2020 06:39:17 +0000 (23:39 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 5 Oct 2020 22:54:45 +0000 (15:54 -0700)
commitf9c730ede7d3f40900cb493890d94d868ff2f00f
treebad4c2f82a85bee281992f9d3d202fc4bfac3e21
parentb1e93a85f8e969721e1e28766ab54e84ba35c24e
drm/i915/dg1: Wait for pcode/uncore handshake at startup

DG1 does some additional pcode/uncore handshaking at
boot time; this handshaking must complete before various other pcode
commands are effective and before general work is submitted to the GPU.
We need to poll a new pcode mailbox during startup until it reports that
this handshaking is complete.

The bspec doesn't give guidance on how long we may need to wait for this
handshaking to complete.  For now, let's just set a really long timeout;
if we still don't get a completion status by the end of that timeout,
we'll just continue on and hope for the best.

v2 (Lucas): Rename macros to make clear the relation between command and
   result (requested by José)

Bspec: 52065
Cc: Clinton Taylor <Clinton.A.Taylor@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201001063917.3133475-2-lucas.demarchi@intel.com
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_sideband.c
drivers/gpu/drm/i915/intel_sideband.h