From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Lucas De Marchi" <lucas.de.marchi@gmail.com>,
"José Roberto de Souza" <jose.souza@intel.com>
Cc: Intel Graphics <intel-gfx@lists.freedesktop.org>,
Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH 07/14] drm/i915/tgl: Add support for dkl pll write
Date: Mon, 16 Sep 2019 11:48:07 +0300 [thread overview]
Message-ID: <8736gwzkxk.fsf@intel.com> (raw)
In-Reply-To: <CAKi4VA+H5Wjgggu=L7Foa3XK14mmt196S8BRW0nhdyyf71Y-ig@mail.gmail.com>
On Fri, 13 Sep 2019, Lucas De Marchi <lucas.de.marchi@gmail.com> wrote:
> On Fri, Sep 13, 2019 at 3:33 PM José Roberto de Souza
> <jose.souza@intel.com> wrote:
>>
>> From: Vandita Kulkarni <vandita.kulkarni@intel.com>
>>
>> Add a new function to write to dkl phy pll registers. As per the
>> bspec all the registers are read modify write.
>>
>> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
>> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>> ---
>> drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 65 ++++++++++++++++++-
>> 1 file changed, 64 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
>> index 424f9213c80d..afc9b609b63d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
>> @@ -3293,7 +3293,70 @@ static void icl_mg_pll_write(struct drm_i915_private *dev_priv,
>> static void dkl_pll_write(struct drm_i915_private *dev_priv,
>> struct intel_shared_dpll *pll)
>> {
>> - /* TODO */
>> + struct intel_dpll_hw_state *hw_state = &pll->state.hw_state;
>> + enum tc_port tc_port = icl_pll_id_to_tc_port(pll->info->id);
>> + u32 val;
>> +
>> + /*
>> + * All registers programmed here have the same HIP_INDEX_REG even
>> + * though on different building block
>> + */
>> + I915_WRITE(HIP_INDEX_REG(tc_port), 0x2);
>> +
>> + /* All the registers are RMW */
>
> I wish we could use intel_uncore_rmw() here to make this comment go
> away and make it simpler
> in general. But I understand the conversion to use uncore should still
> not be done in display. Should we add
> I195_RMW() meanwhile or it's not worth it? +Jani.
We have tons of code like this in display/ and in the big picture this
makes no difference. Please let's not add I915_RMW or anything such
while we do have a path forward with intel_de_{read,write,rwm}. It just
hasn't happened yet.
BR,
Jani.
>
> Lucas De Marchi
>
>> + val = I915_READ(DKL_REFCLKIN_CTL(tc_port));
>> + val &= ~MG_REFCLKIN_CTL_OD_2_MUX_MASK;
>> + val |= hw_state->mg_refclkin_ctl;
>> + I915_WRITE(DKL_REFCLKIN_CTL(tc_port), val);
>> +
>> + val = I915_READ(DKL_CLKTOP2_CORECLKCTL1(tc_port));
>> + val &= ~MG_CLKTOP2_CORECLKCTL1_A_DIVRATIO_MASK;
>> + val |= hw_state->mg_clktop2_coreclkctl1;
>> + I915_WRITE(DKL_CLKTOP2_CORECLKCTL1(tc_port), val);
>> +
>> + val = I915_READ(DKL_CLKTOP2_HSCLKCTL(tc_port));
>> + val &= ~(MG_CLKTOP2_HSCLKCTL_TLINEDRV_CLKSEL_MASK |
>> + MG_CLKTOP2_HSCLKCTL_CORE_INPUTSEL_MASK |
>> + MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK |
>> + MG_CLKTOP2_HSCLKCTL_DSDIV_RATIO_MASK);
>> + val |= hw_state->mg_clktop2_hsclkctl;
>> + I915_WRITE(DKL_CLKTOP2_HSCLKCTL(tc_port), val);
>> +
>> + val = I915_READ(DKL_PLL_DIV0(tc_port));
>> + val &= ~(DKL_PLL_DIV0_INTEG_COEFF_MASK |
>> + DKL_PLL_DIV0_PROP_COEFF_MASK |
>> + DKL_PLL_DIV0_FBPREDIV_MASK |
>> + DKL_PLL_DIV0_FBDIV_INT_MASK);
>> + val |= hw_state->mg_pll_div0;
>> + I915_WRITE(DKL_PLL_DIV0(tc_port), val);
>> +
>> + val = I915_READ(DKL_PLL_DIV1(tc_port));
>> + val &= ~(DKL_PLL_DIV1_IREF_TRIM_MASK |
>> + DKL_PLL_DIV1_TDC_TARGET_CNT_MASK);
>> + val |= hw_state->mg_pll_div1;
>> + I915_WRITE(DKL_PLL_DIV1(tc_port), val);
>> +
>> + val = I915_READ(DKL_PLL_SSC(tc_port));
>> + val &= ~(DKL_PLL_SSC_IREF_NDIV_RATIO_MASK |
>> + DKL_PLL_SSC_STEP_LEN_MASK |
>> + DKL_PLL_SSC_STEP_NUM_MASK |
>> + DKL_PLL_SSC_EN);
>> + val |= hw_state->mg_pll_ssc;
>> + I915_WRITE(DKL_PLL_SSC(tc_port), val);
>> +
>> + val = I915_READ(DKL_PLL_BIAS(tc_port));
>> + val &= ~(DKL_PLL_BIAS_FRAC_EN_H |
>> + DKL_PLL_BIAS_FBDIV_FRAC_MASK);
>> + val |= hw_state->mg_pll_bias;
>> + I915_WRITE(DKL_PLL_BIAS(tc_port), val);
>> +
>> + val = I915_READ(DKL_PLL_TDC_COLDST_BIAS(tc_port));
>> + val &= ~(DKL_PLL_TDC_SSC_STEP_SIZE_MASK |
>> + DKL_PLL_TDC_FEED_FWD_GAIN_MASK);
>> + val |= hw_state->mg_pll_tdc_coldst_bias;
>> + I915_WRITE(DKL_PLL_TDC_COLDST_BIAS(tc_port), val);
>> +
>> + POSTING_READ(DKL_PLL_TDC_COLDST_BIAS(tc_port));
>> }
>>
>> static void icl_pll_power_enable(struct drm_i915_private *dev_priv,
>> --
>> 2.23.0
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-09-16 8:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-13 22:32 [PATCH 00/14] TGL TC enabling José Roberto de Souza
2019-09-13 22:32 ` [PATCH 01/14] drm/i915/tgl: Add missing ddi clock select during DP init sequence José Roberto de Souza
2019-09-13 22:32 ` [PATCH 02/14] drm/i915/tgl: TC helper function to return pin mapping José Roberto de Souza
2019-09-14 5:54 ` Lucas De Marchi
2019-09-17 21:15 ` Souza, Jose
2019-09-13 22:32 ` [PATCH 03/14] drm/i915/tgl: Finish modular FIA support on registers José Roberto de Souza
2019-09-14 6:24 ` Lucas De Marchi
2019-09-18 1:08 ` Souza, Jose
2019-09-13 22:32 ` [PATCH 04/14] drm/i915/tgl: Fix driver crash when update_active_dpll is called José Roberto de Souza
2019-09-14 6:32 ` Lucas De Marchi
2019-09-17 22:59 ` Souza, Jose
2019-09-13 22:32 ` [PATCH 05/14] drm/i915/tgl: Add dkl phy registers José Roberto de Souza
2019-09-13 22:32 ` [PATCH 06/14] drm/i915/tgl: Add initial dkl pll support José Roberto de Souza
2019-09-13 22:32 ` [PATCH 07/14] drm/i915/tgl: Add support for dkl pll write José Roberto de Souza
2019-09-14 6:41 ` Lucas De Marchi
2019-09-16 8:48 ` Jani Nikula [this message]
2019-09-13 22:32 ` [PATCH 08/14] drm/i915/tgl: Add dkl phy programming sequences José Roberto de Souza
2019-09-13 22:32 ` [PATCH 09/14] drm/i915/icl: Unify disable and enable phy clock gating functions José Roberto de Souza
2019-09-13 22:32 ` [PATCH 10/14] drm/i915/tgl: Fix dkl phy register space addressing José Roberto de Souza
2019-09-14 7:26 ` Lucas De Marchi
2019-09-18 19:55 ` Souza, Jose
2019-09-13 22:32 ` [PATCH 11/14] drm/i915/tgl: Check the UC health of tc controllers after power on José Roberto de Souza
2019-09-13 22:32 ` [PATCH 12/14] drm/i915: Add dkl phy pll calculations José Roberto de Souza
2019-09-14 7:38 ` Lucas De Marchi
2019-09-13 22:32 ` [PATCH 13/14] drm/i915/tgl: Use dkl pll hardcoded values José Roberto de Souza
2019-09-13 22:32 ` [PATCH 14/14] drm/i915/tgl: initialize TC and TBT ports José Roberto de Souza
2019-09-13 22:53 ` ✗ Fi.CI.CHECKPATCH: warning for TGL TC enabling Patchwork
2019-09-13 23:12 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-15 7:07 ` ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8736gwzkxk.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jose.souza@intel.com \
--cc=lucas.de.marchi@gmail.com \
--cc=lucas.demarchi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox