Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / net / fsl-tsec-phy.txt
1 * MDIO IO device
2
3 The MDIO is a bus to which the PHY devices are connected.  For each
4 device that exists on this bus, a child node should be created.  See
5 the definition of the PHY node in booting-without-of.txt for an example
6 of how to define a PHY.
7
8 Required properties:
9   - reg : Offset and length of the register set for the device
10   - compatible : Should define the compatible device type for the
11     mdio.  Currently, this is most likely to be "fsl,gianfar-mdio"
12
13 Example:
14
15         mdio@24520 {
16                 reg = <24520 20>;
17                 compatible = "fsl,gianfar-mdio";
18
19                 ethernet-phy@0 {
20                         ......
21                 };
22         };
23
24 * TBI Internal MDIO bus
25
26 As of this writing, every tsec is associated with an internal TBI PHY.
27 This PHY is accessed through the local MDIO bus.  These buses are defined
28 similarly to the mdio buses, except they are compatible with "fsl,gianfar-tbi".
29 The TBI PHYs underneath them are similar to normal PHYs, but the reg property
30 is considered instructive, rather than descriptive.  The reg property should
31 be chosen so it doesn't interfere with other PHYs on the bus.
32
33 * Gianfar-compatible ethernet nodes
34
35 Properties:
36
37   - device_type : Should be "network"
38   - model : Model of the device.  Can be "TSEC", "eTSEC", or "FEC"
39   - compatible : Should be "gianfar"
40   - reg : Offset and length of the register set for the device
41   - interrupts : For FEC devices, the first interrupt is the device's
42     interrupt.  For TSEC and eTSEC devices, the first interrupt is
43     transmit, the second is receive, and the third is error.
44   - phy-handle : See ethernet.txt file in the same directory.
45   - fixed-link : <a b c d e> where a is emulated phy id - choose any,
46     but unique to the all specified fixed-links, b is duplex - 0 half,
47     1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
48     pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
49   - phy-connection-type : See ethernet.txt file in the same directory.
50     This property is only really needed if the connection is of type
51     "rgmii-id", as all other connection types are detected by hardware.
52   - fsl,magic-packet : If present, indicates that the hardware supports
53     waking up via magic packet.
54   - bd-stash : If present, indicates that the hardware supports stashing
55     buffer descriptors in the L2.
56   - rx-stash-len : Denotes the number of bytes of a received buffer to stash
57     in the L2.
58   - rx-stash-idx : Denotes the index of the first byte from the received
59     buffer to stash in the L2.
60
61 Example:
62         ethernet@24000 {
63                 device_type = "network";
64                 model = "TSEC";
65                 compatible = "gianfar";
66                 reg = <0x24000 0x1000>;
67                 local-mac-address = [ 00 E0 0C 00 73 00 ];
68                 interrupts = <29 2 30 2 34 2>;
69                 interrupt-parent = <&mpic>;
70                 phy-handle = <&phy0>
71         };
72
73 * Gianfar PTP clock nodes
74
75 General Properties:
76
77   - compatible   Should be "fsl,etsec-ptp"
78   - reg          Offset and length of the register set for the device
79   - interrupts   There should be at least two interrupts. Some devices
80                  have as many as four PTP related interrupts.
81
82 Clock Properties:
83
84   - fsl,cksel        Timer reference clock source.
85   - fsl,tclk-period  Timer reference clock period in nanoseconds.
86   - fsl,tmr-prsc     Prescaler, divides the output clock.
87   - fsl,tmr-add      Frequency compensation value.
88   - fsl,tmr-fiper1   Fixed interval period pulse generator.
89   - fsl,tmr-fiper2   Fixed interval period pulse generator.
90   - fsl,max-adj      Maximum frequency adjustment in parts per billion.
91
92   These properties set the operational parameters for the PTP
93   clock. You must choose these carefully for the clock to work right.
94   Here is how to figure good values:
95
96   TimerOsc     = selected reference clock   MHz
97   tclk_period  = desired clock period       nanoseconds
98   NominalFreq  = 1000 / tclk_period         MHz
99   FreqDivRatio = TimerOsc / NominalFreq     (must be greater that 1.0)
100   tmr_add      = ceil(2^32 / FreqDivRatio)
101   OutputClock  = NominalFreq / tmr_prsc     MHz
102   PulseWidth   = 1 / OutputClock            microseconds
103   FiperFreq1   = desired frequency in Hz
104   FiperDiv1    = 1000000 * OutputClock / FiperFreq1
105   tmr_fiper1   = tmr_prsc * tclk_period * FiperDiv1 - tclk_period
106   max_adj      = 1000000000 * (FreqDivRatio - 1.0) - 1
107
108   The calculation for tmr_fiper2 is the same as for tmr_fiper1. The
109   driver expects that tmr_fiper1 will be correctly set to produce a 1
110   Pulse Per Second (PPS) signal, since this will be offered to the PPS
111   subsystem to synchronize the Linux clock.
112
113   Reference clock source is determined by the value, which is holded
114   in CKSEL bits in TMR_CTRL register. "fsl,cksel" property keeps the
115   value, which will be directly written in those bits, that is why,
116   according to reference manual, the next clock sources can be used:
117
118   <0> - external high precision timer reference clock (TSEC_TMR_CLK
119         input is used for this purpose);
120   <1> - eTSEC system clock;
121   <2> - eTSEC1 transmit clock;
122   <3> - RTC clock input.
123
124   When this attribute is not used, eTSEC system clock will serve as
125   IEEE 1588 timer reference clock.
126
127 Example:
128
129         ptp_clock@24E00 {
130                 compatible = "fsl,etsec-ptp";
131                 reg = <0x24E00 0xB0>;
132                 interrupts = <12 0x8 13 0x8>;
133                 interrupt-parent = < &ipic >;
134                 fsl,cksel       = <1>;
135                 fsl,tclk-period = <10>;
136                 fsl,tmr-prsc    = <100>;
137                 fsl,tmr-add     = <0x999999A4>;
138                 fsl,tmr-fiper1  = <0x3B9AC9F6>;
139                 fsl,tmr-fiper2  = <0x00018696>;
140                 fsl,max-adj     = <659999998>;
141         };