aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2016-04-21 12:19:21 -0400
committerImre Deak <imre.deak@intel.com>2016-04-22 09:31:53 -0400
commit01a01ef2eaf0eb90f4582f911e9fbce3f79d55e7 (patch)
tree1586ce75dab4b7d81cb662767cedee7746b23e40
parent67856d4d3ccdd4612bcef3a7b624aa33e5b6828d (diff)
drm/i915/bxt: Wait for PHY1 GRC done if PHY0 was already enabled
If we skipped PHY0 initialization because it was already enabled by BIOS, we still have to wait for the PHY1 GRC calibration as that is done as part of the PHY0 init. v2: - Use the actual PHY index in the debug message in broxton_phy_wait_grc_done() (Ville) CC: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1461255561-1644-1-git-send-email-imre.deak@intel.com
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 59dbd479c32b..99da8f555954 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1768,6 +1768,13 @@ static u32 broxton_get_grc(struct drm_i915_private *dev_priv, enum dpio_phy phy)
1768 return (val & GRC_CODE_MASK) >> GRC_CODE_SHIFT; 1768 return (val & GRC_CODE_MASK) >> GRC_CODE_SHIFT;
1769} 1769}
1770 1770
1771static void broxton_phy_wait_grc_done(struct drm_i915_private *dev_priv,
1772 enum dpio_phy phy)
1773{
1774 if (wait_for(I915_READ(BXT_PORT_REF_DW3(phy)) & GRC_DONE, 10))
1775 DRM_ERROR("timeout waiting for PHY%d GRC\n", phy);
1776}
1777
1771static void broxton_phy_init(struct drm_i915_private *dev_priv, 1778static void broxton_phy_init(struct drm_i915_private *dev_priv,
1772 enum dpio_phy phy) 1779 enum dpio_phy phy)
1773{ 1780{
@@ -1871,9 +1878,7 @@ static void broxton_phy_init(struct drm_i915_private *dev_priv,
1871 * the corresponding calibrated value from PHY1, and disable 1878 * the corresponding calibrated value from PHY1, and disable
1872 * the automatic calibration on PHY0. 1879 * the automatic calibration on PHY0.
1873 */ 1880 */
1874 if (wait_for(I915_READ(BXT_PORT_REF_DW3(DPIO_PHY1)) & GRC_DONE, 1881 broxton_phy_wait_grc_done(dev_priv, DPIO_PHY1);
1875 10))
1876 DRM_ERROR("timeout waiting for PHY1 GRC\n");
1877 1882
1878 val = dev_priv->bxt_phy_grc = broxton_get_grc(dev_priv, 1883 val = dev_priv->bxt_phy_grc = broxton_get_grc(dev_priv,
1879 DPIO_PHY1); 1884 DPIO_PHY1);
@@ -1886,6 +1891,10 @@ static void broxton_phy_init(struct drm_i915_private *dev_priv,
1886 val |= GRC_DIS | GRC_RDY_OVRD; 1891 val |= GRC_DIS | GRC_RDY_OVRD;
1887 I915_WRITE(BXT_PORT_REF_DW8(DPIO_PHY0), val); 1892 I915_WRITE(BXT_PORT_REF_DW8(DPIO_PHY0), val);
1888 } 1893 }
1894 /*
1895 * During PHY1 init delay waiting for GRC calibration to finish, since
1896 * it can happen in parallel with the subsequent PHY0 init.
1897 */
1889 1898
1890 val = I915_READ(BXT_PHY_CTL_FAMILY(phy)); 1899 val = I915_READ(BXT_PHY_CTL_FAMILY(phy));
1891 val |= COMMON_RESET_DIS; 1900 val |= COMMON_RESET_DIS;
@@ -1897,6 +1906,12 @@ void broxton_ddi_phy_init(struct drm_i915_private *dev_priv)
1897 /* Enable PHY1 first since it provides Rcomp for PHY0 */ 1906 /* Enable PHY1 first since it provides Rcomp for PHY0 */
1898 broxton_phy_init(dev_priv, DPIO_PHY1); 1907 broxton_phy_init(dev_priv, DPIO_PHY1);
1899 broxton_phy_init(dev_priv, DPIO_PHY0); 1908 broxton_phy_init(dev_priv, DPIO_PHY0);
1909
1910 /*
1911 * If BIOS enabled only PHY0 and not PHY1, we skipped waiting for the
1912 * PHY1 GRC calibration to finish, so wait for it here.
1913 */
1914 broxton_phy_wait_grc_done(dev_priv, DPIO_PHY1);
1900} 1915}
1901 1916
1902static void broxton_phy_uninit(struct drm_i915_private *dev_priv, 1917static void broxton_phy_uninit(struct drm_i915_private *dev_priv,