xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/net/mediatek-dwmac.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunMediaTek DWMAC glue layer controller
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunThis file documents platform glue layer for stmmac.
4*4882a593SmuzhiyunPlease see stmmac.txt for the other unchanged properties.
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunThe device node has following properties.
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunRequired properties:
9*4882a593Smuzhiyun- compatible:  Should be "mediatek,mt2712-gmac" for MT2712 SoC
10*4882a593Smuzhiyun- reg:  Address and length of the register set for the device
11*4882a593Smuzhiyun- interrupts:  Should contain the MAC interrupts
12*4882a593Smuzhiyun- interrupt-names: Should contain a list of interrupt names corresponding to
13*4882a593Smuzhiyun	the interrupts in the interrupts property, if available.
14*4882a593Smuzhiyun	Should be "macirq" for the main MAC IRQ
15*4882a593Smuzhiyun- clocks: Must contain a phandle for each entry in clock-names.
16*4882a593Smuzhiyun- clock-names: The name of the clock listed in the clocks property. These are
17*4882a593Smuzhiyun	"axi", "apb", "mac_main", "ptp_ref", "rmii_internal" for MT2712 SoC.
18*4882a593Smuzhiyun- mac-address: See ethernet.txt in the same directory
19*4882a593Smuzhiyun- phy-mode: See ethernet.txt in the same directory
20*4882a593Smuzhiyun- mediatek,pericfg: A phandle to the syscon node that control ethernet
21*4882a593Smuzhiyun	interface and timing delay.
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunOptional properties:
24*4882a593Smuzhiyun- mediatek,tx-delay-ps: TX clock delay macro value. Default is 0.
25*4882a593Smuzhiyun	It should be defined for RGMII/MII interface.
26*4882a593Smuzhiyun	It should be defined for RMII interface when the reference clock is from MT2712 SoC.
27*4882a593Smuzhiyun- mediatek,rx-delay-ps: RX clock delay macro value. Default is 0.
28*4882a593Smuzhiyun	It should be defined for RGMII/MII interface.
29*4882a593Smuzhiyun	It should be defined for RMII interface.
30*4882a593SmuzhiyunBoth delay properties need to be a multiple of 170 for RGMII interface,
31*4882a593Smuzhiyunor will round down. Range 0~31*170.
32*4882a593SmuzhiyunBoth delay properties need to be a multiple of 550 for MII/RMII interface,
33*4882a593Smuzhiyunor will round down. Range 0~31*550.
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun- mediatek,rmii-rxc: boolean property, if present indicates that the RMII
36*4882a593Smuzhiyun	reference clock, which is from external PHYs, is connected to RXC pin
37*4882a593Smuzhiyun	on MT2712 SoC.
38*4882a593Smuzhiyun	Otherwise, is connected to TXC pin.
39*4882a593Smuzhiyun- mediatek,rmii-clk-from-mac: boolean property, if present indicates that
40*4882a593Smuzhiyun	MT2712 SoC provides the RMII reference clock, which outputs to TXC pin only.
41*4882a593Smuzhiyun- mediatek,txc-inverse: boolean property, if present indicates that
42*4882a593Smuzhiyun	1. tx clock will be inversed in MII/RGMII case,
43*4882a593Smuzhiyun	2. tx clock inside MAC will be inversed relative to reference clock
44*4882a593Smuzhiyun	   which is from external PHYs in RMII case, and it rarely happen.
45*4882a593Smuzhiyun	3. the reference clock, which outputs to TXC pin will be inversed in RMII case
46*4882a593Smuzhiyun	   when the reference clock is from MT2712 SoC.
47*4882a593Smuzhiyun- mediatek,rxc-inverse: boolean property, if present indicates that
48*4882a593Smuzhiyun	1. rx clock will be inversed in MII/RGMII case.
49*4882a593Smuzhiyun	2. reference clock will be inversed when arrived at MAC in RMII case, when
50*4882a593Smuzhiyun	   the reference clock is from external PHYs.
51*4882a593Smuzhiyun	3. the inside clock, which be sent to MAC, will be inversed in RMII case when
52*4882a593Smuzhiyun	   the reference clock is from MT2712 SoC.
53*4882a593Smuzhiyun- assigned-clocks: mac_main and ptp_ref clocks
54*4882a593Smuzhiyun- assigned-clock-parents: parent clocks of the assigned clocks
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunExample:
57*4882a593Smuzhiyun	eth: ethernet@1101c000 {
58*4882a593Smuzhiyun		compatible = "mediatek,mt2712-gmac";
59*4882a593Smuzhiyun		reg = <0 0x1101c000 0 0x1300>;
60*4882a593Smuzhiyun		interrupts = <GIC_SPI 237 IRQ_TYPE_LEVEL_LOW>;
61*4882a593Smuzhiyun		interrupt-names = "macirq";
62*4882a593Smuzhiyun		phy-mode ="rgmii-rxid";
63*4882a593Smuzhiyun		mac-address = [00 55 7b b5 7d f7];
64*4882a593Smuzhiyun		clock-names = "axi",
65*4882a593Smuzhiyun			      "apb",
66*4882a593Smuzhiyun			      "mac_main",
67*4882a593Smuzhiyun			      "ptp_ref",
68*4882a593Smuzhiyun			      "rmii_internal";
69*4882a593Smuzhiyun		clocks = <&pericfg CLK_PERI_GMAC>,
70*4882a593Smuzhiyun			 <&pericfg CLK_PERI_GMAC_PCLK>,
71*4882a593Smuzhiyun			 <&topckgen CLK_TOP_ETHER_125M_SEL>,
72*4882a593Smuzhiyun			 <&topckgen CLK_TOP_ETHER_50M_SEL>,
73*4882a593Smuzhiyun			 <&topckgen CLK_TOP_ETHER_50M_RMII_SEL>;
74*4882a593Smuzhiyun		assigned-clocks = <&topckgen CLK_TOP_ETHER_125M_SEL>,
75*4882a593Smuzhiyun				  <&topckgen CLK_TOP_ETHER_50M_SEL>,
76*4882a593Smuzhiyun				  <&topckgen CLK_TOP_ETHER_50M_RMII_SEL>;
77*4882a593Smuzhiyun		assigned-clock-parents = <&topckgen CLK_TOP_ETHERPLL_125M>,
78*4882a593Smuzhiyun					 <&topckgen CLK_TOP_APLL1_D3>,
79*4882a593Smuzhiyun					 <&topckgen CLK_TOP_ETHERPLL_50M>;
80*4882a593Smuzhiyun		power-domains = <&scpsys MT2712_POWER_DOMAIN_AUDIO>;
81*4882a593Smuzhiyun		mediatek,pericfg = <&pericfg>;
82*4882a593Smuzhiyun		mediatek,tx-delay-ps = <1530>;
83*4882a593Smuzhiyun		mediatek,rx-delay-ps = <1530>;
84*4882a593Smuzhiyun		mediatek,rmii-rxc;
85*4882a593Smuzhiyun		mediatek,txc-inverse;
86*4882a593Smuzhiyun		mediatek,rxc-inverse;
87*4882a593Smuzhiyun		snps,txpbl = <1>;
88*4882a593Smuzhiyun		snps,rxpbl = <1>;
89*4882a593Smuzhiyun		snps,reset-gpio = <&pio 87 GPIO_ACTIVE_LOW>;
90*4882a593Smuzhiyun		snps,reset-active-low;
91*4882a593Smuzhiyun	};
92