diff options
author | Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com> | 2015-03-05 09:03:08 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-03-17 17:30:13 -0400 |
commit | 9cbe40c15a753e02f5da16f6de901decf3276cf1 (patch) | |
tree | 3cec68ce0e5d71fc4778dcfc83d934bbaabce995 /drivers/gpu/drm/i915/intel_display.c | |
parent | de3a0fde9afe551440db486f3f5ee52c8f15120a (diff) |
drm/i915: Update prop, int co-eff and gain threshold for CHV
This patch implements latest PHY changes in Gain, prop and int co-efficients
based on the vco freq.
v2: Split the original changes into multiple smaller patches based on
review by Ville
v3: Addressed Ville's review comments. Fixed the error introduced in v2.
Clear the old bits before we modify those bits as part of RMW.
v4: TDC target cnt is 10 bits and not 8 bits (Ville)
Signed-off-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2eea258e5865..cbf426ec92e3 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6159,10 +6159,10 @@ static void chv_prepare_pll(struct intel_crtc *crtc, | |||
6159 | int pipe = crtc->pipe; | 6159 | int pipe = crtc->pipe; |
6160 | int dpll_reg = DPLL(crtc->pipe); | 6160 | int dpll_reg = DPLL(crtc->pipe); |
6161 | enum dpio_channel port = vlv_pipe_to_channel(pipe); | 6161 | enum dpio_channel port = vlv_pipe_to_channel(pipe); |
6162 | u32 loopfilter, intcoeff; | 6162 | u32 loopfilter, tribuf_calcntr; |
6163 | u32 bestn, bestm1, bestm2, bestp1, bestp2, bestm2_frac; | 6163 | u32 bestn, bestm1, bestm2, bestp1, bestp2, bestm2_frac; |
6164 | u32 dpio_val; | 6164 | u32 dpio_val; |
6165 | int refclk; | 6165 | int vco; |
6166 | 6166 | ||
6167 | bestn = pipe_config->dpll.n; | 6167 | bestn = pipe_config->dpll.n; |
6168 | bestm2_frac = pipe_config->dpll.m2 & 0x3fffff; | 6168 | bestm2_frac = pipe_config->dpll.m2 & 0x3fffff; |
@@ -6170,7 +6170,9 @@ static void chv_prepare_pll(struct intel_crtc *crtc, | |||
6170 | bestm2 = pipe_config->dpll.m2 >> 22; | 6170 | bestm2 = pipe_config->dpll.m2 >> 22; |
6171 | bestp1 = pipe_config->dpll.p1; | 6171 | bestp1 = pipe_config->dpll.p1; |
6172 | bestp2 = pipe_config->dpll.p2; | 6172 | bestp2 = pipe_config->dpll.p2; |
6173 | vco = pipe_config->dpll.vco; | ||
6173 | dpio_val = 0; | 6174 | dpio_val = 0; |
6175 | loopfilter = 0; | ||
6174 | 6176 | ||
6175 | /* | 6177 | /* |
6176 | * Enable Refclk and SSC | 6178 | * Enable Refclk and SSC |
@@ -6217,18 +6219,35 @@ static void chv_prepare_pll(struct intel_crtc *crtc, | |||
6217 | vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW9(port), dpio_val); | 6219 | vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW9(port), dpio_val); |
6218 | 6220 | ||
6219 | /* Loop filter */ | 6221 | /* Loop filter */ |
6220 | refclk = i9xx_get_refclk(crtc, 0); | 6222 | if (vco == 5400000) { |
6221 | loopfilter = 5 << DPIO_CHV_PROP_COEFF_SHIFT | | 6223 | loopfilter |= (0x3 << DPIO_CHV_PROP_COEFF_SHIFT); |
6222 | 2 << DPIO_CHV_GAIN_CTRL_SHIFT; | 6224 | loopfilter |= (0x8 << DPIO_CHV_INT_COEFF_SHIFT); |
6223 | if (refclk == 100000) | 6225 | loopfilter |= (0x1 << DPIO_CHV_GAIN_CTRL_SHIFT); |
6224 | intcoeff = 11; | 6226 | tribuf_calcntr = 0x9; |
6225 | else if (refclk == 38400) | 6227 | } else if (vco <= 6200000) { |
6226 | intcoeff = 10; | 6228 | loopfilter |= (0x5 << DPIO_CHV_PROP_COEFF_SHIFT); |
6227 | else | 6229 | loopfilter |= (0xB << DPIO_CHV_INT_COEFF_SHIFT); |
6228 | intcoeff = 9; | 6230 | loopfilter |= (0x3 << DPIO_CHV_GAIN_CTRL_SHIFT); |
6229 | loopfilter |= intcoeff << DPIO_CHV_INT_COEFF_SHIFT; | 6231 | tribuf_calcntr = 0x9; |
6232 | } else if (vco <= 6480000) { | ||
6233 | loopfilter |= (0x4 << DPIO_CHV_PROP_COEFF_SHIFT); | ||
6234 | loopfilter |= (0x9 << DPIO_CHV_INT_COEFF_SHIFT); | ||
6235 | loopfilter |= (0x3 << DPIO_CHV_GAIN_CTRL_SHIFT); | ||
6236 | tribuf_calcntr = 0x8; | ||
6237 | } else { | ||
6238 | /* Not supported. Apply the same limits as in the max case */ | ||
6239 | loopfilter |= (0x4 << DPIO_CHV_PROP_COEFF_SHIFT); | ||
6240 | loopfilter |= (0x9 << DPIO_CHV_INT_COEFF_SHIFT); | ||
6241 | loopfilter |= (0x3 << DPIO_CHV_GAIN_CTRL_SHIFT); | ||
6242 | tribuf_calcntr = 0; | ||
6243 | } | ||
6230 | vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW6(port), loopfilter); | 6244 | vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW6(port), loopfilter); |
6231 | 6245 | ||
6246 | dpio_val = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW8(pipe)); | ||
6247 | dpio_val &= ~DPIO_CHV_TDC_TARGET_CNT_MASK; | ||
6248 | dpio_val |= (tribuf_calcntr << DPIO_CHV_TDC_TARGET_CNT_SHIFT); | ||
6249 | vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW8(port), dpio_val); | ||
6250 | |||
6232 | /* AFC Recal */ | 6251 | /* AFC Recal */ |
6233 | vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW14(port), | 6252 | vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW14(port), |
6234 | vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW14(port)) | | 6253 | vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW14(port)) | |