ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Frank Oltmanns <frank@oltmanns.dev>
Cc: "Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>, "Chen-Yu Tsai" <wens@csie.org>,
	"Samuel Holland" <samuel@sholland.org>,
	"Guido Günther" <agx@sigxcpu.org>,
	"Purism Kernel Team" <kernel@puri.sm>,
	"Ondrej Jirman" <megi@xff.cz>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Jessica Zhang" <quic_jesszhan@quicinc.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/5] clk: sunxi-ng: a64: Add constraints on PLL-VIDEO0's n/m ratio
Date: Tue, 09 Jan 2024 21:29:39 +0100	[thread overview]
Message-ID: <3461075.QJadu78ljV@jernej-laptop> (raw)
In-Reply-To: <87jzoug2jz.fsf@oltmanns.dev>

Dne nedelja, 31. december 2023 ob 10:10:40 CET je Frank Oltmanns napisal(a):
> 
> On 2023-12-19 at 17:54:19 +0100, Jernej Škrabec <jernej.skrabec@gmail.com> wrote:
> > Dne ponedeljek, 18. december 2023 ob 14:35:22 CET je Frank Oltmanns napisal(a):
> >> The Allwinner A64 manual lists the following constraint for the
> >> PLL-VIDEO0 clock: 8 <= N/M <= 25
> >>
> >> Use this constraint.
> >>
> >> Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
> >> ---
> >>  drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 8 ++++++--
> >>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
> >> index c034ac027d1c..75d839da446c 100644
> >> --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
> >> +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
> >> @@ -68,7 +68,8 @@ static SUNXI_CCU_NM_WITH_SDM_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
> >>  				       BIT(28),	/* lock */
> >>  				       CLK_SET_RATE_UNGATE);
> >>
> >> -static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX_CLOSEST(pll_video0_clk, "pll-video0",
> >> +static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX_FEAT_NM_RATIO(pll_video0_clk,
> >> +						"pll-video0",
> >>  						"osc24M", 0x010,
> >>  						192000000,	/* Minimum rate */
> >>  						1008000000,	/* Maximum rate */
> 
> I just realized that adding the whole ratio limits for ccu_nm is
> superfluous as you could just as well express them in for of a minimum
> and maximum range:
> Since 8 <= N/M <= 25 and parent_rate = 24 MHz, therefore
>   192 MHz <= rate <= 600 MHz.

Good point!

> 
> These absolute limits are also listed in Allwinner's A64 manual.
> 
> BUT, here the upper limit was raised to 1008 MHz:
> 5de39acaf34604bd04834f092479cf4dcc946dd "clk: sunxi-ng: a64: Add max.
> rate constraint to video PLL"
> 
> With this upper limit the ratio limitation is effectively:
> 8 <= N/M <= 42
> 
> Icenowy Zheng (added to CC) had the reasonable explanation that this was
> used in the BSP kernel, so we should probably stick to that and ditch
> the two PLL-VIDEO0 related patches. What are your thoughts on that?

Ok, it seems that these patches are really superfluous. Remove them for v2.

Best regards,
Jernej

> 
> >> @@ -80,7 +81,10 @@ static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX_CLOSEST(pll_video0_clk, "pll-vid
> >>  						297000000,	/* frac rate 1 */
> >>  						BIT(31),	/* gate */
> >>  						BIT(28),	/* lock */
> >> -						CLK_SET_RATE_UNGATE);
> >> +						CLK_SET_RATE_UNGATE,
> >> +						CCU_FEATURE_FRACTIONAL |
> >> +						CCU_FEATURE_CLOSEST_RATE,
> >
> > Above flags are unrelated change, put them in new patch if needed.
> >
> > Best regards,
> > Jernej
> >
> >> +						8, 25);		/* min/max nm ratio */
> >>
> >>  static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve",
> >>  					"osc24M", 0x018,
> >>
> >>
> 





  reply	other threads:[~2024-01-09 20:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 13:35 [PATCH 0/5] Pinephone video out fixes (flipping between two frames) Frank Oltmanns
2023-12-18 13:35 ` [PATCH 1/5] clk: sunxi-ng: nkm: Support constraints on m/n ratio and parent rate Frank Oltmanns
2023-12-18 17:26   ` Frank Oltmanns
2023-12-19 16:46   ` Jernej Škrabec
2023-12-20  6:58     ` Frank Oltmanns
2023-12-20 15:09       ` Jernej Škrabec
2023-12-18 13:35 ` [PATCH 2/5] clk: sunxi-ng: a64: Add constraints on PLL-MIPI's n/m " Frank Oltmanns
2023-12-19 16:46   ` Jernej Škrabec
2023-12-18 13:35 ` [PATCH 3/5] clk: sunxi-ng: nm: Support constraints on " Frank Oltmanns
2023-12-19 16:52   ` Jernej Škrabec
2023-12-18 13:35 ` [PATCH 4/5] clk: sunxi-ng: a64: Add constraints on PLL-VIDEO0's n/m ratio Frank Oltmanns
2023-12-19 16:54   ` Jernej Škrabec
2023-12-20  7:09     ` Frank Oltmanns
2023-12-20 15:12       ` Jernej Škrabec
2023-12-22  7:46         ` Frank Oltmanns
2023-12-31  9:10     ` Frank Oltmanns
2024-01-09 20:29       ` Jernej Škrabec [this message]
2023-12-18 13:35 ` [PATCH 5/5] drm/panel: st7703: Drive XBD599 panel at higher clock rate Frank Oltmanns
2023-12-19 17:04   ` Jernej Škrabec
2023-12-20  7:14     ` Frank Oltmanns
2023-12-20 15:18       ` Jernej Škrabec
2023-12-20 18:57         ` Frank Oltmanns
2023-12-22  9:10           ` Frank Oltmanns
2023-12-22 17:36             ` Jernej Škrabec
2023-12-30 21:17         ` Frank Oltmanns

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=3461075.QJadu78ljV@jernej-laptop \
    --to=jernej.skrabec@gmail.com \
    --cc=agx@sigxcpu.org \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=frank@oltmanns.dev \
    --cc=kernel@puri.sm \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=megi@xff.cz \
    --cc=mripard@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_jesszhan@quicinc.com \
    --cc=sam@ravnborg.org \
    --cc=samuel@sholland.org \
    --cc=sboyd@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=wens@csie.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 read-only IMAP folder(s) and NNTP newsgroup(s).