drm/i915/bxt: BUNs related to port PLL
authorVandana Kannan <vandana.kannan@intel.com>
Wed, 1 Jul 2015 11:32:57 +0000 (17:02 +0530)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 6 Jul 2015 08:21:05 +0000 (10:21 +0200)
This patch contains changes based on 2 updates to the spec:
Port PLL VCO restriction raised up to 6700.
Port PLL now needs DCO amp override enable for all VCO frequencies.

v2: Sonika's review comment addressed
- dcoampovr_en_h variable not required
Based on a discussion with Siva, the following changes have been made.
- replace dco_amp var with #define BXT_DCO_AMPLITUDE
- set pll10 in a single assignment

v3:
Move DCO amplitude default value to i915_reg.h. Suggested by Siva.

Signed-off-by: Vandana Kannan <vandana.kannan@intel.com>
Reviewed-by: Sonika Jindal <sonika.jindal@intel.com> [v2]
[danvet: Spell out BUN since not everyone knows what this means.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_display.c

index 42ba1ef641d8fc638b0984ea104786dfb6c878ba..ac8436fc6ced16fd82b1aa9bf231bfd0048507eb 100644 (file)
@@ -1215,6 +1215,7 @@ enum skl_disp_power_wells {
 #define  PORT_PLL_LOCK_THRESHOLD_MASK  (0x7 << PORT_PLL_LOCK_THRESHOLD_SHIFT)
 /* PORT_PLL_10_A */
 #define  PORT_PLL_DCO_AMP_OVR_EN_H     (1<<27)
+#define  PORT_PLL_DCO_AMP_DEFAULT      15
 #define  PORT_PLL_DCO_AMP_MASK         0x3c00
 #define  PORT_PLL_DCO_AMP(x)           (x<<10)
 #define _PORT_PLL_BASE(port)           _PORT3(port, _PORT_PLL_0_A,     \
index e7f0379453e83052e0a7a45db8e75bdd23c11e75..db22f017302779070c27061dba4211498a94e5e2 100644 (file)
@@ -1644,7 +1644,7 @@ bxt_ddi_pll_select(struct intel_crtc *intel_crtc,
        struct bxt_clk_div clk_div = {0};
        int vco = 0;
        uint32_t prop_coef, int_coef, gain_ctl, targ_cnt;
-       uint32_t dcoampovr_en_h, dco_amp, lanestagger;
+       uint32_t lanestagger;
 
        if (intel_encoder->type == INTEL_OUTPUT_HDMI) {
                intel_clock_t best_clock;
@@ -1683,9 +1683,7 @@ bxt_ddi_pll_select(struct intel_crtc *intel_crtc,
                vco = clock * 10 / 2 * clk_div.p1 * clk_div.p2;
        }
 
-       dco_amp = 15;
-       dcoampovr_en_h = 0;
-       if (vco >= 6200000 && vco <= 6480000) {
+       if (vco >= 6200000 && vco <= 6700000) {
                prop_coef = 4;
                int_coef = 9;
                gain_ctl = 3;
@@ -1696,8 +1694,6 @@ bxt_ddi_pll_select(struct intel_crtc *intel_crtc,
                int_coef = 11;
                gain_ctl = 3;
                targ_cnt = 9;
-               if (vco >= 4800000 && vco < 5400000)
-                       dcoampovr_en_h = 1;
        } else if (vco == 5400000) {
                prop_coef = 3;
                int_coef = 8;
@@ -1741,10 +1737,9 @@ bxt_ddi_pll_select(struct intel_crtc *intel_crtc,
 
        crtc_state->dpll_hw_state.pll9 = 5 << PORT_PLL_LOCK_THRESHOLD_SHIFT;
 
-       if (dcoampovr_en_h)
-               crtc_state->dpll_hw_state.pll10 = PORT_PLL_DCO_AMP_OVR_EN_H;
-
-       crtc_state->dpll_hw_state.pll10 |= PORT_PLL_DCO_AMP(dco_amp);
+       crtc_state->dpll_hw_state.pll10 =
+               PORT_PLL_DCO_AMP(PORT_PLL_DCO_AMP_DEFAULT)
+               | PORT_PLL_DCO_AMP_OVR_EN_H;
 
        crtc_state->dpll_hw_state.ebb4 = PORT_PLL_10BIT_CLK_ENABLE;
 
index 724b0e3a5d37eaa4992b302dbfb80ccae9b271f6..5ba35bb8e1a54c5d6b6f7ccca2d056ad7a69f140 100644 (file)
@@ -409,7 +409,7 @@ static const intel_limit_t intel_limits_chv = {
 static const intel_limit_t intel_limits_bxt = {
        /* FIXME: find real dot limits */
        .dot = { .min = 0, .max = INT_MAX },
-       .vco = { .min = 4800000, .max = 6480000 },
+       .vco = { .min = 4800000, .max = 6700000 },
        .n = { .min = 1, .max = 1 },
        .m1 = { .min = 2, .max = 2 },
        /* FIXME: find real m2 limits */