From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
Cc: Mike Turquette
<mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Mylene Josserand
<mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
linux-clk <linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-arm-kernel
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
linux-kernel
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Thomas Petazzoni
<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Subject: Re: [PATCH 4/6] clk: sunxi-ng: Add A33 CCU support
Date: Mon, 5 Sep 2016 11:51:54 +0200 [thread overview]
Message-ID: <20160905095153.GC6322@lukather> (raw)
In-Reply-To: <CAGb2v66z4KMbfOr2kcNXSSXzVqXQ1uZ9p_-uNyvb_7_ACdNCqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3297 bytes --]
Hi Chen-Yu,
On Mon, Sep 05, 2016 at 02:34:21PM +0800, Chen-Yu Tsai wrote:
> > +static SUNXI_CCU_NKMP_WITH_GATE_LOCK(pll_cpux_clk, "pll-cpux",
> > + "osc24M", 0x000,
> > + 8, 5, /* N */
> > + 4, 2, /* K */
> > + 0, 2, /* M */
> > + 16, 2, /* P */
>
> Manual says there's no divider for P = 0x3.
> You'll need a table here.
Hmmm, Indeed. Or rather, a max value. We discussed that in the past, I
guess it's time to introduce it.
> > + BIT(31), /* gate */
> > + BIT(28), /* lock */
> > + 0);
> > +
> > +/*
> > + * The Audio PLL is supposed to have 4 outputs: 3 fixed factors from
> > + * the base (2x, 4x and 8x), and one variable divider (the one true
> > + * pll audio).
> > + *
> > + * We don't have any need for the variable divider for now, so we just
> > + * hardcode it to match with the clock names
> > + */
> > +#define SUN8I_A33_PLL_AUDIO_REG 0x008
> > +
> > +static SUNXI_CCU_NM_WITH_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
> > + "osc24M", 0x008,
> > + 8, 7, /* N */
> > + 0, 5, /* M */
> > + BIT(31), /* gate */
> > + BIT(28), /* lock */
> > + CLK_SET_RATE_UNGATE);
>
> Are you sure about this? I suspect CLK_SET_RATE_GATE (clk must be
> gated before set rate) is what you want, given the non-DVFS
> nature of the PLL. Same for the other PLLs.
Yes, I'm sure about it. The lock, on the A33 at least, this has to be
confirmed on other SoCs, won't work if the clock is gated.
So, every time we call clk_set_rate, we will hit the WARN_ON because
of the lock timeout unless the clock runs.
> > +static SUNXI_CCU_GATE(bus_mipi_dsi_clk, "bus-mipi-dsi", "ahb1",
> > + 0x060, BIT(1), 0);
>
> Nit: we know which bus these peripherals are on.
> Can we be more explicit with the names?
I wanted to be consistent with the datasheet, and would really prefer
to stick to it.
> > +static SUNXI_CCU_GATE(bus_ce_clk, "bus-ce", "ahb1",
> > + 0x060, BIT(5), 0);
>
> Nit: manual says Security System.
>
> (Maybe I should change the name on sun6i to say Crypto Engine
> if that's what we're going with?)
But I can't really use reject that argument there then :)
The rationale was that it's called CE in the H3 which was already
merged, but I'll change it.
> [...]
>
> > +static SUNXI_CCU_GATE(usb_hsic_12M_clk, "usb-hsic-12M", "osc24M",
> > + 0x0cc, BIT(11), 0);
>
> A TODO note saying we should have a fixed-factor-gate for this
> would be nice.
Hmmm? I'm not sure what you're saying.
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-09-05 9:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-01 14:16 [PATCH 0/6] clk: sunxi-ng: Introduce support for A23 and A33 CCUs Maxime Ripard
2016-09-01 14:16 ` [PATCH 1/6] clk: sunxi-ng: div: Add mux table macros Maxime Ripard
2016-09-02 7:25 ` Chen-Yu Tsai
2016-09-01 14:16 ` [PATCH 2/6] clk: sunxi-ng: mux: Add mux table macro Maxime Ripard
[not found] ` <20160901141617.9777-3-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-09-02 7:26 ` Chen-Yu Tsai
2016-09-01 14:16 ` [PATCH 3/6] clk: sunxi-ng: Add N-class clocks support Maxime Ripard
[not found] ` <20160901141617.9777-4-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-09-05 3:31 ` Chen-Yu Tsai
2016-09-01 14:16 ` [PATCH 4/6] clk: sunxi-ng: Add A33 CCU support Maxime Ripard
[not found] ` <20160901141617.9777-5-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-09-05 6:34 ` Chen-Yu Tsai
[not found] ` <CAGb2v66z4KMbfOr2kcNXSSXzVqXQ1uZ9p_-uNyvb_7_ACdNCqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-05 9:51 ` Maxime Ripard [this message]
2016-09-05 10:26 ` Chen-Yu Tsai
2016-09-01 14:16 ` [PATCH 5/6] clk: sunxi-ng: Add A23 CCU Maxime Ripard
2016-09-01 14:16 ` [PATCH 6/6] ARM: sun8i: Convert the A23 and A33 to the CCU 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=20160905095153.GC6322@lukather \
--to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
--cc=mylene.josserand-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@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).