linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: horms@verge.net.au (Simon Horman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 01/20] clk: shmobile: r8a7779: Add clocks support
Date: Fri, 28 Feb 2014 10:35:12 +0900	[thread overview]
Message-ID: <20140228013512.GD25134@verge.net.au> (raw)
In-Reply-To: <CAMuHMdXFVoL4pyygzys4VyYBN42KDPdohVQz6JcZn9WvuEOFEA@mail.gmail.com>

On Wed, Feb 26, 2014 at 10:06:06AM +0100, Geert Uytterhoeven wrote:
> On Wed, Feb 26, 2014 at 9:59 AM, Simon Horman <horms@verge.net.au> wrote:
> >> > +/*
> >> > + *             MD1 = 1                 MD1 = 0
> >> > + *             (PLLA = 1500)           (PLLA = 1600)
> >> > + *             (MHz)                   (MHz)
> >> > + *------------------------------------------------+--------------------
> >> > + * clkz                1000   (2/3)            800   (1/2)
> >> > + * clkzs        250   (1/6)            200   (1/8)
> >> > + * clki                 750   (1/2)            800   (1/2)
> >> > + * clks                 250   (1/6)            200   (1/8)
> >> > + * clks1        125   (1/12)           100   (1/16)
> >> > + * clks3        187.5 (1/8)            200   (1/8)
> >> > + * clks4         93.7 (1/16)           100   (1/16)
> >> > + * clkp                  62.5 (1/24)            50   (1/32)
> >> > + * clkg                  62.5 (1/24)            66.6 (1/24)
> >> > + * clkb, CLKOUT
> >> > + * (MD2 = 0)     62.5 (1/24)            66.6 (1/24)
> >> > + * (MD2 = 1)     41.6 (1/36)            50   (1/32)
> >> > + */
> >> > +
> >> > +#define CPG_CLK_CONFIG_INDEX(md)       (((md) & (BIT(1)|BIT(2))) >> 1)
> >> > +
> >> > +struct cpg_clk_config {
> >> > +       unsigned int z_mult;
> >> > +       unsigned int z_div;
> >> > +       unsigned int zs_and_s_div;
> >> > +       unsigned int s1_div;
> >> > +       unsigned int p_div;
> >> > +       unsigned int out_div;
> >> > +};
> >> > +
> >> > +static const struct cpg_clk_config cpg_clk_configs[4] __initconst = {
> >> > +       { 1, 2, 8, 16, 32, 24 },
> >> > +       { 1, 2, 8, 16, 32, 24 },
> >> > +       { 2, 3, 6, 12, 24, 36 },
> >> > +       { 2, 3, 6, 12, 24, 32 },
> >> > +};
> >>
> >> Shouldn't this be
> >>
> >> +static const struct cpg_clk_config cpg_clk_configs[4] __initconst = {
> >> +       { 1, 2, 8, 16, 32, 24 },
> >> +       { 2, 3, 6, 12, 24, 24 },
> >> +       { 1, 2, 8, 16, 32, 32 },
> >> +       { 2, 3, 6, 12, 24, 36 },
> >> +};
> >>
> >> ?
> >>
> >> I think you got confused by writing the bitmask as "BIT(1)|BIT(2)" instead
> >> of "BIT(2)|BIT(1)".
> >
> > Probably, thanks for noticing.
> 
> Note that I based my review on the table above, not on the actual datasheet.

Understood. I'll double check the datasheet against my code and your comment.

  reply	other threads:[~2014-02-28  1:35 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26  7:33 [PATCH v3 00/20] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
2014-02-26  7:33 ` [PATCH v3 01/20] clk: shmobile: r8a7779: Add clocks support Simon Horman
2014-02-26  8:05   ` Geert Uytterhoeven
2014-02-26  8:59     ` Simon Horman
2014-02-26  9:06       ` Geert Uytterhoeven
2014-02-28  1:35         ` Simon Horman [this message]
2014-02-26 12:53   ` Laurent Pinchart
2014-02-26 13:02     ` Laurent Pinchart
2014-03-12  7:55       ` Simon Horman
2014-03-12 10:12         ` Laurent Pinchart
2014-03-13  2:22           ` Simon Horman
2014-03-13  9:07             ` Laurent Pinchart
2014-03-14  0:38               ` Simon Horman
2014-03-01 13:50   ` Wolfram Sang
2014-03-01 17:33     ` Geert Uytterhoeven
2014-03-02 11:35     ` Laurent Pinchart
2014-03-02 11:51       ` Geert Uytterhoeven
2014-03-02 11:59       ` Wolfram Sang
2014-02-26  7:33 ` [PATCH v3 02/20] clk: shmobile: r8a7779: Add MSTP clock support Simon Horman
2014-02-26 12:53   ` Laurent Pinchart
2014-02-26  7:33 ` [PATCH v3 03/20] ARM: shmobile: r8a7779: Add clock index macros for DT sources Simon Horman
2014-02-26 12:56   ` Laurent Pinchart
2014-02-26  7:33 ` [PATCH v3 04/20] ARM: shmobile: r8a7779: Add clocks Simon Horman
2014-02-26  8:13   ` Geert Uytterhoeven
2014-02-26  8:55     ` Simon Horman
2014-02-26 13:15   ` Laurent Pinchart
2014-03-12  8:40     ` Simon Horman
2014-02-26 14:45   ` Laurent Pinchart
2014-03-12  8:43     ` Simon Horman
2014-03-01 14:29   ` Wolfram Sang
2014-02-26  7:33 ` [PATCH v3 05/20] ARM: shmobile: Sync Marzen DTS with Marzen reference DTS Simon Horman
2014-02-26 13:17   ` Laurent Pinchart
2014-02-26  7:33 ` [PATCH v3 06/20] ARM: shmobile: marzen: Specify external clock frequency in DT Simon Horman
2014-02-26 13:19   ` Laurent Pinchart
2014-02-26  7:33 ` [PATCH v3 07/20] ARM: shmobile: marzen: Reference clocks Simon Horman
2014-02-26 13:20   ` Laurent Pinchart
2014-02-26 15:23   ` Sergei Shtylyov
2014-03-13  0:09     ` Simon Horman
2014-02-26  7:33 ` [PATCH v3 08/20] ARM: shmobile: r8a7779: " Simon Horman
2014-02-26 13:21   ` Laurent Pinchart
2014-02-26  7:33 ` [PATCH v3 09/20] ARM: shmobile: r8a7779: Add helper to read mode pins Simon Horman
2014-02-26  7:33 ` [PATCH v3 10/20] ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c Simon Horman
2014-02-26  7:33 ` [PATCH v3 11/20] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code Simon Horman
2014-02-26  7:33 ` [PATCH v3 12/20] ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h Simon Horman
2014-02-26  7:33 ` [PATCH v3 13/20] ARM: shmobile: r8a7779: Initial multiplatform support Simon Horman
2014-02-26  7:33 ` [PATCH v3 14/20] ARM: shmobile: marzen-reference: Initialize CPG device Simon Horman
2014-02-26 13:22   ` Laurent Pinchart
2014-02-26  7:33 ` [PATCH v3 15/20] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU Simon Horman
2014-02-26  8:29   ` Geert Uytterhoeven
2014-02-26  8:56     ` Simon Horman
2014-02-26 13:24   ` Laurent Pinchart
2014-03-13  0:03     ` Simon Horman
2014-02-26  7:33 ` [PATCH v3 16/20] ARM: shmobile: marzen: Add to shmobile defconfig Simon Horman
2014-02-26  7:33 ` [PATCH v3 17/20] ARM: shmobile: Remove non-multiplatform Marzen reference support Simon Horman
2014-02-26  7:33 ` [PATCH v3 18/20] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB Simon Horman
2014-02-26  7:33 ` [PATCH v3 19/20] ARM: shmobile: Remove Marzen reference DTS Simon Horman
2014-02-26  7:33 ` [PATCH v3 20/20] ARM: shmobile: marzen-reference: Remove legacy clock support Simon Horman
2014-02-26  8:33   ` Geert Uytterhoeven
2014-02-26  8:57     ` Simon Horman

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=20140228013512.GD25134@verge.net.au \
    --to=horms@verge.net.au \
    --cc=linux-arm-kernel@lists.infradead.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).