1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
4 $id: http://devicetree.org/schemas/net/mediatek-dwmac.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: MediaTek DWMAC glue layer controller
10 - Biao Huang <biao.huang@mediatek.com>
13 This file documents platform glue layer for stmmac.
15 # We need a select here so we don't match all nodes with 'snps,dwmac'
21 - mediatek,mt2712-gmac
22 - mediatek,mt8195-gmac
27 - $ref: "snps,dwmac.yaml#"
34 - mediatek,mt2712-gmac
35 - const: snps,dwmac-4.20a
38 - mediatek,mt8195-gmac
39 - const: snps,dwmac-5.10a
44 - description: AXI clock
45 - description: APB clock
46 - description: MAC Main clock
47 - description: PTP clock
48 - description: RMII reference clock provided by MAC
49 - description: MAC clock gate
58 - const: rmii_internal
62 $ref: /schemas/types.yaml#/definitions/phandle
64 The phandle to the syscon node that control ethernet
65 interface and timing delay.
69 The internal TX clock delay (provided by this driver) in nanoseconds.
70 For MT2712 RGMII interface, Allowed value need to be a multiple of 170,
71 or will round down. Range 0~31*170.
72 For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,
73 or will round down. Range 0~31*550.
74 For MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple of 290,
75 or will round down. Range 0~31*290.
79 The internal RX clock delay (provided by this driver) in nanoseconds.
80 For MT2712 RGMII interface, Allowed value need to be a multiple of 170,
81 or will round down. Range 0~31*170.
82 For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,
83 or will round down. Range 0~31*550.
84 For MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple
85 of 290, or will round down. Range 0~31*290.
90 If present, indicates that the RMII reference clock, which is from external
91 PHYs, is connected to RXC pin. Otherwise, is connected to TXC pin.
93 mediatek,rmii-clk-from-mac:
96 If present, indicates that MAC provides the RMII reference clock, which
97 outputs to TXC pin only.
102 If present, indicates that
103 1. tx clock will be inversed in MII/RGMII case,
104 2. tx clock inside MAC will be inversed relative to reference clock
105 which is from external PHYs in RMII case, and it rarely happen.
106 3. the reference clock, which outputs to TXC pin will be inversed in RMII case
107 when the reference clock is from MAC.
109 mediatek,rxc-inverse:
112 If present, indicates that
113 1. rx clock will be inversed in MII/RGMII case.
114 2. reference clock will be inversed when arrived at MAC in RMII case, when
115 the reference clock is from external PHYs.
116 3. the inside clock, which be sent to MAC, will be inversed in RMII case when
117 the reference clock is from MAC.
122 If present, indicates that MAC supports WOL(Wake-On-LAN), and MAC WOL will be enabled.
123 Otherwise, PHY WOL is perferred.
135 unevaluatedProperties: false
139 #include <dt-bindings/clock/mt2712-clk.h>
140 #include <dt-bindings/gpio/gpio.h>
141 #include <dt-bindings/interrupt-controller/arm-gic.h>
142 #include <dt-bindings/interrupt-controller/irq.h>
143 #include <dt-bindings/power/mt2712-power.h>
145 eth: ethernet@1101c000 {
146 compatible = "mediatek,mt2712-gmac", "snps,dwmac-4.20a";
147 reg = <0x1101c000 0x1300>;
148 interrupts = <GIC_SPI 237 IRQ_TYPE_LEVEL_LOW>;
149 interrupt-names = "macirq";
150 phy-mode ="rgmii-rxid";
151 mac-address = [00 55 7b b5 7d f7];
157 clocks = <&pericfg CLK_PERI_GMAC>,
158 <&pericfg CLK_PERI_GMAC_PCLK>,
159 <&topckgen CLK_TOP_ETHER_125M_SEL>,
160 <&topckgen CLK_TOP_ETHER_50M_SEL>,
161 <&topckgen CLK_TOP_ETHER_50M_RMII_SEL>;
162 assigned-clocks = <&topckgen CLK_TOP_ETHER_125M_SEL>,
163 <&topckgen CLK_TOP_ETHER_50M_SEL>,
164 <&topckgen CLK_TOP_ETHER_50M_RMII_SEL>;
165 assigned-clock-parents = <&topckgen CLK_TOP_ETHERPLL_125M>,
166 <&topckgen CLK_TOP_APLL1_D3>,
167 <&topckgen CLK_TOP_ETHERPLL_50M>;
168 power-domains = <&scpsys MT2712_POWER_DOMAIN_AUDIO>;
169 mediatek,pericfg = <&pericfg>;
170 mediatek,tx-delay-ps = <1530>;
173 snps,reset-gpio = <&pio 87 GPIO_ACTIVE_LOW>;
174 snps,reset-delays-us = <0 10000 10000>;