drm/i915/icl: Skip init for an already enabled combo PHY

Bspec says we should skip the initialization of combo PHYs that are
already initialized. We'll need to reinit the PHYs more frequently
when exiting from DC6 (after the next patch), so let's make sure the
uninit sequence complies with the spec. For safety skip the init only if
all the PHY register fields have their expected values.

v2:
- Print 'Port X' as we do elsewhere instead of 'Port-X'. (Jose)

Bspec: 21257
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181106160621.23057-5-imre.deak@intel.com
This commit is contained in:
Imre Deak 2018-11-06 18:06:20 +02:00
parent eef519e2d0
commit bc458c1174
1 changed files with 6 additions and 0 deletions

View File

@ -202,6 +202,12 @@ void icl_combo_phys_init(struct drm_i915_private *dev_priv)
for (port = PORT_A; port <= PORT_B; port++) { for (port = PORT_A; port <= PORT_B; port++) {
u32 val; u32 val;
if (icl_combo_phy_verify_state(dev_priv, port)) {
DRM_DEBUG_DRIVER("Port %c combo PHY already enabled, won't reprogram it.\n",
port_name(port));
continue;
}
val = I915_READ(ICL_PHY_MISC(port)); val = I915_READ(ICL_PHY_MISC(port));
val &= ~ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN; val &= ~ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN;
I915_WRITE(ICL_PHY_MISC(port), val); I915_WRITE(ICL_PHY_MISC(port), val);