mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Neil Armstrong <narmstrong@baylibre.com>
Subject: Re: [PATCH 1/3] clk: meson: mpll: properly handle spread spectrum
Date: Sat, 30 Mar 2019 00:07:53 +0100	[thread overview]
Message-ID: <3bef1bb26e9eff0cfc20cd4bb78a5d7cea4c5076.camel@baylibre.com> (raw)
In-Reply-To: <CAFBinCDnoY41ZcoHqsngR4WTeczkmOu93R=2G_JOXbdUmHSjMw@mail.gmail.com>

On Fri, 2019-03-29 at 20:39 +0100, Martin Blumenstingl wrote:
> Hi Jerome,
> 
> On Fri, Mar 29, 2019 at 4:34 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
> > The bit 'SSEN' available on some MPLL DSS outputs is not related to the
> > fractional part of the divider but to the function called
> > 'Spread Spectrum'.
> > 
> > This function might be used to solve EM issues by adding a jitter on
> > clock signal. This widens the signal spectrum and weakens the peaks in it.
> > 
> > While spread spectrum might be useful for some application, it is
> > problematic for others, such as audio.
> > 
> > This patch introduce a new flag to the MPLL driver to enable (or not) the
> > spread spectrum function.
> > 
> > Fixes: 1f737ffa13ef ("clk: meson: mpll: fix mpll0 fractional part ignored")
> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > ---
> >  drivers/clk/meson/clk-mpll.c | 9 ++++++---
> >  drivers/clk/meson/clk-mpll.h | 1 +
> >  2 files changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/clk/meson/clk-mpll.c b/drivers/clk/meson/clk-mpll.c
> > index 64d31c8ba3d0..2d39a8bc367c 100644
> > --- a/drivers/clk/meson/clk-mpll.c
> > +++ b/drivers/clk/meson/clk-mpll.c
> > @@ -141,9 +141,12 @@ static void mpll_init(struct clk_hw *hw)
> >         /* Enable the fractional part */
> >         meson_parm_write(clk->map, &mpll->sdm_en, 1);
> > 
> > -       /* Set additional fractional part enable if required */
> > -       if (MESON_PARM_APPLICABLE(&mpll->ssen))
> > -               meson_parm_write(clk->map, &mpll->ssen, 1);
> > +       /* Set spread spectrum if possible */
> > +       if (MESON_PARM_APPLICABLE(&mpll->ssen)) {
> > +               unsigned int ss =
> > +                       mpll->flags & CLK_MESON_MPLL_SPREAD_SPECTRUM ? 1 : 0;
> > +               meson_parm_write(clk->map, &mpll->ssen, ss);
> > +       }
> this changes the "ssen" flag on all supported clocks from 1 (before
> this patch) to 0 (after this patch).
> is this on purpose and how does it affect existing clocks?

Yes, none of our application require spread spectrum

The fact is that only 2 MPLL had this bit, mpll0 on gx (without effect) and
mpll0 on axg: actually spread spectrum impacts mpll2, making it unusable, as
explained in the related patch

> 
> based on the original commit 1f737ffa13ef ("clk: meson: mpll: fix
> mpll0 fractional part ignored") it seems that
> CLK_MESON_MPLL_SPREAD_SPECTRUM should be set for mpll0 (at least on
> GXBB and Meson8b)
> 

There a patch specifically targeting gxbb.
I have checked on GXL and this bit had no effect (fractional part still on, no
spread spectrum)

So either we fixed something since then or I messed up when doing the patch
initially.

Feel free to cross check

> 
> Martin



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2019-03-29 23:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29 15:33 [PATCH 0/3] clk: meson: fix mpll jitter Jerome Brunet
2019-03-29 15:33 ` [PATCH 1/3] clk: meson: mpll: properly handle spread spectrum Jerome Brunet
2019-03-29 19:39   ` Martin Blumenstingl
2019-03-29 23:07     ` Jerome Brunet [this message]
2019-03-30 15:56       ` Martin Blumenstingl
2019-04-01  8:40         ` Jerome Brunet
2019-04-01 17:13           ` Martin Blumenstingl
2019-03-29 15:33 ` [PATCH 2/3] clk: meson: gxbb: no spread spectrum on mpll0 Jerome Brunet
2019-03-29 15:33 ` [PATCH 3/3] clk: meson: axg: spread spectrum is on mpll2 Jerome Brunet
2019-03-30 15:58 ` [PATCH 0/3] clk: meson: fix mpll jitter Martin Blumenstingl
2019-04-01  8:40   ` Jerome Brunet

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=3bef1bb26e9eff0cfc20cd4bb78a5d7cea4c5076.camel@baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    /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

all inboxes | Powered by JetHome®