All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	linux-clk <linux-clk@vger.kernel.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH v2] clk: renesas: cpg-mssr: add common R-Car Gen2 support
Date: Wed, 2 Nov 2016 16:30:21 +0300	[thread overview]
Message-ID: <3ec05522-108c-64df-de6b-1329c78ce9e0@cogentembedded.com> (raw)
In-Reply-To: <CAMuHMdWZ4uCMinq_RbmimH0Gz72a51ac0sCoBMZo97x2mGyJLQ@mail.gmail.com>

Hello.

On 11/02/2016 02:08 PM, Geert Uytterhoeven wrote:

>> Add the common R-Car  Gen2 (and RZ/G) Clock Pulse Generator / Module Standby
>> and Software Reset support code, using the CPG/MSSR driver core.
>>
>> Based on the proof-of-concept R8A7791 CPG/MSSR patch by Geert Uytterhoeven
>> <geert+renesas@glider.be>.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>
>> ---
>> This patch is against the 'clk-next' branch of CLK group's 'linux.git' repo.
>>
>> Changes in version 2:
>> - added support  for non-existing PLL0CR;
>> - removed the function reading the mode pins;
>> - added/used the #define's for PLL0CR.STC;
>> - used CPG_FRQCRC_ZFC_SHIFT to #define CPG_FRQCRC_ZFC_MASK;
>> - removed rcar_gen2_read_modemr();
>> - added Geert's tag.
>>
>>  drivers/clk/renesas/rcar-gen2-cpg.c |  369 ++++++++++++++++++++++++++++++++++++
>>  drivers/clk/renesas/rcar-gen2-cpg.h |   42 ++++
>>  2 files changed, 411 insertions(+)
>>
>> Index: linux/drivers/clk/renesas/rcar-gen2-cpg.c
>> ===================================================================
>> --- /dev/null
>> +++ linux/drivers/clk/renesas/rcar-gen2-cpg.c
>> @@ -0,0 +1,369 @@
>
>> +struct clk * __init rcar_gen2_cpg_clk_register(struct device *dev,
>> +                                              const struct cpg_core_clk *core,
>> +                                              const struct cpg_mssr_info *info,
>> +                                              struct clk **clks,
>> +                                              void __iomem *base)
>> +{
>
>> +       case CLK_TYPE_GEN2_PLL0:
>> +               /*
>> +                * PLL0  is a configurable multiplier clock except on  R-Car E2.
>
> ... and V2H.

    Indeed. But at least on E2 PLL0CR.STC can be read...

>> +                * Register the PLL0 clock as a fixed factor clock for now as
>> +                * there's  no generic multiplier clock implementation and we
>> +                * currently have no need to change the multiplier value.
>> +                */
>> +               mult = cpg_pll_config->pll0_mult;
>> +               if (mult) {
>> +                       /* PLL0 is VCO/3 on R-Car E2 */
>
> ... and V2H.

    No, it's still VCO/2 on V2H, according to the manual. Perhaps I'll have to 
store the PLL0 divisor separately (and maybe even instead of the PLL0 multiplier).

>> +                       div  = 3;
>> +               } else  {
>> +                       u32 pll0cr = readl(base + CPG_PLL0CR);
>> +
>> +                       mult = ((pll0cr & CPG_PLL0CR_STC_MASK) >>
>> +                               CPG_PLL0CR_STC_SHIFT) + 1;
>> +               }
>
> Looks OK to me. I assume you've verified the Z2 clock frequency in
> /sys/kernel/debug/clk/clk_summary?

    Not yet. :-/

> Gr{oetje,eeting}s,
>
>                         Geert

MBR, Sergei

  parent reply	other threads:[~2016-11-02 13:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05 20:50 [PATCH 0/3] Renesas R8A7743 CPG/MSSR clock support Sergei Shtylyov
2016-10-05 20:50 ` Sergei Shtylyov
2016-10-05 20:52 ` [PATCH 1/3] clk: renesas: cpg-mssr: add common R-Car Gen2 support Sergei Shtylyov
2016-10-19  8:57   ` Geert Uytterhoeven
2016-10-26 12:17   ` Geert Uytterhoeven
2016-10-05 20:54 ` [PATCH 2/3] ARM: shmobile: r8a7743: add CPG clock index macros Sergei Shtylyov
2016-10-07 19:06   ` Sergei Shtylyov
2016-10-07 19:06   ` Sergei Shtylyov
2016-10-07 19:35     ` Geert Uytterhoeven
2016-10-05 20:55 ` [PATCH 3/3] clk: renesas: cpg-mssr: add R8A7743 support Sergei Shtylyov
2016-10-07 20:35 ` [PATCH 0/3] Renesas R8A7743 CPG/MSSR clock support Sergei Shtylyov
2016-10-27 19:53 ` [PATCH v2] clk: renesas: cpg-mssr: add common R-Car Gen2 support Sergei Shtylyov
2016-11-02 11:08   ` Geert Uytterhoeven
2016-11-02 11:38     ` Geert Uytterhoeven
2016-11-02 18:11       ` Sergei Shtylyov
2016-11-02 18:19         ` Geert Uytterhoeven
2016-11-02 18:19           ` Geert Uytterhoeven
2016-11-02 18:26           ` Sergei Shtylyov
2016-11-02 13:30     ` Sergei Shtylyov [this message]
2016-11-02 21:51 ` [PATCH v3] " Sergei Shtylyov
2016-11-03 20:48 ` [PATCH v3 RESEND] " Sergei Shtylyov
2016-11-08 21:17 ` [PATCH v4] " Sergei Shtylyov
2016-11-10 12:50   ` Geert Uytterhoeven

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=3ec05522-108c-64df-de6b-1329c78ce9e0@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.