xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/net/ibm,emac.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun    4xx/Axon EMAC ethernet nodes
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun    The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
4*4882a593Smuzhiyun    the Axon bridge.  To operate this needs to interact with a this
5*4882a593Smuzhiyun    special McMAL DMA controller, and sometimes an RGMII or ZMII
6*4882a593Smuzhiyun    interface.  In addition to the nodes and properties described
7*4882a593Smuzhiyun    below, the node for the OPB bus on which the EMAC sits must have a
8*4882a593Smuzhiyun    correct clock-frequency property.
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun      i) The EMAC node itself
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun    Required properties:
13*4882a593Smuzhiyun    - device_type       : "network"
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun    - compatible        : compatible list, contains 2 entries, first is
16*4882a593Smuzhiyun			  "ibm,emac-CHIP" where CHIP is the host ASIC (440gx,
17*4882a593Smuzhiyun			  405gp, Axon) and second is either "ibm,emac" or
18*4882a593Smuzhiyun			  "ibm,emac4".  For Axon, thus, we have: "ibm,emac-axon",
19*4882a593Smuzhiyun			  "ibm,emac4"
20*4882a593Smuzhiyun    - interrupts        : <interrupt mapping for EMAC IRQ and WOL IRQ>
21*4882a593Smuzhiyun    - reg               : <registers mapping>
22*4882a593Smuzhiyun    - local-mac-address : 6 bytes, MAC address
23*4882a593Smuzhiyun    - mal-device        : phandle of the associated McMAL node
24*4882a593Smuzhiyun    - mal-tx-channel    : 1 cell, index of the tx channel on McMAL associated
25*4882a593Smuzhiyun			  with this EMAC
26*4882a593Smuzhiyun    - mal-rx-channel    : 1 cell, index of the rx channel on McMAL associated
27*4882a593Smuzhiyun			  with this EMAC
28*4882a593Smuzhiyun    - cell-index        : 1 cell, hardware index of the EMAC cell on a given
29*4882a593Smuzhiyun			  ASIC (typically 0x0 and 0x1 for EMAC0 and EMAC1 on
30*4882a593Smuzhiyun			  each Axon chip)
31*4882a593Smuzhiyun    - max-frame-size    : 1 cell, maximum frame size supported in bytes
32*4882a593Smuzhiyun    - rx-fifo-size      : 1 cell, Rx fifo size in bytes for 10 and 100 Mb/sec
33*4882a593Smuzhiyun			  operations.
34*4882a593Smuzhiyun			  For Axon, 2048
35*4882a593Smuzhiyun    - tx-fifo-size      : 1 cell, Tx fifo size in bytes for 10 and 100 Mb/sec
36*4882a593Smuzhiyun			  operations.
37*4882a593Smuzhiyun			  For Axon, 2048.
38*4882a593Smuzhiyun    - fifo-entry-size   : 1 cell, size of a fifo entry (used to calculate
39*4882a593Smuzhiyun			  thresholds).
40*4882a593Smuzhiyun			  For Axon, 0x00000010
41*4882a593Smuzhiyun    - mal-burst-size    : 1 cell, MAL burst size (used to calculate thresholds)
42*4882a593Smuzhiyun			  in bytes.
43*4882a593Smuzhiyun			  For Axon, 0x00000100 (I think ...)
44*4882a593Smuzhiyun    - phy-mode          : string, mode of operations of the PHY interface.
45*4882a593Smuzhiyun			  Supported values are: "mii", "rmii", "smii", "rgmii",
46*4882a593Smuzhiyun			  "tbi", "gmii", rtbi", "sgmii".
47*4882a593Smuzhiyun			  For Axon on CAB, it is "rgmii"
48*4882a593Smuzhiyun    - mdio-device       : 1 cell, required iff using shared MDIO registers
49*4882a593Smuzhiyun			  (440EP).  phandle of the EMAC to use to drive the
50*4882a593Smuzhiyun			  MDIO lines for the PHY used by this EMAC.
51*4882a593Smuzhiyun    - zmii-device       : 1 cell, required iff connected to a ZMII.  phandle of
52*4882a593Smuzhiyun			  the ZMII device node
53*4882a593Smuzhiyun    - zmii-channel      : 1 cell, required iff connected to a ZMII.  Which ZMII
54*4882a593Smuzhiyun			  channel or 0xffffffff if ZMII is only used for MDIO.
55*4882a593Smuzhiyun    - rgmii-device      : 1 cell, required iff connected to an RGMII. phandle
56*4882a593Smuzhiyun			  of the RGMII device node.
57*4882a593Smuzhiyun			  For Axon: phandle of plb5/plb4/opb/rgmii
58*4882a593Smuzhiyun    - rgmii-channel     : 1 cell, required iff connected to an RGMII.  Which
59*4882a593Smuzhiyun			  RGMII channel is used by this EMAC.
60*4882a593Smuzhiyun			  Fox Axon: present, whatever value is appropriate for each
61*4882a593Smuzhiyun			  EMAC, that is the content of the current (bogus) "phy-port"
62*4882a593Smuzhiyun			  property.
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun    Optional properties:
65*4882a593Smuzhiyun    - phy-address       : 1 cell, optional, MDIO address of the PHY. If absent,
66*4882a593Smuzhiyun			  a search is performed.
67*4882a593Smuzhiyun    - phy-map           : 1 cell, optional, bitmap of addresses to probe the PHY
68*4882a593Smuzhiyun			  for, used if phy-address is absent. bit 0x00000001 is
69*4882a593Smuzhiyun			  MDIO address 0.
70*4882a593Smuzhiyun			  For Axon it can be absent, though my current driver
71*4882a593Smuzhiyun			  doesn't handle phy-address yet so for now, keep
72*4882a593Smuzhiyun			  0x00ffffff in it.
73*4882a593Smuzhiyun    - phy-handle	: Used to describe configurations where a external PHY
74*4882a593Smuzhiyun			  is used. Please refer to:
75*4882a593Smuzhiyun			  Documentation/devicetree/bindings/net/ethernet.txt
76*4882a593Smuzhiyun    - rx-fifo-size-gige : 1 cell, Rx fifo size in bytes for 1000 Mb/sec
77*4882a593Smuzhiyun			  operations (if absent the value is the same as
78*4882a593Smuzhiyun			  rx-fifo-size).  For Axon, either absent or 2048.
79*4882a593Smuzhiyun    - tx-fifo-size-gige : 1 cell, Tx fifo size in bytes for 1000 Mb/sec
80*4882a593Smuzhiyun			  operations (if absent the value is the same as
81*4882a593Smuzhiyun			  tx-fifo-size). For Axon, either absent or 2048.
82*4882a593Smuzhiyun    - tah-device        : 1 cell, optional. If connected to a TAH engine for
83*4882a593Smuzhiyun			  offload, phandle of the TAH device node.
84*4882a593Smuzhiyun    - tah-channel       : 1 cell, optional. If appropriate, channel used on the
85*4882a593Smuzhiyun			  TAH engine.
86*4882a593Smuzhiyun    - fixed-link	: Fixed-link subnode describing a link to a non-MDIO
87*4882a593Smuzhiyun			  managed entity. See
88*4882a593Smuzhiyun			  Documentation/devicetree/bindings/net/fixed-link.txt
89*4882a593Smuzhiyun			  for details.
90*4882a593Smuzhiyun    - mdio subnode	: When the EMAC has a phy connected to its local
91*4882a593Smuzhiyun			  mdio, which us supported by the kernel's network
92*4882a593Smuzhiyun			  PHY library in drivers/net/phy, there must be device
93*4882a593Smuzhiyun			  tree subnode with the following required properties:
94*4882a593Smuzhiyun				- #address-cells: Must be <1>.
95*4882a593Smuzhiyun				- #size-cells: Must be <0>.
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun			  For PHY definitions: Please refer to
98*4882a593Smuzhiyun			  Documentation/devicetree/bindings/net/phy.txt and
99*4882a593Smuzhiyun			  Documentation/devicetree/bindings/net/ethernet.txt
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun    Examples:
102*4882a593Smuzhiyun
103*4882a593Smuzhiyun	EMAC0: ethernet@40000800 {
104*4882a593Smuzhiyun		device_type = "network";
105*4882a593Smuzhiyun		compatible = "ibm,emac-440gp", "ibm,emac";
106*4882a593Smuzhiyun		interrupt-parent = <&UIC1>;
107*4882a593Smuzhiyun		interrupts = <1c 4 1d 4>;
108*4882a593Smuzhiyun		reg = <40000800 70>;
109*4882a593Smuzhiyun		local-mac-address = [00 04 AC E3 1B 1E];
110*4882a593Smuzhiyun		mal-device = <&MAL0>;
111*4882a593Smuzhiyun		mal-tx-channel = <0 1>;
112*4882a593Smuzhiyun		mal-rx-channel = <0>;
113*4882a593Smuzhiyun		cell-index = <0>;
114*4882a593Smuzhiyun		max-frame-size = <5dc>;
115*4882a593Smuzhiyun		rx-fifo-size = <1000>;
116*4882a593Smuzhiyun		tx-fifo-size = <800>;
117*4882a593Smuzhiyun		phy-mode = "rmii";
118*4882a593Smuzhiyun		phy-map = <00000001>;
119*4882a593Smuzhiyun		zmii-device = <&ZMII0>;
120*4882a593Smuzhiyun		zmii-channel = <0>;
121*4882a593Smuzhiyun	};
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun	EMAC1: ethernet@ef600c00 {
124*4882a593Smuzhiyun		device_type = "network";
125*4882a593Smuzhiyun		compatible = "ibm,emac-apm821xx", "ibm,emac4sync";
126*4882a593Smuzhiyun		interrupt-parent = <&EMAC1>;
127*4882a593Smuzhiyun		interrupts = <0 1>;
128*4882a593Smuzhiyun		#interrupt-cells = <1>;
129*4882a593Smuzhiyun		#address-cells = <0>;
130*4882a593Smuzhiyun		#size-cells = <0>;
131*4882a593Smuzhiyun		interrupt-map = <0 &UIC2 0x10 IRQ_TYPE_LEVEL_HIGH /* Status */
132*4882a593Smuzhiyun				 1 &UIC2 0x14 IRQ_TYPE_LEVEL_HIGH /* Wake */>;
133*4882a593Smuzhiyun		reg = <0xef600c00 0x000000c4>;
134*4882a593Smuzhiyun		local-mac-address = [000000000000]; /* Filled in by U-Boot */
135*4882a593Smuzhiyun		mal-device = <&MAL0>;
136*4882a593Smuzhiyun		mal-tx-channel = <0>;
137*4882a593Smuzhiyun		mal-rx-channel = <0>;
138*4882a593Smuzhiyun		cell-index = <0>;
139*4882a593Smuzhiyun		max-frame-size = <9000>;
140*4882a593Smuzhiyun		rx-fifo-size = <16384>;
141*4882a593Smuzhiyun		tx-fifo-size = <2048>;
142*4882a593Smuzhiyun		fifo-entry-size = <10>;
143*4882a593Smuzhiyun		phy-mode = "rgmii";
144*4882a593Smuzhiyun		phy-handle = <&phy0>;
145*4882a593Smuzhiyun		phy-map = <0x00000000>;
146*4882a593Smuzhiyun		rgmii-device = <&RGMII0>;
147*4882a593Smuzhiyun		rgmii-channel = <0>;
148*4882a593Smuzhiyun		tah-device = <&TAH0>;
149*4882a593Smuzhiyun		tah-channel = <0>;
150*4882a593Smuzhiyun		has-inverted-stacr-oc;
151*4882a593Smuzhiyun		has-new-stacr-staopc;
152*4882a593Smuzhiyun
153*4882a593Smuzhiyun	        mdio {
154*4882a593Smuzhiyun			#address-cells = <1>;
155*4882a593Smuzhiyun			#size-cells = <0>;
156*4882a593Smuzhiyun
157*4882a593Smuzhiyun			phy0: ethernet-phy@0 {
158*4882a593Smuzhiyun				compatible = "ethernet-phy-ieee802.3-c22";
159*4882a593Smuzhiyun				reg = <0>;
160*4882a593Smuzhiyun			};
161*4882a593Smuzhiyun		};
162*4882a593Smuzhiyun	};
163*4882a593Smuzhiyun
164*4882a593Smuzhiyun
165*4882a593Smuzhiyun      ii) McMAL node
166*4882a593Smuzhiyun
167*4882a593Smuzhiyun    Required properties:
168*4882a593Smuzhiyun    - device_type        : "dma-controller"
169*4882a593Smuzhiyun    - compatible         : compatible list, containing 2 entries, first is
170*4882a593Smuzhiyun			   "ibm,mcmal-CHIP" where CHIP is the host ASIC (like
171*4882a593Smuzhiyun			   emac) and the second is either "ibm,mcmal" or
172*4882a593Smuzhiyun			   "ibm,mcmal2".
173*4882a593Smuzhiyun			   For Axon, "ibm,mcmal-axon","ibm,mcmal2"
174*4882a593Smuzhiyun    - interrupts         : <interrupt mapping for the MAL interrupts sources:
175*4882a593Smuzhiyun                           5 sources: tx_eob, rx_eob, serr, txde, rxde>.
176*4882a593Smuzhiyun                           For Axon: This is _different_ from the current
177*4882a593Smuzhiyun			   firmware.  We use the "delayed" interrupts for txeob
178*4882a593Smuzhiyun			   and rxeob. Thus we end up with mapping those 5 MPIC
179*4882a593Smuzhiyun			   interrupts, all level positive sensitive: 10, 11, 32,
180*4882a593Smuzhiyun			   33, 34 (in decimal)
181*4882a593Smuzhiyun    - dcr-reg            : < DCR registers range >
182*4882a593Smuzhiyun    - dcr-parent         : if needed for dcr-reg
183*4882a593Smuzhiyun    - num-tx-chans       : 1 cell, number of Tx channels
184*4882a593Smuzhiyun    - num-rx-chans       : 1 cell, number of Rx channels
185*4882a593Smuzhiyun
186*4882a593Smuzhiyun      iii) ZMII node
187*4882a593Smuzhiyun
188*4882a593Smuzhiyun    Required properties:
189*4882a593Smuzhiyun    - compatible         : compatible list, containing 2 entries, first is
190*4882a593Smuzhiyun			   "ibm,zmii-CHIP" where CHIP is the host ASIC (like
191*4882a593Smuzhiyun			   EMAC) and the second is "ibm,zmii".
192*4882a593Smuzhiyun			   For Axon, there is no ZMII node.
193*4882a593Smuzhiyun    - reg                : <registers mapping>
194*4882a593Smuzhiyun
195*4882a593Smuzhiyun      iv) RGMII node
196*4882a593Smuzhiyun
197*4882a593Smuzhiyun    Required properties:
198*4882a593Smuzhiyun    - compatible         : compatible list, containing 2 entries, first is
199*4882a593Smuzhiyun			   "ibm,rgmii-CHIP" where CHIP is the host ASIC (like
200*4882a593Smuzhiyun			   EMAC) and the second is "ibm,rgmii".
201*4882a593Smuzhiyun                           For Axon, "ibm,rgmii-axon","ibm,rgmii"
202*4882a593Smuzhiyun    - reg                : <registers mapping>
203*4882a593Smuzhiyun    - revision           : as provided by the RGMII new version register if
204*4882a593Smuzhiyun			   available.
205*4882a593Smuzhiyun			   For Axon: 0x0000012a
206