Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
To: Andrew Bresticker <abrestic@chromium.org>
Cc: Linux-MIPS <linux-mips@linux-mips.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Mike Turquette <mturquette@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	James Hartley <james.hartley@imgtec.com>,
	Govindraj Raja <Govindraj.Raja@imgtec.com>,
	Damien Horsley <Damien.Horsley@imgtec.com>,
	Kevin Cernekee <cernekee@chromium.org>,
	James Hogan <james.hogan@imgtec.com>
Subject: Re: [PATCH 7/9] clk: pistachio: Add a rate table for the MIPS PLL
Date: Fri, 22 May 2015 14:45:13 -0300	[thread overview]
Message-ID: <555F6B29.8030208@imgtec.com> (raw)
In-Reply-To: <CAL1qeaHQjtVBNN8OB3TDLKSD9WszTQ2n+RwhoK-PMhtUAQYYtA@mail.gmail.com>



On 05/22/2015 02:45 PM, Andrew Bresticker wrote:
> On Thu, May 21, 2015 at 4:57 PM, Ezequiel Garcia
> <ezequiel.garcia@imgtec.com> wrote:
>> This commit adds a rate parameter table, which makes it possible for
>> the MIPS PLL to support rate change.
>>
>> Signed-off-by: Govindraj Raja <Govindraj.Raja@imgtec.com>
>> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
>> ---
>>  drivers/clk/pistachio/clk-pistachio.c | 12 +++++++++++-
>>  drivers/clk/pistachio/clk.h           | 12 ++++++++++++
>>  2 files changed, 23 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/pistachio/clk-pistachio.c b/drivers/clk/pistachio/clk-pistachio.c
>> index 22a7ebd..0ac7429 100644
>> --- a/drivers/clk/pistachio/clk-pistachio.c
>> +++ b/drivers/clk/pistachio/clk-pistachio.c
>> @@ -145,8 +145,18 @@ static struct pistachio_mux pistachio_muxes[] __initdata = {
>>         MUX(CLK_BT_PLL_MUX, "bt_pll_mux", mux_xtal_bt, 0x200, 17),
>>  };
>>
>> +static struct pistachio_pll_rate_table mips_pll_rates[] = {
>> +       MIPS_PLL_RATES(52000000, 416000000, 1, 16, 2, 1),
>> +       MIPS_PLL_RATES(52000000, 442000000, 1, 17, 2, 1),
>> +       MIPS_PLL_RATES(52000000, 468000000, 1, 18, 2, 1),
>> +       MIPS_PLL_RATES(52000000, 494000000, 1, 19, 2, 1),
>> +       MIPS_PLL_RATES(52000000, 520000000, 1, 20, 2, 1),
>> +       MIPS_PLL_RATES(52000000, 546000000, 1, 21, 2, 1),
>> +};
>> +
>>  static struct pistachio_pll pistachio_plls[] __initdata = {
>> -       PLL_FIXED(CLK_MIPS_PLL, "mips_pll", "xtal", PLL_GF40LP_LAINT, 0x0),
>> +       PLL(CLK_MIPS_PLL, "mips_pll", "xtal", PLL_GF40LP_LAINT, 0x0,
>> +           mips_pll_rates),
>>         PLL_FIXED(CLK_AUDIO_PLL, "audio_pll", "audio_refclk_mux",
>>                   PLL_GF40LP_FRAC, 0xc),
>>         PLL_FIXED(CLK_RPU_V_PLL, "rpu_v_pll", "xtal", PLL_GF40LP_LAINT, 0x20),
>> diff --git a/drivers/clk/pistachio/clk.h b/drivers/clk/pistachio/clk.h
>> index 3bb6bbe..b5d22d6 100644
>> --- a/drivers/clk/pistachio/clk.h
>> +++ b/drivers/clk/pistachio/clk.h
>> @@ -121,6 +121,18 @@ struct pistachio_pll_rate_table {
>>         unsigned int frac;
>>  };
>>
>> +#define MIPS_PLL_RATES(_fref, _fout, _refdiv, _fbdiv,  \
>> +                      _postdiv1, _postdiv2)            \
>> +{                                                       \
>> +       .fref           = _fref,                        \
>> +       .fout           = _fout,                        \
>> +       .refdiv         = _refdiv,                      \
>> +       .fbdiv          = _fbdiv,                       \
>> +       .postdiv1       = _postdiv1,                    \
>> +       .postdiv2       = _postdiv2,                    \
>> +       .frac           = 0,                            \
>> +}
> 
> Wouldn't this be applicable to any integer PLL, not just MIPS_PLL?
> Also, maybe we should just populate fout_{min,max} here, setting them
> to _fout?  See my comment in patch 3/9.
> 

Yes, you are right. An INT_PLL_RATE would be OK, setting frac to 0 and
fout_{min,max} to fout.

I'll respin.
-- 
Ezequiel

  reply	other threads:[~2015-05-22 17:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 23:57 [PATCH 0/9] clk: pistachio: Assorted changes Ezequiel Garcia
2015-05-21 23:57 ` Ezequiel Garcia
2015-05-21 23:57 ` [PATCH 1/9] clk: pistachio: Add a pll_lock() helper for clarity Ezequiel Garcia
2015-05-21 23:57   ` Ezequiel Garcia
2015-05-21 23:57 ` [PATCH 2/9] clk: pistachio: Lock the PLL when enabled upon rate change Ezequiel Garcia
2015-05-21 23:57   ` Ezequiel Garcia
2015-05-21 23:57 ` [PATCH 3/9] clk: pistachio: Implement PLL rate adjustment Ezequiel Garcia
2015-05-21 23:57   ` Ezequiel Garcia
2015-05-22 17:04   ` Andrew Bresticker
2015-05-21 23:57 ` [PATCH 4/9] clk: pistachio: Extend DIV_F to pass clk_flags as well Ezequiel Garcia
2015-05-21 23:57   ` Ezequiel Garcia
2015-05-22 17:05   ` Andrew Bresticker
2015-05-21 23:57 ` [PATCH 5/9] clk: pistachio: Add a MUX_F macro to pass clk_flags Ezequiel Garcia
2015-05-21 23:57   ` Ezequiel Garcia
2015-05-22 17:07   ` Andrew Bresticker
2015-05-21 23:57 ` [PATCH 6/9] clk: pistachio: Propagate rate changes in the MIPS PLL clock sub-tree Ezequiel Garcia
2015-05-21 23:57   ` Ezequiel Garcia
2015-05-22 17:42   ` Andrew Bresticker
2015-05-22 17:52     ` Ezequiel Garcia
2015-05-22 18:07       ` Andrew Bresticker
2015-05-21 23:57 ` [PATCH 7/9] clk: pistachio: Add a rate table for the MIPS PLL Ezequiel Garcia
2015-05-21 23:57   ` Ezequiel Garcia
2015-05-22 17:45   ` Andrew Bresticker
2015-05-22 17:45     ` Ezequiel Garcia [this message]
2015-05-21 23:57 ` [PATCH 8/9] clk: pistachio: Add sanity checks on PLL configuration Ezequiel Garcia
2015-05-21 23:57   ` Ezequiel Garcia
2015-05-22 17:48   ` Andrew Bresticker
2015-05-21 23:57 ` [PATCH 9/9] clk: pistachio: Correct critical clock list Ezequiel Garcia
2015-05-21 23:57   ` Ezequiel Garcia
2015-05-22 17:56   ` Andrew Bresticker
2015-05-22 17:54     ` Ezequiel Garcia

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=555F6B29.8030208@imgtec.com \
    --to=ezequiel.garcia@imgtec.com \
    --cc=Damien.Horsley@imgtec.com \
    --cc=Govindraj.Raja@imgtec.com \
    --cc=abrestic@chromium.org \
    --cc=cernekee@chromium.org \
    --cc=james.hartley@imgtec.com \
    --cc=james.hogan@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mturquette@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox