dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Laurent Pinchart
	<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
	dri-devel
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Daniel Vetter
	<daniel.vetter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-kernel
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Boris Brezillon
	<boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Thomas Petazzoni
	<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Subject: Re: [PATCH 09/18] drm/sun4i: tcon: Adjust dotclock dividers range
Date: Thu, 20 Jul 2017 16:55:00 +0200	[thread overview]
Message-ID: <20170720145500.kpwj7iscrwyjqi5q@flea> (raw)
In-Reply-To: <CAGb2v67WtqukOHPNkyzA+s8GAUR6fnomvT6Sqp8547euHH3G-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2504 bytes --]

On Fri, Jul 14, 2017 at 12:14:37PM +0800, Chen-Yu Tsai wrote:
> On Thu, Jul 13, 2017 at 10:13 PM, Maxime Ripard
> <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
> > It seems like the dotclock dividers are a bit less strict range, and can
> > operate even with a smaller than 6 divider. Loose the boundaries a bit.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> > ---
> >  drivers/gpu/drm/sun4i/sun4i_dotclock.c | 20 +++++++++++++++++++-
> >  1 file changed, 19 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
> > index d401156490f3..0b844c0dd102 100644
> > --- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
> > +++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
> > @@ -77,7 +77,25 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
> >         u8 best_div = 1;
> >         int i;
> >
> > -       for (i = 6; i <= 127; i++) {
> > +       /*
> > +        * There's something odd here.
> > +        *
> > +        * In the A13 user manual, this is stated to be >= 6 when
> > +        * dclk1 and dclk2 are used (without any hint on how to use
> > +        * them), and >= 4 when only dclk is used.
> 
> You set it in TCON0_IO_POL_REG, which sets the clock phase delay.

oh, so it's d for delay? I assumed it was for dotclock.

> I think we were setting this before, but you removed it as part of
> the previous TCON clean up patches?

Hmmm, I might have.. :)

> In the A33, there are even more options, like DCLK / 2 (with 0 or 90
> degree phase delay).

Where did you find this documentation? I was under the impression that
all that DCLK stuff was in the higher bits of the DCLK register, but
apparently there's more to it.

> > +        *
> > +        * In the A33 user manual, when only dclk is used, it is set
> > +        * to be >= 6 in the former case, and >= 1 in the
> > +        * latter. There's also some (obscure) explanations about the
> > +        * dclk1 and dclk2 vs dclk that seems to be in the upper 4
> > +        * bits. What those clocks are and what bit does what is not
> > +        * really clear.
> 
> Looks like mux bits to me. How they differ from TCON0_IO_POL_REG is
> beyond me ATM.

It might be some additional dividers too.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  parent reply	other threads:[~2017-07-20 14:55 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 14:12 [PATCH 00/18] drm/sun4i: Allwinner MIPI-DSI support Maxime Ripard
2017-07-13 14:12 ` [PATCH 01/18] regmap: mmio: Add function to attach a clock Maxime Ripard
2017-07-13 16:01   ` Mark Brown
2017-07-17  9:01     ` Maxime Ripard
2017-07-18 13:21       ` Mark Brown
2017-07-20 14:44         ` Maxime Ripard
2017-07-13 14:12 ` [PATCH 02/18] drm/sun4i: Add if statement instead of depends on Maxime Ripard
2017-07-14  3:09   ` Chen-Yu Tsai
     [not found]     ` <CAGb2v64KXCm1SzCz1hSkk1WOA03rju5_v_Q9XdF=cSs26Wz+Tw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-17  8:45       ` Maxime Ripard
2017-07-13 14:12 ` [PATCH 03/18] drm/sun4i: Realign Makefile padding and reorder it Maxime Ripard
     [not found]   ` <fd70853df9e7ee66a20df9d42921f1f6608a2bc9.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-14  3:13     ` Chen-Yu Tsai
     [not found]       ` <CAGb2v67HmUpSaoJWS6jKg3JvsPmqMtv30EGdWE50YEPm2cyjcg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-20 13:08         ` Maxime Ripard
2017-07-13 14:12 ` [PATCH 04/18] drm/sun4i: Remove useless atomic_check Maxime Ripard
2017-07-14  3:15   ` Chen-Yu Tsai
     [not found]     ` <CAGb2v67=x+6tdKsKEkY2VS75H561zUfh55h2sNUcrCERr+z72A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-17  8:47       ` Maxime Ripard
2017-07-13 14:13 ` [PATCH 05/18] drm/sun4i: tcon: remove unused function Maxime Ripard
     [not found]   ` <7d8e9b8d77c9bef3258e97a06aab42314355acf4.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-14  3:16     ` Chen-Yu Tsai
2017-07-13 14:13 ` [PATCH 06/18] drm/sun4i: tcon: Don't rely on encoders to enable the TCON Maxime Ripard
     [not found]   ` <e8e204b4b366f609db5b7d848f8cfb88345cd2d7.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-14  3:40     ` Chen-Yu Tsai
     [not found]       ` <CAGb2v67LNwLWWJEkw=FKE-kPkVHPK7XZC-OY02A1a94w6E5e1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-20 13:20         ` Maxime Ripard
2017-07-13 14:13 ` [PATCH 07/18] drm/sun4i: tcon: Don't rely on encoders to set the TCON mode Maxime Ripard
     [not found]   ` <31e3fd8540d85c8f4637af1083c5c2a436403cd2.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-14  3:56     ` Chen-Yu Tsai
2017-07-20 13:34       ` Maxime Ripard
2017-07-13 14:13 ` [PATCH 08/18] drm/sun4i: tcon: Add TRI finish interrupt for vblank Maxime Ripard
2017-07-14  3:57   ` Chen-Yu Tsai
2017-07-13 14:13 ` [PATCH 09/18] drm/sun4i: tcon: Adjust dotclock dividers range Maxime Ripard
     [not found]   ` <74db696da66cffafe1e729fe2df73b437c8fd483.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-14  4:14     ` Chen-Yu Tsai
     [not found]       ` <CAGb2v67WtqukOHPNkyzA+s8GAUR6fnomvT6Sqp8547euHH3G-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-20 14:55         ` Maxime Ripard [this message]
2017-07-20 15:16           ` Chen-Yu Tsai
2017-07-13 14:13 ` [PATCH 10/18] drm/sun4i: tcon: Move out the tcon0 common setup Maxime Ripard
2017-07-14  9:50   ` kbuild test robot
2017-07-18  3:41   ` Chen-Yu Tsai
     [not found]     ` <CAGb2v65TfUKyWg=vxWP-YhM3Be1i=N1OmNTO16aFk2VTCg4VXg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-20 13:55       ` Maxime Ripard
2017-07-13 14:13 ` [PATCH 11/18] dt-bindings: display: Add Allwinner MIPI-DSI bindings Maxime Ripard
     [not found]   ` <41dca303c02faf350e765b81c36ddcddbba6f950.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-17 18:41     ` Rob Herring
2017-07-18 10:18       ` Laurent Pinchart
2017-07-20 14:21         ` Maxime Ripard
2017-07-20 14:19       ` Maxime Ripard
2017-07-13 14:13 ` [PATCH 12/18] drm/sun4i: Add Allwinner A31 MIPI-DSI controller support Maxime Ripard
     [not found]   ` <55729048aa9c57b46ed3f8d284eec2fbf5f1ae6a.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-14 10:15     ` kbuild test robot
2017-07-13 14:13 ` [PATCH 13/18] dt-bindings: vendor: Add Huarui Lighting Maxime Ripard
2017-07-14  7:53   ` Chen-Yu Tsai
2017-07-20 13:37     ` Maxime Ripard
2017-07-13 14:13 ` [PATCH 14/18] dt-bindings: panel: Add Huarui LHR050H41 panel documentation Maxime Ripard
     [not found]   ` <5c1df0e5171fd2fb0e4536e88363eeb8c8382b80.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-17 18:44     ` Rob Herring
     [not found] ` <cover.a5e7407c191c66e264164d017f64582039c56acb.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-13 14:13   ` [PATCH 15/18] drm/panel: Add Huarui LHR050H41 panel driver Maxime Ripard
     [not found]     ` <78212e5adad59f09db9ff87b4430b97494f4d874.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-14  9:22       ` Andrzej Hajda
2017-07-13 14:13   ` [PATCH 16/18] arm: dts: sun8i: a33: Add the DSI-related nodes Maxime Ripard
2017-07-13 14:13   ` [PATCH 17/18] arm: dts: sun8i: Add BananaPI M2-Magic DTS Maxime Ripard
     [not found]     ` <fd6f80ac08ce9cbe4ccba884750dae128c538a2f.1499955058.git-series.maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-07-14  4:40       ` Chen-Yu Tsai
     [not found]         ` <CAGb2v678uy7YBHyO01q84ypQu+zfp2Mp+pnORz7s5m91svx0vA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-17  9:03           ` Maxime Ripard
2017-07-13 14:13 ` [PATCH 18/18] [DO NOT MERGE] arm: dts: sun8i: bpi-m2m: Add DSI display Maxime Ripard

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=20170720145500.kpwj7iscrwyjqi5q@flea \
    --to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=daniel.vetter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).