public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@baylibre•com>
To: Michael Turquette <mturquette@baylibre•com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail•com>,
	"Carlo Caione" <carlo@caione•org>,
	linux-amlogic@lists•infradead.org, mark.rutland@arm•com,
	robh+dt@kernel•org, netdev@vger•kernel.org,
	peppe.cavallaro@st•com
Subject: Re: [PATCH RFC 3/3] ARM64: dts: meson-gxbb: use the new meson8b DWMAC glue
Date: Wed, 13 Jul 2016 14:22:33 -0700	[thread overview]
Message-ID: <m2shvd5j3a.fsf@baylibre.com> (raw)
In-Reply-To: <146844367410.73491.117379762912178421@resonance> (Michael Turquette's message of "Wed, 13 Jul 2016 14:01:14 -0700")

Michael Turquette <mturquette@baylibre•com> writes:

> Hi Martin,
>
> Quoting Martin Blumenstingl (2016-06-27 04:33:49)
>> On Mon, Jun 27, 2016 at 12:44 PM, Martin Blumenstingl
>> <martin.blumenstingl@googlemail•com> wrote:
>> > On Mon, Jun 27, 2016 at 11:24 AM, Carlo Caione <carlo@caione•org> wrote:
>> >> A syscon is a region containing a set of miscellaneous registers used
>> >> for several reasons by several devices [1]. It this case there is really
>> >> no need to define a new syscon node since those two registers are only
>> >> used by your driver.
>> > I can easily change it back if that's the way to go.
>> > Before I do that: could you please confirm that "mp2_clk_out" (which
>> > is controlled by PRG_ETH0/offset 0x0 bits 7-9) is not something which
>> > has to be available through the common clk framework?
>> there was just an IRC discussion with Carlo on this topic:
>> We tried to find whether PRG_ETH0 is used to actually configure
>> "mp2_clk_out". Carlo brought up that it could also be the case that
>> the ethernet block simply needs to be informed about the rate of the
>> mp2_clk_out (which is *probably* the "mpll2" clock).
>> 
>> I'm adding Michael Turquette to this mail, maybe you can comment on this topic.
>> 
>> If it turns out that the etthernet block just has to know about the
>> clock rate then we have two tasks:
>> 1. identify why the mpll2 rate returns 0 on my GXBB device
>
> This is in progress, but turns out it doesn't matter for Ethernet. Bit 4
> in PRG_ETHERNET_ADDR0 control a mux clock inside of the Ethernet
> controller.
>
> A value of 0x0 selects fclk_div2 and a value of 0x1 selects mp2_clk_out.
> The bootloader programs in sets the mux to zero, or fclk_div2 as the
> input clock (which runs at 1GHz).
>
>> 2. change my patch so the new DWMAC glue gets a reference to the mpll2
>> clock and then use "clk_get_rate(mpll2) / (250 * 1000000)" to
>> configure the PRG_ETH0_MP2_CLK bits.
>
> Hmm, I'm not sure about that part. Bits 7-9 is a divider that further
> divides the clock signal selected by bit 4. This is set to 0x4, which
> means we divide the 1GHz fclk_div2 down to 250MHz, which seems to be the
> expected value coming out of this divider.
>
> I haven't looked further to see if there is a further programmable
> divider to divide 250MHz down to 50MHz, or (more likely) there is simply
> a fixed-factor divide-by-5 that results in the 50MHz rate consumed by
> the PHY.
>
> Modeling this all in the mmc driver makes sense. So we would have:
>
> struct clk_mux clk_m250_sel ->
> 	struct clk_divider clk_m250_div ->
> 		struct clk_fixed_factor enet_phy_clk

There's also bit 10: "Generate 25MHz clock for PHY" (which is set to 1
by the bootloaders on P200 and odroidc2)

This suggests that it might not be a fixed-factor divide-by-5 but a
choice between a divide-by-5 and a divide-by-10 for the PHY clock.

Kevin

  reply	other threads:[~2016-07-13 21:22 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-25 16:50 [RFC] meson: add support for configuring the ethernet clocks Martin Blumenstingl
2016-06-25 16:50 ` [PATCH RFC 1/3] net: dt-bindings: add the amlogic,meson8b-dwmac binding Martin Blumenstingl
2016-06-25 16:50 ` [PATCH RFC 2/3] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
2016-06-25 16:50 ` [PATCH RFC 3/3] ARM64: dts: meson-gxbb: use the new meson8b DWMAC glue Martin Blumenstingl
2016-06-27  9:24   ` Carlo Caione
2016-06-27 10:44     ` Martin Blumenstingl
2016-06-27 11:33       ` Martin Blumenstingl
2016-07-13 21:01         ` Michael Turquette
2016-07-13 21:22           ` Kevin Hilman [this message]
2016-08-15 16:40 ` [PATCH 0/3] ARM64: meson: Meson8b and GXBB DWMAC glue driver Martin Blumenstingl
2016-08-15 16:40   ` [PATCH 1/3] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
2016-08-16 14:25     ` Rob Herring
2016-08-15 16:40   ` [PATCH 2/3] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
2016-08-19 21:40     ` Kevin Hilman
2016-08-15 16:41   ` [PATCH 3/3] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl
2016-08-20  9:35   ` [PATCH v2 0/4] meson: Meson8b and " Martin Blumenstingl
2016-08-20  9:35     ` [PATCH v2 1/4] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
     [not found]       ` <20160820093538.9707-2-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-22 11:55         ` Arnd Bergmann
2016-08-22 12:04           ` Martin Blumenstingl
2016-08-22 15:25             ` Arnd Bergmann
2016-08-28 16:15               ` Martin Blumenstingl
2016-08-29 13:31                 ` Arnd Bergmann
2016-08-20  9:35     ` [PATCH v2 2/4] clk: gxbb: expose MPLL2 clock for use by DT Martin Blumenstingl
2016-08-20  9:35     ` [PATCH v2 3/4] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
2016-08-20 21:29       ` Joachim Eastwood
     [not found]         ` <CAGhQ9VyWs=sYg7PVrt5r-fM-2t--qAnHyvNXAZXwjkYn5P196g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-21 12:00           ` Martin Blumenstingl
     [not found]     ` <20160820093538.9707-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-20  9:35       ` [PATCH v2 4/4] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl
2016-08-28 16:16     ` [PATCH v3 0/5] meson: Meson8b and " Martin Blumenstingl
2016-08-28 16:16       ` [PATCH v3 2/5] clk: gxbb: expose MPLL2 clock for use by DT Martin Blumenstingl
     [not found]       ` <20160828161637.9941-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-28 16:16         ` [PATCH v3 1/5] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
2016-08-28 16:16         ` [PATCH v3 3/5] stmmac: introduce get_stmmac_bsp_priv() helper Martin Blumenstingl
2016-08-28 16:16       ` [PATCH v3 4/5] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
2016-08-30 19:19         ` Stephen Boyd
     [not found]           ` <20160830191906.GD12510-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-09-04 18:20             ` Martin Blumenstingl
     [not found]               ` <CAFBinCCVUhUVyceGc2capcCPOK8MTsn+RcC9gnrtMVvZUENXtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-05  9:27                 ` Arnd Bergmann
2016-08-28 16:16       ` [PATCH v3 5/5] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl
2016-08-29  3:40       ` [PATCH v3 0/5] meson: Meson8b and " David Miller
2016-08-30 18:49         ` Martin Blumenstingl
     [not found]           ` <CAFBinCCmg-+8mjd0Xc5c7bEWL9_S_4kizs_UMiiW9ATBH_G8iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-31  4:57             ` David Miller
2016-09-02  4:23               ` Kevin Hilman
2016-09-02  5:37                 ` David Miller
2016-09-02  8:50                   ` Arnd Bergmann
2016-09-04 18:23       ` [PATCH v4 " Martin Blumenstingl
2016-09-04 18:23         ` [PATCH v4 1/5] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
2016-09-04 18:23         ` [PATCH v4 2/5] clk: gxbb: expose MPLL2 clock for use by DT Martin Blumenstingl
2016-09-04 18:23         ` [PATCH v4 3/5] stmmac: introduce get_stmmac_bsp_priv() helper Martin Blumenstingl
     [not found]         ` <20160904182320.671-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-09-04 18:23           ` [PATCH v4 4/5] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
     [not found]             ` <20160904182320.671-5-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-09-05  1:37               ` kbuild test robot
2016-09-05 10:53                 ` Arnd Bergmann
2016-09-05 19:07                   ` Martin Blumenstingl
2016-09-06  9:37                     ` Arnd Bergmann
2016-09-05  1:43             ` kbuild test robot
2016-09-06 21:38           ` [PATCH v5 0/6] meson: Meson8b and GXBB DWMAC glue driver Martin Blumenstingl
2016-09-06 21:38             ` [PATCH v5 1/6] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
     [not found]             ` <20160906213848.17785-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-09-06 21:38               ` [PATCH v5 2/6] clk: gxbb: expose MPLL2 clock for use by DT Martin Blumenstingl
2016-09-07 21:27                 ` Stephen Boyd
2016-09-06 21:38               ` [PATCH v5 3/6] stmmac: introduce get_stmmac_bsp_priv() helper Martin Blumenstingl
2016-09-06 21:38               ` [PATCH v5 4/6] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
2016-09-06 21:38             ` [PATCH v5 5/6] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl
2016-09-06 21:38             ` [PATCH v5 6/6] net: stmmac: update the module description of the dwmac-meson driver Martin Blumenstingl
2016-09-04 18:23         ` [PATCH v4 5/5] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl

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=m2shvd5j3a.fsf@baylibre.com \
    --to=khilman@baylibre$(echo .)com \
    --cc=carlo@caione$(echo .)org \
    --cc=linux-amlogic@lists$(echo .)infradead.org \
    --cc=mark.rutland@arm$(echo .)com \
    --cc=martin.blumenstingl@googlemail$(echo .)com \
    --cc=mturquette@baylibre$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=peppe.cavallaro@st$(echo .)com \
    --cc=robh+dt@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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