xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/net/fsl-enetc.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun* ENETC ethernet device tree bindings
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunDepending on board design and ENETC port type (internal or
4*4882a593Smuzhiyunexternal) there are two supported link modes specified by
5*4882a593Smuzhiyunbelow device tree bindings.
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunRequired properties:
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun- reg		: Specifies PCIe Device Number and Function
10*4882a593Smuzhiyun		  Number of the ENETC endpoint device, according
11*4882a593Smuzhiyun		  to parent node bindings.
12*4882a593Smuzhiyun- compatible	: Should be "fsl,enetc".
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun1. The ENETC external port is connected to a MDIO configurable phy
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun1.1. Using the local ENETC Port MDIO interface
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunIn this case, the ENETC node should include a "mdio" sub-node
19*4882a593Smuzhiyunthat in turn should contain the "ethernet-phy" node describing the
20*4882a593Smuzhiyunexternal phy.  Below properties are required, their bindings
21*4882a593Smuzhiyunalready defined in Documentation/devicetree/bindings/net/ethernet.txt or
22*4882a593SmuzhiyunDocumentation/devicetree/bindings/net/phy.txt.
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunRequired:
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun- phy-handle		: Phandle to a PHY on the MDIO bus.
27*4882a593Smuzhiyun			  Defined in ethernet.txt.
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun- phy-connection-type	: Defined in ethernet.txt.
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun- mdio			: "mdio" node, defined in mdio.txt.
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun- ethernet-phy		: "ethernet-phy" node, defined in phy.txt.
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunExample:
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun	ethernet@0,0 {
38*4882a593Smuzhiyun		compatible = "fsl,enetc";
39*4882a593Smuzhiyun		reg = <0x000000 0 0 0 0>;
40*4882a593Smuzhiyun		phy-handle = <&sgmii_phy0>;
41*4882a593Smuzhiyun		phy-connection-type = "sgmii";
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun		mdio {
44*4882a593Smuzhiyun			#address-cells = <1>;
45*4882a593Smuzhiyun			#size-cells = <0>;
46*4882a593Smuzhiyun			sgmii_phy0: ethernet-phy@2 {
47*4882a593Smuzhiyun				reg = <0x2>;
48*4882a593Smuzhiyun			};
49*4882a593Smuzhiyun		};
50*4882a593Smuzhiyun	};
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun1.2. Using the central MDIO PCIe endpoint device
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunIn this case, the mdio node should be defined as another PCIe
55*4882a593Smuzhiyunendpoint node, at the same level with the ENETC port nodes.
56*4882a593Smuzhiyun
57*4882a593SmuzhiyunRequired properties:
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun- reg		: Specifies PCIe Device Number and Function
60*4882a593Smuzhiyun		  Number of the ENETC endpoint device, according
61*4882a593Smuzhiyun		  to parent node bindings.
62*4882a593Smuzhiyun- compatible	: Should be "fsl,enetc-mdio".
63*4882a593Smuzhiyun
64*4882a593SmuzhiyunThe remaining required mdio bus properties are standard, their bindings
65*4882a593Smuzhiyunalready defined in Documentation/devicetree/bindings/net/mdio.txt.
66*4882a593Smuzhiyun
67*4882a593SmuzhiyunExample:
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun	ethernet@0,0 {
70*4882a593Smuzhiyun		compatible = "fsl,enetc";
71*4882a593Smuzhiyun		reg = <0x000000 0 0 0 0>;
72*4882a593Smuzhiyun		phy-handle = <&sgmii_phy0>;
73*4882a593Smuzhiyun		phy-connection-type = "sgmii";
74*4882a593Smuzhiyun	};
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun	mdio@0,3 {
77*4882a593Smuzhiyun		compatible = "fsl,enetc-mdio";
78*4882a593Smuzhiyun		reg = <0x000300 0 0 0 0>;
79*4882a593Smuzhiyun		#address-cells = <1>;
80*4882a593Smuzhiyun		#size-cells = <0>;
81*4882a593Smuzhiyun		sgmii_phy0: ethernet-phy@2 {
82*4882a593Smuzhiyun			reg = <0x2>;
83*4882a593Smuzhiyun		};
84*4882a593Smuzhiyun	};
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun2. The ENETC port is an internal port or has a fixed-link external
87*4882a593Smuzhiyunconnection
88*4882a593Smuzhiyun
89*4882a593SmuzhiyunIn this case, the ENETC port node defines a fixed link connection,
90*4882a593Smuzhiyunas specified by Documentation/devicetree/bindings/net/fixed-link.txt.
91*4882a593Smuzhiyun
92*4882a593SmuzhiyunRequired:
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun- fixed-link	: "fixed-link" node, defined in "fixed-link.txt".
95*4882a593Smuzhiyun
96*4882a593SmuzhiyunExample:
97*4882a593Smuzhiyun	ethernet@0,2 {
98*4882a593Smuzhiyun		compatible = "fsl,enetc";
99*4882a593Smuzhiyun		reg = <0x000200 0 0 0 0>;
100*4882a593Smuzhiyun		fixed-link {
101*4882a593Smuzhiyun			speed = <1000>;
102*4882a593Smuzhiyun			full-duplex;
103*4882a593Smuzhiyun		};
104*4882a593Smuzhiyun	};
105