linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/10] net: stmmac: sunxi platfrom extensions for GMAC in Allwinner A20 SoC's
Date: Sat, 07 Dec 2013 13:50:32 +0100	[thread overview]
Message-ID: <1455361.VIrFSPex2v@flatron> (raw)
In-Reply-To: <20131207114616.GM24519@lukather>

On Saturday 07 of December 2013 12:46:16 Maxime Ripard wrote:
> On Sat, Dec 07, 2013 at 12:12:26PM +0100, Tomasz Figa wrote:
> > On Saturday 07 of December 2013 11:27:10 Maxime Ripard wrote:
> > > Chen-Yu, Mike,
> > > 
> > > On Sat, Dec 07, 2013 at 01:29:37AM +0800, Chen-Yu Tsai wrote:
> > > > The Allwinner A20 has an ethernet controller that seems to be
> > > > an early version of Synopsys DesignWare MAC 10/100/1000 Universal,
> > > > which is supported by the stmmac driver.
> > > > 
> > > > Allwinner's GMAC requires setting additional registers in the SoC's
> > > > clock control unit.
> > > > 
> > > > The exact version of the DWMAC IP that Allwinner uses is unknown,
> > > > thus the exact feature set is unknown.
> > > > 
> > > > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > > > ---
> > > >  .../bindings/net/allwinner,sun7i-gmac.txt          | 22 +++++++
> > > >  drivers/net/ethernet/stmicro/stmmac/Kconfig        | 12 ++++
> > > >  drivers/net/ethernet/stmicro/stmmac/Makefile       |  1 +
> > > >  drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c  | 76 ++++++++++++++++++++++
> > > >  drivers/net/ethernet/stmicro/stmmac/stmmac.h       |  3 +
> > > >  .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |  3 +
> > > >  6 files changed, 117 insertions(+)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/net/allwinner,sun7i-gmac.txt b/Documentation/devicetree/bindings/net/allwinner,sun7i-gmac.txt
> > > > new file mode 100644
> > > > index 0000000..271554a
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/net/allwinner,sun7i-gmac.txt
> > > > @@ -0,0 +1,22 @@
> > > > +* Allwinner GMAC ethernet controller
> > > > +
> > > > +This device is a platform glue layer for stmmac.
> > > > +Please see stmmac.txt for the other unchanged properties.
> > > > +
> > > > +Required properties:
> > > > + - compatible:  Should be "allwinner,sun7i-gmac"
> > > 
> > > Please use sun7i-a20-gmac here.
> > > 
> > > > + - reg: Address and length of register set for the device and corresponding
> > > > +   clock control
> > > >
> > > > +Examples:
> > > > +
> > > > +	gmac: ethernet at 01c50000 {
> > > > +		compatible = "allwinner,sun7i-gmac";
> > > > +		reg = <0x01c50000 0x10000>,
> > > > +		      <0x01c20164 0x4>;
> > > 
> > > This is actually a clock, and should probably be registered in the
> > > common clock framework.
> > > 
> > > Mike: This small register actually is a regular muxer/divider, except
> > > that it has some bits that are of interest to the ethernet controller
> > > (for example to set wether it's using GMII or RGMII to communicate
> > > with the phy), that, as far as I'm aware of, aren't really fitting
> > > into the CCF.
> > > 
> > > Do you have some recommendation on how to proceed?
> > > 
> > > Maybe make a thin "real" clock driver in this hardware glue, that
> > > provides !exported function to set this *GMII thing.
> > 
> > Is this register part of a bigger IP block that manages clocks for other
> > IP blocks than stmmac as well? If not, I don't see a point of exporting
> > a clock from inside of the GMAC "domain" just to feed it back into it
> > as the only user.
> 
> This register is actually part of the SoC clock controller. So it sits
> right beside the other clocks registers controlling the clocks of the
> other devices, and is not part of the GMAC IP itself.

Is there any description for GMAC_IF_TYPE_RGMII and GMAC_TX_CLK fields?

Name of the latter sounds like a normal clock mux, but the former is
just a mystery (especially why it is a part of the clock controller).

Best regards,
Tomasz

  reply	other threads:[~2013-12-07 12:50 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06 17:29 [PATCH 00/10] net: stmmac: Add sun7i GMAC glue layer Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 01/10] net: stmmac: Enable stmmac main clock when probing hardware Chen-Yu Tsai
2013-12-07 10:33   ` Maxime Ripard
2013-12-09  2:43     ` Chen-Yu Tsai
2013-12-09 10:09       ` [linux-sunxi] " Hans de Goede
2013-12-10 20:05       ` Maxime Ripard
2013-12-12  4:31         ` Chen-Yu Tsai
2013-12-09  7:14   ` Giuseppe CAVALLARO
2013-12-09  7:26     ` Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 02/10] net: stmmac: Honor DT parameter to force DMA store and forward mode Chen-Yu Tsai
2013-12-06 21:26   ` David Miller
2013-12-07  1:23     ` Chen-Yu Tsai
2013-12-07 10:07       ` maxime.ripard
2013-12-07 11:06         ` Tomasz Figa
2013-12-09  2:59           ` [linux-sunxi] " Chen-Yu Tsai
2013-12-10 20:10             ` maxime.ripard
2013-12-06 17:29 ` [PATCH 03/10] net: stmmac: Use platform data tied with compatible strings Chen-Yu Tsai
2013-12-06 21:26   ` David Miller
2013-12-07  2:13     ` Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 04/10] net: stmmac: sunxi platfrom extensions for GMAC in Allwinner A20 SoC's Chen-Yu Tsai
2013-12-07 10:27   ` Maxime Ripard
2013-12-07 11:12     ` Tomasz Figa
2013-12-07 11:46       ` Maxime Ripard
2013-12-07 12:50         ` Tomasz Figa [this message]
2013-12-07 13:34           ` [linux-sunxi] " Emilio López
2013-12-09 11:10   ` srinivas kandagatla
2013-12-09 16:16     ` [linux-sunxi] " Hans de Goede
2013-12-09 17:56       ` Chen-Yu Tsai
2013-12-09 19:04         ` Hans de Goede
2013-12-10 20:14           ` Maxime Ripard
2013-12-09 17:34     ` Chen-Yu Tsai
2013-12-10 14:59       ` srinivas kandagatla
2013-12-10 20:23         ` Maxime Ripard
2013-12-11 12:17         ` Chen-Yu Tsai
2013-12-11 14:45           ` srinivas kandagatla
2013-12-12  7:27             ` Chen-Yu Tsai
2013-12-12  9:04             ` Maxime Ripard
2013-12-12 10:31               ` Chen-Yu Tsai
2013-12-13 10:38                 ` Maxime Ripard
2013-12-24  3:27                   ` [linux-sunxi] " Chen-Yu Tsai
2014-01-02 13:11                     ` srinivas kandagatla
2014-01-07 10:24                       ` Chen-Yu Tsai
2013-12-09 11:21   ` srinivas kandagatla
2013-12-09 13:44     ` Sergei Shtylyov
2013-12-09 15:45       ` [linux-sunxi] " Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 05/10] ARM: dts: sun7i: Add GMAC controller node to sun7i DTSI Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 06/10] ARM: dts: sun7i: Add pin muxing options for the GMAC Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 07/10] ARM: dts: sun7i: cubietruck: Enable " Chen-Yu Tsai
2013-12-06 21:09   ` Florian Fainelli
2013-12-07  1:35     ` Chen-Yu Tsai
2013-12-07  1:57       ` Florian Fainelli
2013-12-09  2:55         ` Chen-Yu Tsai
2013-12-09 17:48           ` Florian Fainelli
2013-12-10  4:11             ` Chen-Yu Tsai
2013-12-10 17:23               ` Florian Fainelli
2013-12-13 10:21         ` Giuseppe CAVALLARO
2013-12-06 17:29 ` [PATCH 08/10] ARM: dts: sun7i: cubieboard2: Enable GMAC instead of EMAC Chen-Yu Tsai
2013-12-06 21:10   ` Florian Fainelli
2013-12-06 17:29 ` [PATCH 09/10] ARM: dts: sun7i: olinuxino-micro: " Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 10/10] ARM: dts: sun7i: Add ethernet alias for GMAC Chen-Yu Tsai
2013-12-07 10:15   ` Maxime Ripard
2013-12-07 16:20     ` Chen-Yu Tsai
2013-12-06 20:52 ` [linux-sunxi] [PATCH 00/10] net: stmmac: Add sun7i GMAC glue layer Michal Suchanek

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=1455361.VIrFSPex2v@flatron \
    --to=tomasz.figa@gmail.com \
    --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).