devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Matt Sealey <neko-HhXTZounMxbZATc7fWT8Dg@public.gmane.org>
Subject: Re: device tree binding documentation outdated
Date: Thu, 3 Oct 2013 00:49:11 +0100	[thread overview]
Message-ID: <20131002234911.GD12758@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20131002193316.GR12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>

On Wed, Oct 02, 2013 at 08:33:16PM +0100, Russell King - ARM Linux wrote:
> On Sun, Sep 29, 2013 at 02:13:05PM +0800, Shawn Guo wrote:
> > On Sat, Sep 28, 2013 at 09:38:59AM +0100, Russell King - ARM Linux wrote:
> > > Okay, the answer is that yes, GPR1 bit 21 should be clear on this version
> > > of the hardware, but there's plans to have the IMX6 generate the clock
> > > and remove the crystal for the AR8035.
> > 
> > Be careful, as mentioned in the reply to Matt, in that case, IMX6 can
> > only output the clock on pad GPIO_16, and the clock has to be externally
> > routed back to IMX6 on pad ENET_REF_CLK, so that ENET can get reference
> > clock for RGMII mode.
> 
> Let me repeat that in case it was unclear.
> 
> The AR8035 on the current boards has a 25MHz crystal, and the AR8035 is
> *currently* required to be programmed to generate a 125MHz clock back to
> the IMX6 for the transmit timings.
> 
> In future, and on the real cubox-i, this crystal will not be present, and
> it will be required that the IMX6 generates the 25MHz clock for the
> AR8035.
> 
> So, for the _existing_ hardware, it is _required_ that the AR8035
> generates the transmit clock, and this is fed in on GPIO 16 as
> ENET_REF_CLK.  This means that SION for this *must* be set and
> GPR1 bit 21 *must* be clear.

Okay, I think I'm getting to the bottom of this.

RGMII mode.

In current hardware, the phy has its own 25MHz crystal.  This provides
the phy with its clocks, and the phy itself contains a PLL, which it
uses to generate 125MHz.

The phy can be (and is) configured to generate this 125MHz clock on
the CLK_25M pin, which is connected to the IMX6 ENET_REF_CLK pad (V22
ball).

Hence, we have in DT:
	MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK

So far, so good. 


On current hardware, GPIO 16 is not connected to anything except some
0402 resistor pads where the resistor is not fitted.  On future hardware,
the above crystal will be removed, and the appropriate 0402 resistor
placed to supply a clock provided on GPIO 16 to the phy.

Hence, to support both hardware configurations transparently, GPIO 16
should be configured to generate a 25MHz clock for use by the phy.

This apparantly is done by configuring the PLL on the IMX6 to 25MHz and
getting it to output it on this pin, and that is done in the freescale
BSP by this pin control setting:

	MX6DL_PAD_GPIO_16__ENET_ANATOP_ETHERNET_REF_OUT

Now, if you look up that in the 4.1.0 BSP:

#define MX6DL_PAD_GPIO_16__ENET_ANATOP_ETHERNET_REF_OUT                        \
		IOMUX_PAD(0x05E4, 0x0214, 0x12, 0x080C, 0, NO_PAD_CTRL)

and that says to write 0x12 to 0x20e0000 + 0x214 - the
IOMUXC_SW_MUX_CTL_PAD_GPIO16 register.  This name clearly implies that
the IMX6 is _outputting_ the reference clock.  The register values here
selects MUX_MODE 2 (ENET_REF_CLK) _with_ SION set.  There is no
configuration in this BSP for GPIO 16 in mux mode 2 without SION set.

However, because we want this pad to produce a clock from the internal
PLL, GPR1 bit 21 has to be set.  Remember - the ENET_TX_CLK is configured
to come from the ENET_REF_CLK pad, not GPIO 16.

So, I contend that it _is_ valid to have both GPIO 16 SION set and GPR1
bit 21 set.

All in all, we don't want to clear GPR1 bit 21 ever on the Cubox-i SOM.

Whether SION should be set or not is another - separate - issue.  All
we really care about is getting GPIO 16 providing a 25MHz clock.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-10-02 23:49 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 19:51 device tree binding documentation outdated Russell King - ARM Linux
     [not found] ` <20130926195158.GS12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-26 20:29   ` Fabio Estevam
     [not found]     ` <CAOMZO5ANsZGcpvmtBE7d0q0E6+f0bE_U8CBF7G2v3xtqoLbqcA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-26 20:59       ` Russell King - ARM Linux
     [not found]         ` <20130926205906.GT12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-26 23:10           ` Matt Sealey
     [not found]             ` <CAHCPf3u9KyoJiAPv6oc_ZdVBqgix41__RAGRXh8z+d5bXO8fQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-26 23:29               ` Russell King - ARM Linux
     [not found]                 ` <20130926232907.GV12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-26 23:48                   ` Matt Sealey
2013-09-27 13:15                   ` Jason Cooper
     [not found]                     ` <20130927131554.GB31178-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2013-09-27 17:05                       ` Russell King - ARM Linux
     [not found]                         ` <20130927170552.GC12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-27 18:31                           ` Russell King - ARM Linux
     [not found]                             ` <20130927183101.GE12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-27 18:52                               ` Fabio Estevam
     [not found]                                 ` <CAOMZO5Csr-vgsKHahnTcMKu1DfgSToYnoVncAfhYFJid-bwviQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-27 20:16                                   ` Matt Sealey
     [not found]                                     ` <CAHCPf3t=rG-sV-kNe5mQjSvs8k0rddv9=tgh+ub=Tt1xObYxVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-27 20:43                                       ` Russell King - ARM Linux
2013-09-26 23:25           ` Fabio Estevam
2013-09-27 12:13             ` Russell King - ARM Linux
     [not found]               ` <20130927121357.GY12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-27 13:26                 ` Shawn Guo
     [not found]                   ` <20130927132601.GL25146-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-09-27 15:19                     ` Russell King - ARM Linux
     [not found]                       ` <20130927151900.GA12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-27 15:49                         ` Russell King - ARM Linux
2013-09-27 16:52                         ` Matt Sealey
     [not found]                           ` <CAHCPf3t8=mJn-RCz3C1cY6zqsH9ds8UANKpKx9ZpwPM6WjJt3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-27 17:49                             ` Russell King - ARM Linux
     [not found]                               ` <20130927174916.GD12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-27 18:33                                 ` Matt Sealey
     [not found]                                   ` <CAHCPf3sC7bY=p4vpBQFpRUmyPspT_PVjx0rH9cm1ov=SqkO+Vg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-27 19:05                                     ` Russell King - ARM Linux
     [not found]                                       ` <20130927190546.GG12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-27 19:41                                         ` Matt Sealey
     [not found]                                           ` <CAHCPf3vxGAzTnY360KC7Yt-DB1FB14Sv_Cn7DBTH6HGZ6y=stg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-27 19:48                                             ` Matt Sealey
     [not found]                                               ` <CAHCPf3sv3wSbUc9QFVhmYsPc1kqiWYRuOMO7rreuiGSrwyepBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-27 20:21                                                 ` Russell King - ARM Linux
     [not found]                                                   ` <20130927202110.GI12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-28  8:38                                                     ` Russell King - ARM Linux
     [not found]                                                       ` <20130928083859.GQ12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-29  6:13                                                         ` Shawn Guo
     [not found]                                                           ` <20130929061303.GB26156-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-09-29  6:23                                                             ` Duan Fugang-B38611
     [not found]                                                               ` <9848F2DB572E5649BA045B288BE08FBE017115C8-RL0Hj/+nBVC81RJBUSuqCa4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2013-09-29  6:35                                                                 ` Shawn Guo
     [not found]                                                                   ` <20130929063515.GC26156-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-09-29  6:47                                                                     ` Duan Fugang-B38611
2013-10-02 19:33                                                             ` Russell King - ARM Linux
     [not found]                                                               ` <20131002193316.GR12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-10-02 23:49                                                                 ` Russell King - ARM Linux [this message]
     [not found]                                                                   ` <20131002234911.GD12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-10-03  2:21                                                                     ` Fabio Estevam
2013-10-04 15:45                                                                     ` Shawn Guo
     [not found]                                                                       ` <20131004154536.GB2734-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-10-04 15:58                                                                         ` Russell King - ARM Linux
2013-09-29  5:01                                               ` Shawn Guo
2013-09-27 20:18                                             ` Russell King - ARM Linux
2013-09-28  3:28                                             ` Fabio Estevam
2013-09-26 21:35       ` Linus Walleij
     [not found]         ` <CACRpkda9HZ4JKnidnJJh-HkhCgtvJwQPQJnv9CZ4iYcQP36_Nw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-27  2:51           ` Shawn Guo
     [not found]             ` <20130927025116.GG25146-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-09-27  8:45               ` Russell King - ARM Linux
     [not found]                 ` <20130927084504.GW12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-27 12:28                   ` Shawn Guo
     [not found]                     ` <20130927122814.GK25146-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-09-27 13:12                       ` Jason Cooper
     [not found]                         ` <20130927131225.GA31178-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2013-09-27 13:21                           ` Russell King - ARM Linux
2013-09-27 13:29                             ` Linus Walleij
     [not found]                             ` <20130927132107.GZ12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-27 13:31                               ` Jason Cooper
     [not found]                                 ` <20130927133120.GC31178-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2013-09-27 16:33                                   ` Matt Sealey
     [not found]                                     ` <CAHCPf3tfc9Z14YYm9K0AXNinMDsTwE51_6tbYfyFU7cA8M7MgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-27 20:52                                       ` Russell King - ARM Linux
2013-09-27 13:52                             ` Arnaud Patard
2013-09-27 15:40                       ` Matt Sealey
2013-09-27  9:49   ` Russell King - ARM Linux
     [not found]     ` <20130927094902.GX12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-27 12:08       ` Sascha Hauer

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=20131002234911.GD12758@n2100.arm.linux.org.uk \
    --to=linux-lfz/pmaqli7xmaaqvzeohq@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=neko-HhXTZounMxbZATc7fWT8Dg@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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).