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