All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Yixun Lan <yixun.lan@amlogic.com>,
	davem@davemloft.net, netdev@vger.kernel.org,
	ingrassia@epigenesys.com, linus.luessing@c0d3.blue,
	Neil Armstrong <narmstrong@baylibre.com>,
	khilman@baylibre.com, alexandre.torgue@st.com,
	linux-amlogic@lists.infradead.org, peppe.cavallaro@st.com
Subject: Re: [PATCH net-next v5 0/4] dwmac-meson8b: clock fixes for Meson8b
Date: Tue, 16 Jan 2018 18:19:32 +0100	[thread overview]
Message-ID: <1516123172.2608.96.camel@baylibre.com> (raw)
In-Reply-To: <CAFBinCBZKw04FSUBEyuQNdwbNJLjTK6y8p-MmNBHu=dLVOnKCg@mail.gmail.com>

On Tue, 2018-01-16 at 12:17 +0100, Martin Blumenstingl wrote:
> > > Hi Martin
> > > 
> > >   I'm having problem with this series applied.
> > > I've tested on the A113D (AXG) platform, if this patch is applied, the
> > > driver will choose MPLL2 as clk source, and seems it doesn't work out
> > > with this clk (fail to get IP)
> > > 
> > > grep mpll2 /sys/kernel/debug/clk/clk_summary
> > >         mpll2                              1            1   249999449
> > >       0 0
> > > 
> > 
> > This is because the fixed pll is 1992000000 on the axg instead of 2Ghz.
> 
> is there a chance that we can have a public AXG datasheet, similar to
> what Hardkernel and Khadas published for the S805, S905, S905X and
> S912?
> this would give us community developers a chance to know that we are
> going to break something on AXG *before* a patch is published (like in
> this case :( )
> 
> > As a consequence fdiv4 is 498000000.

Quick update
I have just been able measure fdiv4 and it is exactly 500Mhz
This means the the fixed_pll is actually 2GHz, as we would expect.

This also means that calculation of the fixed_pll is slightly off on the axg
platform.

Once the clock calculation is done correctly on axg, there should be no problem.

> > 
> > CCF can reach something closer to 250Mhz with the mpll2.
> > 
> > The easy way to fix this would be to make the inputs of ethernet mux optional
> > and not provide the MPLL2 on the axg.
> > 
> > However, this raises a few question on the axg platform :
> > 1) Why is the root pll 1992Mhz and not 2GHz ? seems a weird choice just for 4MHz
> > This 1992Mhz does not seems to help generate audio freqs anymore than 2GHz
> > would. I don't really get this choice. Could you help us understand Yixun ?
> > 
> > 2) Why is ethernet not working with mpll2 on axg ? espcially since we have
> > proven the rate be correct on meson8 ... is there any change on this platform we
> > don't know about ?
> 
> I tried to force my Khadas VIM2 (GXM) into using MPLL2 by changing
> meson-gxl.dtsi:
>         clocks = <&clkc CLKID_ETH>,
> -                <&clkc CLKID_FCLK_DIV2>,
> +                <&xtal>,
>                 <&clkc CLKID_MPLL2>;
> 
> the resulting clock tree looks fine:
>     fixed_pll                         4        4        0  2000000000
>         0 0
>       mpll2_div                      1        1        0   250000000
>        0 0
>          mpll2                       1        1        0   250000000
>        0 0
>             c9410000.ethernet#m250_sel       1        1        0
> 250000000          0 0
>                c9410000.ethernet#m250_div       1        1        0
> 250000000          0 0
>                   c9410000.ethernet#fixed_div2       1        1
> 0   125000000          0 0
>                      c9410000.ethernet#rgmii_tx_en       1        1
>     0   125000000          0 0
> 
> however, Ethernet is broken (I can't ping anything)
> 
> @Yixun: according to all public datasheets bit 4 is reserved
> however, Mike and Kevin were told that bit 4 controls a mux between
> FCLK_DIV2 and MPLL2
> could you please clarify the meaning of this bit 4 on:
> - Meson8b
> - Meson8m2 (a confirmation that it uses the same Ethernet registers
> with the same bits/meanings of these as Meson8b would be enough)
> - GXBB / GXL / GXM (assuming that these are using an identical IP for PRG_ETH0)
> - AXG

Indeed, if bit 4 stands for something else, or if some combination are known to
fail, it would be nice to know.

>From my point of view, the problem reported by yixun is with the clock
controller, not this series, which I think should be merged.

Still, we should clockin of the mac optional so don't have to provide the inputs
known to fail, if any.

> 
> 
> Regards
> Martin

  reply	other threads:[~2018-01-16 17:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 17:10 [PATCH net-next v5 0/4] dwmac-meson8b: clock fixes for Meson8b Martin Blumenstingl
2018-01-15 17:10 ` Martin Blumenstingl
2018-01-15 17:10 ` [PATCH net-next v5 1/4] net: stmmac: dwmac-meson8b: only configure the clocks in RGMII mode Martin Blumenstingl
2018-01-15 17:10   ` Martin Blumenstingl
2018-01-15 17:10 ` [PATCH net-next v5 2/4] net: stmmac: dwmac-meson8b: fix internal RGMII clock configuration Martin Blumenstingl
2018-01-15 17:10   ` Martin Blumenstingl
2018-01-15 17:10 ` [PATCH net-next v5 3/4] net: stmmac: dwmac-meson8b: fix setting the RGMII TX clock on Meson8b Martin Blumenstingl
2018-01-15 17:10   ` Martin Blumenstingl
2018-01-15 17:10 ` [PATCH net-next v5 4/4] net: stmmac: dwmac-meson8b: propagate rate changes to the parent clock Martin Blumenstingl
2018-01-15 17:10   ` Martin Blumenstingl
2018-01-15 22:06 ` [PATCH net-next v5 0/4] dwmac-meson8b: clock fixes for Meson8b Emiliano Ingrassia
2018-01-15 22:06   ` Emiliano Ingrassia
2018-01-16  8:25 ` Yixun Lan
2018-01-16  9:37   ` Jerome Brunet
2018-01-16 11:17     ` Martin Blumenstingl
2018-01-16 17:19       ` Jerome Brunet [this message]
2018-01-18 10:27         ` Yixun Lan
2018-01-18 10:27           ` Yixun Lan
2018-01-18 20:03           ` Martin Blumenstingl
2018-01-18 20:03             ` Martin Blumenstingl
2018-01-17 19:41 ` David Miller
2018-01-17 19:41   ` David Miller

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=1516123172.2608.96.camel@baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=ingrassia@epigenesys.com \
    --cc=khilman@baylibre.com \
    --cc=linus.luessing@c0d3.blue \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=yixun.lan@amlogic.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 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.