xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/net/mediatek-net.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunMediaTek Frame Engine Ethernet controller
2*4882a593Smuzhiyun=========================================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunThe frame engine ethernet controller can be found on MediaTek SoCs. These SoCs
5*4882a593Smuzhiyunhave dual GMAC each represented by a child node..
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun* Ethernet controller node
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunRequired properties:
10*4882a593Smuzhiyun- compatible: Should be
11*4882a593Smuzhiyun		"mediatek,mt2701-eth": for MT2701 SoC
12*4882a593Smuzhiyun		"mediatek,mt7623-eth", "mediatek,mt2701-eth": for MT7623 SoC
13*4882a593Smuzhiyun		"mediatek,mt7622-eth": for MT7622 SoC
14*4882a593Smuzhiyun		"mediatek,mt7629-eth": for MT7629 SoC
15*4882a593Smuzhiyun		"ralink,rt5350-eth": for Ralink Rt5350F and MT7628/88 SoC
16*4882a593Smuzhiyun- reg: Address and length of the register set for the device
17*4882a593Smuzhiyun- interrupts: Should contain the three frame engines interrupts in numeric
18*4882a593Smuzhiyun	order. These are fe_int0, fe_int1 and fe_int2.
19*4882a593Smuzhiyun- clocks: the clock used by the core
20*4882a593Smuzhiyun- clock-names: the names of the clock listed in the clocks property. These are
21*4882a593Smuzhiyun	"ethif", "esw", "gp2", "gp1" : For MT2701 and MT7623 SoC
22*4882a593Smuzhiyun        "ethif", "esw", "gp0", "gp1", "gp2", "sgmii_tx250m", "sgmii_rx250m",
23*4882a593Smuzhiyun	"sgmii_cdr_ref", "sgmii_cdr_fb", "sgmii_ck", "eth2pll" : For MT7622 SoC
24*4882a593Smuzhiyun	"ethif", "sgmiitop", "esw", "gp0", "gp1", "gp2", "fe", "sgmii_tx250m",
25*4882a593Smuzhiyun	"sgmii_rx250m", "sgmii_cdr_ref", "sgmii_cdr_fb", "sgmii2_tx250m",
26*4882a593Smuzhiyun	"sgmii2_rx250m", "sgmii2_cdr_ref", "sgmii2_cdr_fb", "sgmii_ck",
27*4882a593Smuzhiyun	"eth2pll" : For MT7629 SoC.
28*4882a593Smuzhiyun- power-domains: phandle to the power domain that the ethernet is part of
29*4882a593Smuzhiyun- resets: Should contain phandles to the ethsys reset signals
30*4882a593Smuzhiyun- reset-names: Should contain the names of reset signal listed in the resets
31*4882a593Smuzhiyun		property
32*4882a593Smuzhiyun		These are "fe", "gmac" and "ppe"
33*4882a593Smuzhiyun- mediatek,ethsys: phandle to the syscon node that handles the port setup
34*4882a593Smuzhiyun- mediatek,infracfg: phandle to the syscon node that handles the path from
35*4882a593Smuzhiyun	GMAC to PHY variants, which is required for MT7629 SoC.
36*4882a593Smuzhiyun- mediatek,sgmiisys: a list of phandles to the syscon node that handles the
37*4882a593Smuzhiyun	SGMII setup which is required for those SoCs equipped with SGMII such
38*4882a593Smuzhiyun	as MT7622 and MT7629 SoC. And MT7622 have only one set of SGMII shared
39*4882a593Smuzhiyun	by GMAC1 and GMAC2; MT7629 have two independent sets of SGMII directed
40*4882a593Smuzhiyun	to GMAC1 and GMAC2, respectively.
41*4882a593Smuzhiyun- mediatek,pctl: phandle to the syscon node that handles the ports slew rate
42*4882a593Smuzhiyun	and driver current: only for MT2701 and MT7623 SoC
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun* Ethernet MAC node
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunRequired properties:
47*4882a593Smuzhiyun- compatible: Should be "mediatek,eth-mac"
48*4882a593Smuzhiyun- reg: The number of the MAC
49*4882a593Smuzhiyun- phy-handle: see ethernet.txt file in the same directory and
50*4882a593Smuzhiyun	the phy-mode "trgmii" required being provided when reg
51*4882a593Smuzhiyun	is equal to 0 and the MAC uses fixed-link to connect
52*4882a593Smuzhiyun	with internal switch such as MT7530.
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunExample:
55*4882a593Smuzhiyun
56*4882a593Smuzhiyuneth: ethernet@1b100000 {
57*4882a593Smuzhiyun	compatible = "mediatek,mt7623-eth";
58*4882a593Smuzhiyun	reg = <0 0x1b100000 0 0x20000>;
59*4882a593Smuzhiyun	clocks = <&topckgen CLK_TOP_ETHIF_SEL>,
60*4882a593Smuzhiyun		 <&ethsys CLK_ETHSYS_ESW>,
61*4882a593Smuzhiyun		 <&ethsys CLK_ETHSYS_GP2>,
62*4882a593Smuzhiyun		 <&ethsys CLK_ETHSYS_GP1>;
63*4882a593Smuzhiyun	clock-names = "ethif", "esw", "gp2", "gp1";
64*4882a593Smuzhiyun	interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_LOW
65*4882a593Smuzhiyun		      GIC_SPI 199 IRQ_TYPE_LEVEL_LOW
66*4882a593Smuzhiyun		      GIC_SPI 198 IRQ_TYPE_LEVEL_LOW>;
67*4882a593Smuzhiyun	power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>;
68*4882a593Smuzhiyun	resets = <&ethsys MT2701_ETHSYS_ETH_RST>;
69*4882a593Smuzhiyun	reset-names = "eth";
70*4882a593Smuzhiyun	mediatek,ethsys = <&ethsys>;
71*4882a593Smuzhiyun	mediatek,pctl = <&syscfg_pctl_a>;
72*4882a593Smuzhiyun	#address-cells = <1>;
73*4882a593Smuzhiyun	#size-cells = <0>;
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun	gmac1: mac@0 {
76*4882a593Smuzhiyun		compatible = "mediatek,eth-mac";
77*4882a593Smuzhiyun		reg = <0>;
78*4882a593Smuzhiyun		phy-handle = <&phy0>;
79*4882a593Smuzhiyun	};
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun	gmac2: mac@1 {
82*4882a593Smuzhiyun		compatible = "mediatek,eth-mac";
83*4882a593Smuzhiyun		reg = <1>;
84*4882a593Smuzhiyun		phy-handle = <&phy1>;
85*4882a593Smuzhiyun	};
86*4882a593Smuzhiyun
87*4882a593Smuzhiyun	mdio-bus {
88*4882a593Smuzhiyun		phy0: ethernet-phy@0 {
89*4882a593Smuzhiyun			reg = <0>;
90*4882a593Smuzhiyun			phy-mode = "rgmii";
91*4882a593Smuzhiyun		};
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun		phy1: ethernet-phy@1 {
94*4882a593Smuzhiyun			reg = <1>;
95*4882a593Smuzhiyun			phy-mode = "rgmii";
96*4882a593Smuzhiyun		};
97*4882a593Smuzhiyun	};
98*4882a593Smuzhiyun};
99