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