xref: /freebsd/sys/contrib/device-tree/Bindings/net/dsa/mediatek,mt7530.yaml (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1b97ee269SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2b97ee269SEmmanuel Vadot%YAML 1.2
3b97ee269SEmmanuel Vadot---
4b97ee269SEmmanuel Vadot$id: http://devicetree.org/schemas/net/dsa/mediatek,mt7530.yaml#
5b97ee269SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6b97ee269SEmmanuel Vadot
7*7ef62cebSEmmanuel Vadottitle: Mediatek MT7530 and MT7531 Ethernet Switches
8b97ee269SEmmanuel Vadot
9b97ee269SEmmanuel Vadotmaintainers:
10*7ef62cebSEmmanuel Vadot  - Arınç ÜNAL <arinc.unal@arinc9.com>
11b97ee269SEmmanuel Vadot  - Landen Chao <Landen.Chao@mediatek.com>
12b97ee269SEmmanuel Vadot  - DENG Qingfang <dqfext@gmail.com>
13*7ef62cebSEmmanuel Vadot  - Sean Wang <sean.wang@mediatek.com>
14b97ee269SEmmanuel Vadot
15b97ee269SEmmanuel Vadotdescription: |
16*7ef62cebSEmmanuel Vadot  There are two versions of MT7530, standalone and in a multi-chip module.
17b97ee269SEmmanuel Vadot
18*7ef62cebSEmmanuel Vadot  MT7530 is a part of the multi-chip module in MT7620AN, MT7620DA, MT7620DAN,
19*7ef62cebSEmmanuel Vadot  MT7620NN, MT7621AT, MT7621DAT, MT7621ST and MT7623AI SoCs.
20b97ee269SEmmanuel Vadot
21*7ef62cebSEmmanuel Vadot  MT7530 in MT7620AN, MT7620DA, MT7620DAN and MT7620NN SoCs has got 10/100 PHYs
22*7ef62cebSEmmanuel Vadot  and the switch registers are directly mapped into SoC's memory map rather than
23*7ef62cebSEmmanuel Vadot  using MDIO. The DSA driver currently doesn't support this.
24b97ee269SEmmanuel Vadot
25*7ef62cebSEmmanuel Vadot  There is only the standalone version of MT7531.
26b97ee269SEmmanuel Vadot
27*7ef62cebSEmmanuel Vadot  Port 5 on MT7530 has got various ways of configuration.
28b97ee269SEmmanuel Vadot
29*7ef62cebSEmmanuel Vadot  For standalone MT7530:
30b97ee269SEmmanuel Vadot
31*7ef62cebSEmmanuel Vadot    - Port 5 can be used as a CPU port.
32*7ef62cebSEmmanuel Vadot
33*7ef62cebSEmmanuel Vadot    - PHY 0 or 4 of the switch can be muxed to connect to the gmac of the SoC
34*7ef62cebSEmmanuel Vadot      which port 5 is wired to. Usually used for connecting the wan port
35*7ef62cebSEmmanuel Vadot      directly to the CPU to achieve 2 Gbps routing in total.
36*7ef62cebSEmmanuel Vadot
37*7ef62cebSEmmanuel Vadot      The driver looks up the reg on the ethernet-phy node which the phy-handle
38*7ef62cebSEmmanuel Vadot      property refers to on the gmac node to mux the specified phy.
39*7ef62cebSEmmanuel Vadot
40*7ef62cebSEmmanuel Vadot      The driver requires the gmac of the SoC to have "mediatek,eth-mac" as the
41*7ef62cebSEmmanuel Vadot      compatible string and the reg must be 1. So, for now, only gmac1 of an
42*7ef62cebSEmmanuel Vadot      MediaTek SoC can benefit this. Banana Pi BPI-R2 suits this.
43*7ef62cebSEmmanuel Vadot      Check out example 5 for a similar configuration.
44*7ef62cebSEmmanuel Vadot
45*7ef62cebSEmmanuel Vadot    - Port 5 can be wired to an external phy. Port 5 becomes a DSA slave.
46*7ef62cebSEmmanuel Vadot      Check out example 7 for a similar configuration.
47*7ef62cebSEmmanuel Vadot
48*7ef62cebSEmmanuel Vadot  For multi-chip module MT7530:
49*7ef62cebSEmmanuel Vadot
50*7ef62cebSEmmanuel Vadot    - Port 5 can be used as a CPU port.
51*7ef62cebSEmmanuel Vadot
52*7ef62cebSEmmanuel Vadot    - PHY 0 or 4 of the switch can be muxed to connect to gmac1 of the SoC.
53*7ef62cebSEmmanuel Vadot      Usually used for connecting the wan port directly to the CPU to achieve 2
54*7ef62cebSEmmanuel Vadot      Gbps routing in total.
55*7ef62cebSEmmanuel Vadot
56*7ef62cebSEmmanuel Vadot      The driver looks up the reg on the ethernet-phy node which the phy-handle
57*7ef62cebSEmmanuel Vadot      property refers to on the gmac node to mux the specified phy.
58*7ef62cebSEmmanuel Vadot
59*7ef62cebSEmmanuel Vadot      For the MT7621 SoCs, rgmii2 group must be claimed with rgmii2 function.
60*7ef62cebSEmmanuel Vadot      Check out example 5.
61*7ef62cebSEmmanuel Vadot
62*7ef62cebSEmmanuel Vadot    - In case of an external phy wired to gmac1 of the SoC, port 5 must not be
63*7ef62cebSEmmanuel Vadot      enabled.
64*7ef62cebSEmmanuel Vadot
65*7ef62cebSEmmanuel Vadot      In case of muxing PHY 0 or 4, the external phy must not be enabled.
66*7ef62cebSEmmanuel Vadot
67*7ef62cebSEmmanuel Vadot      For the MT7621 SoCs, rgmii2 group must be claimed with rgmii2 function.
68*7ef62cebSEmmanuel Vadot      Check out example 6.
69*7ef62cebSEmmanuel Vadot
70*7ef62cebSEmmanuel Vadot    - Port 5 can be muxed to an external phy. Port 5 becomes a DSA slave.
71*7ef62cebSEmmanuel Vadot      The external phy must be wired TX to TX to gmac1 of the SoC for this to
72*7ef62cebSEmmanuel Vadot      work. Ubiquiti EdgeRouter X SFP is wired this way.
73*7ef62cebSEmmanuel Vadot
74*7ef62cebSEmmanuel Vadot      Muxing PHY 0 or 4 won't work when the external phy is connected TX to TX.
75*7ef62cebSEmmanuel Vadot
76*7ef62cebSEmmanuel Vadot      For the MT7621 SoCs, rgmii2 group must be claimed with gpio function.
77*7ef62cebSEmmanuel Vadot      Check out example 7.
78b97ee269SEmmanuel Vadot
79b97ee269SEmmanuel Vadotproperties:
80b97ee269SEmmanuel Vadot  compatible:
81*7ef62cebSEmmanuel Vadot    oneOf:
82*7ef62cebSEmmanuel Vadot      - description:
83*7ef62cebSEmmanuel Vadot          Standalone MT7530 and multi-chip module MT7530 in MT7623AI SoC
84*7ef62cebSEmmanuel Vadot        const: mediatek,mt7530
85*7ef62cebSEmmanuel Vadot
86*7ef62cebSEmmanuel Vadot      - description:
87*7ef62cebSEmmanuel Vadot          Standalone MT7531
88*7ef62cebSEmmanuel Vadot        const: mediatek,mt7531
89*7ef62cebSEmmanuel Vadot
90*7ef62cebSEmmanuel Vadot      - description:
91*7ef62cebSEmmanuel Vadot          Multi-chip module MT7530 in MT7621AT, MT7621DAT and MT7621ST SoCs
92*7ef62cebSEmmanuel Vadot        const: mediatek,mt7621
93b97ee269SEmmanuel Vadot
94b97ee269SEmmanuel Vadot  reg:
95b97ee269SEmmanuel Vadot    maxItems: 1
96b97ee269SEmmanuel Vadot
97b97ee269SEmmanuel Vadot  core-supply:
98b97ee269SEmmanuel Vadot    description:
99b97ee269SEmmanuel Vadot      Phandle to the regulator node necessary for the core power.
100b97ee269SEmmanuel Vadot
101b97ee269SEmmanuel Vadot  "#gpio-cells":
102b97ee269SEmmanuel Vadot    const: 2
103b97ee269SEmmanuel Vadot
104b97ee269SEmmanuel Vadot  gpio-controller:
105b97ee269SEmmanuel Vadot    type: boolean
106b97ee269SEmmanuel Vadot    description:
107*7ef62cebSEmmanuel Vadot      If defined, LED controller of the MT7530 switch will run on GPIO mode.
108*7ef62cebSEmmanuel Vadot
109*7ef62cebSEmmanuel Vadot      There are 15 controllable pins.
110*7ef62cebSEmmanuel Vadot      port 0 LED 0..2 as GPIO 0..2
111*7ef62cebSEmmanuel Vadot      port 1 LED 0..2 as GPIO 3..5
112*7ef62cebSEmmanuel Vadot      port 2 LED 0..2 as GPIO 6..8
113*7ef62cebSEmmanuel Vadot      port 3 LED 0..2 as GPIO 9..11
114*7ef62cebSEmmanuel Vadot      port 4 LED 0..2 as GPIO 12..14
115b97ee269SEmmanuel Vadot
116b97ee269SEmmanuel Vadot  "#interrupt-cells":
117b97ee269SEmmanuel Vadot    const: 1
118b97ee269SEmmanuel Vadot
119b97ee269SEmmanuel Vadot  interrupt-controller: true
120b97ee269SEmmanuel Vadot
121b97ee269SEmmanuel Vadot  interrupts:
122b97ee269SEmmanuel Vadot    maxItems: 1
123b97ee269SEmmanuel Vadot
124b97ee269SEmmanuel Vadot  io-supply:
125b97ee269SEmmanuel Vadot    description:
126b97ee269SEmmanuel Vadot      Phandle to the regulator node necessary for the I/O power.
127*7ef62cebSEmmanuel Vadot      See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt for
128*7ef62cebSEmmanuel Vadot      details for the regulator setup on these boards.
129b97ee269SEmmanuel Vadot
130b97ee269SEmmanuel Vadot  mediatek,mcm:
131b97ee269SEmmanuel Vadot    type: boolean
132b97ee269SEmmanuel Vadot    description:
133*7ef62cebSEmmanuel Vadot      Used for MT7621AT, MT7621DAT, MT7621ST and MT7623AI SoCs which the MT7530
134*7ef62cebSEmmanuel Vadot      switch is a part of the multi-chip module.
135b97ee269SEmmanuel Vadot
136b97ee269SEmmanuel Vadot  reset-gpios:
137*7ef62cebSEmmanuel Vadot    description:
138*7ef62cebSEmmanuel Vadot      GPIO to reset the switch. Use this if mediatek,mcm is not used.
139*7ef62cebSEmmanuel Vadot      This property is optional because some boards share the reset line with
140*7ef62cebSEmmanuel Vadot      other components which makes it impossible to probe the switch if the
141*7ef62cebSEmmanuel Vadot      reset line is used.
142b97ee269SEmmanuel Vadot    maxItems: 1
143b97ee269SEmmanuel Vadot
144b97ee269SEmmanuel Vadot  reset-names:
145b97ee269SEmmanuel Vadot    const: mcm
146b97ee269SEmmanuel Vadot
147b97ee269SEmmanuel Vadot  resets:
148b97ee269SEmmanuel Vadot    description:
149*7ef62cebSEmmanuel Vadot      Phandle pointing to the system reset controller with line index for the
150*7ef62cebSEmmanuel Vadot      ethsys.
151b97ee269SEmmanuel Vadot    maxItems: 1
152b97ee269SEmmanuel Vadot
153b97ee269SEmmanuel VadotpatternProperties:
154b97ee269SEmmanuel Vadot  "^(ethernet-)?ports$":
155b97ee269SEmmanuel Vadot    type: object
156b97ee269SEmmanuel Vadot
157b97ee269SEmmanuel Vadot    patternProperties:
158b97ee269SEmmanuel Vadot      "^(ethernet-)?port@[0-9]+$":
159b97ee269SEmmanuel Vadot        type: object
160b97ee269SEmmanuel Vadot        description: Ethernet switch ports
161b97ee269SEmmanuel Vadot
162b97ee269SEmmanuel Vadot        unevaluatedProperties: false
163b97ee269SEmmanuel Vadot
164b97ee269SEmmanuel Vadot        properties:
165b97ee269SEmmanuel Vadot          reg:
166b97ee269SEmmanuel Vadot            description:
167*7ef62cebSEmmanuel Vadot              Port address described must be 5 or 6 for CPU port and from 0 to 5
168*7ef62cebSEmmanuel Vadot              for user ports.
169b97ee269SEmmanuel Vadot
170b97ee269SEmmanuel Vadot        allOf:
171b97ee269SEmmanuel Vadot          - $ref: dsa-port.yaml#
172b97ee269SEmmanuel Vadot          - if:
173*7ef62cebSEmmanuel Vadot              required: [ ethernet ]
174b97ee269SEmmanuel Vadot            then:
175*7ef62cebSEmmanuel Vadot              properties:
176*7ef62cebSEmmanuel Vadot                reg:
177*7ef62cebSEmmanuel Vadot                  enum:
178*7ef62cebSEmmanuel Vadot                    - 5
179*7ef62cebSEmmanuel Vadot                    - 6
180b97ee269SEmmanuel Vadot
181b97ee269SEmmanuel Vadotrequired:
182b97ee269SEmmanuel Vadot  - compatible
183b97ee269SEmmanuel Vadot  - reg
184b97ee269SEmmanuel Vadot
185*7ef62cebSEmmanuel Vadot$defs:
186*7ef62cebSEmmanuel Vadot  mt7530-dsa-port:
187*7ef62cebSEmmanuel Vadot    patternProperties:
188*7ef62cebSEmmanuel Vadot      "^(ethernet-)?ports$":
189*7ef62cebSEmmanuel Vadot        patternProperties:
190*7ef62cebSEmmanuel Vadot          "^(ethernet-)?port@[0-9]+$":
191*7ef62cebSEmmanuel Vadot            if:
192*7ef62cebSEmmanuel Vadot              required: [ ethernet ]
193*7ef62cebSEmmanuel Vadot            then:
194*7ef62cebSEmmanuel Vadot              if:
195*7ef62cebSEmmanuel Vadot                properties:
196*7ef62cebSEmmanuel Vadot                  reg:
197*7ef62cebSEmmanuel Vadot                    const: 5
198*7ef62cebSEmmanuel Vadot              then:
199*7ef62cebSEmmanuel Vadot                properties:
200*7ef62cebSEmmanuel Vadot                  phy-mode:
201*7ef62cebSEmmanuel Vadot                    enum:
202*7ef62cebSEmmanuel Vadot                      - gmii
203*7ef62cebSEmmanuel Vadot                      - mii
204*7ef62cebSEmmanuel Vadot                      - rgmii
205*7ef62cebSEmmanuel Vadot              else:
206*7ef62cebSEmmanuel Vadot                properties:
207*7ef62cebSEmmanuel Vadot                  phy-mode:
208*7ef62cebSEmmanuel Vadot                    enum:
209*7ef62cebSEmmanuel Vadot                      - rgmii
210*7ef62cebSEmmanuel Vadot                      - trgmii
211*7ef62cebSEmmanuel Vadot
212*7ef62cebSEmmanuel Vadot  mt7531-dsa-port:
213*7ef62cebSEmmanuel Vadot    patternProperties:
214*7ef62cebSEmmanuel Vadot      "^(ethernet-)?ports$":
215*7ef62cebSEmmanuel Vadot        patternProperties:
216*7ef62cebSEmmanuel Vadot          "^(ethernet-)?port@[0-9]+$":
217*7ef62cebSEmmanuel Vadot            if:
218*7ef62cebSEmmanuel Vadot              required: [ ethernet ]
219*7ef62cebSEmmanuel Vadot            then:
220*7ef62cebSEmmanuel Vadot              if:
221*7ef62cebSEmmanuel Vadot                properties:
222*7ef62cebSEmmanuel Vadot                  reg:
223*7ef62cebSEmmanuel Vadot                    const: 5
224*7ef62cebSEmmanuel Vadot              then:
225*7ef62cebSEmmanuel Vadot                properties:
226*7ef62cebSEmmanuel Vadot                  phy-mode:
227*7ef62cebSEmmanuel Vadot                    enum:
228*7ef62cebSEmmanuel Vadot                      - 1000base-x
229*7ef62cebSEmmanuel Vadot                      - 2500base-x
230*7ef62cebSEmmanuel Vadot                      - rgmii
231*7ef62cebSEmmanuel Vadot                      - sgmii
232*7ef62cebSEmmanuel Vadot              else:
233*7ef62cebSEmmanuel Vadot                properties:
234*7ef62cebSEmmanuel Vadot                  phy-mode:
235*7ef62cebSEmmanuel Vadot                    enum:
236*7ef62cebSEmmanuel Vadot                      - 1000base-x
237*7ef62cebSEmmanuel Vadot                      - 2500base-x
238*7ef62cebSEmmanuel Vadot                      - sgmii
239*7ef62cebSEmmanuel Vadot
240b97ee269SEmmanuel VadotallOf:
241*7ef62cebSEmmanuel Vadot  - $ref: dsa.yaml#
242b97ee269SEmmanuel Vadot  - if:
243b97ee269SEmmanuel Vadot      required:
244b97ee269SEmmanuel Vadot        - mediatek,mcm
245b97ee269SEmmanuel Vadot    then:
246*7ef62cebSEmmanuel Vadot      properties:
247*7ef62cebSEmmanuel Vadot        reset-gpios: false
248*7ef62cebSEmmanuel Vadot
249b97ee269SEmmanuel Vadot      required:
250b97ee269SEmmanuel Vadot        - resets
251b97ee269SEmmanuel Vadot        - reset-names
252b97ee269SEmmanuel Vadot
253b97ee269SEmmanuel Vadot  - dependencies:
254b97ee269SEmmanuel Vadot      interrupt-controller: [ interrupts ]
255b97ee269SEmmanuel Vadot
256b97ee269SEmmanuel Vadot  - if:
257b97ee269SEmmanuel Vadot      properties:
258b97ee269SEmmanuel Vadot        compatible:
259*7ef62cebSEmmanuel Vadot          const: mediatek,mt7530
260b97ee269SEmmanuel Vadot    then:
261*7ef62cebSEmmanuel Vadot      $ref: "#/$defs/mt7530-dsa-port"
262b97ee269SEmmanuel Vadot      required:
263b97ee269SEmmanuel Vadot        - core-supply
264b97ee269SEmmanuel Vadot        - io-supply
265b97ee269SEmmanuel Vadot
266*7ef62cebSEmmanuel Vadot  - if:
267*7ef62cebSEmmanuel Vadot      properties:
268*7ef62cebSEmmanuel Vadot        compatible:
269*7ef62cebSEmmanuel Vadot          const: mediatek,mt7531
270*7ef62cebSEmmanuel Vadot    then:
271*7ef62cebSEmmanuel Vadot      $ref: "#/$defs/mt7531-dsa-port"
272*7ef62cebSEmmanuel Vadot      properties:
273*7ef62cebSEmmanuel Vadot        gpio-controller: false
274*7ef62cebSEmmanuel Vadot        mediatek,mcm: false
275*7ef62cebSEmmanuel Vadot
276*7ef62cebSEmmanuel Vadot  - if:
277*7ef62cebSEmmanuel Vadot      properties:
278*7ef62cebSEmmanuel Vadot        compatible:
279*7ef62cebSEmmanuel Vadot          const: mediatek,mt7621
280*7ef62cebSEmmanuel Vadot    then:
281*7ef62cebSEmmanuel Vadot      $ref: "#/$defs/mt7530-dsa-port"
282*7ef62cebSEmmanuel Vadot      required:
283*7ef62cebSEmmanuel Vadot        - mediatek,mcm
284*7ef62cebSEmmanuel Vadot
285b97ee269SEmmanuel VadotunevaluatedProperties: false
286b97ee269SEmmanuel Vadot
287b97ee269SEmmanuel Vadotexamples:
288*7ef62cebSEmmanuel Vadot  # Example 1: Standalone MT7530
289b97ee269SEmmanuel Vadot  - |
290b97ee269SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
291*7ef62cebSEmmanuel Vadot
292b97ee269SEmmanuel Vadot    mdio {
293b97ee269SEmmanuel Vadot        #address-cells = <1>;
294b97ee269SEmmanuel Vadot        #size-cells = <0>;
295*7ef62cebSEmmanuel Vadot
296*7ef62cebSEmmanuel Vadot        switch@1f {
297b97ee269SEmmanuel Vadot            compatible = "mediatek,mt7530";
298*7ef62cebSEmmanuel Vadot            reg = <0x1f>;
299*7ef62cebSEmmanuel Vadot
300*7ef62cebSEmmanuel Vadot            reset-gpios = <&pio 33 0>;
301b97ee269SEmmanuel Vadot
302b97ee269SEmmanuel Vadot            core-supply = <&mt6323_vpa_reg>;
303b97ee269SEmmanuel Vadot            io-supply = <&mt6323_vemc3v3_reg>;
304b97ee269SEmmanuel Vadot
305b97ee269SEmmanuel Vadot            ethernet-ports {
306b97ee269SEmmanuel Vadot                #address-cells = <1>;
307b97ee269SEmmanuel Vadot                #size-cells = <0>;
308*7ef62cebSEmmanuel Vadot
309b97ee269SEmmanuel Vadot                port@0 {
310b97ee269SEmmanuel Vadot                    reg = <0>;
311*7ef62cebSEmmanuel Vadot                    label = "lan1";
312b97ee269SEmmanuel Vadot                };
313b97ee269SEmmanuel Vadot
314b97ee269SEmmanuel Vadot                port@1 {
315b97ee269SEmmanuel Vadot                    reg = <1>;
316*7ef62cebSEmmanuel Vadot                    label = "lan2";
317b97ee269SEmmanuel Vadot                };
318b97ee269SEmmanuel Vadot
319b97ee269SEmmanuel Vadot                port@2 {
320b97ee269SEmmanuel Vadot                    reg = <2>;
321*7ef62cebSEmmanuel Vadot                    label = "lan3";
322b97ee269SEmmanuel Vadot                };
323b97ee269SEmmanuel Vadot
324b97ee269SEmmanuel Vadot                port@3 {
325b97ee269SEmmanuel Vadot                    reg = <3>;
326*7ef62cebSEmmanuel Vadot                    label = "lan4";
327b97ee269SEmmanuel Vadot                };
328b97ee269SEmmanuel Vadot
329b97ee269SEmmanuel Vadot                port@4 {
330b97ee269SEmmanuel Vadot                    reg = <4>;
331b97ee269SEmmanuel Vadot                    label = "wan";
332b97ee269SEmmanuel Vadot                };
333b97ee269SEmmanuel Vadot
334b97ee269SEmmanuel Vadot                port@6 {
335b97ee269SEmmanuel Vadot                    reg = <6>;
336b97ee269SEmmanuel Vadot                    ethernet = <&gmac0>;
337b97ee269SEmmanuel Vadot                    phy-mode = "rgmii";
338b97ee269SEmmanuel Vadot
339b97ee269SEmmanuel Vadot                    fixed-link {
340b97ee269SEmmanuel Vadot                        speed = <1000>;
341b97ee269SEmmanuel Vadot                        full-duplex;
342b97ee269SEmmanuel Vadot                        pause;
343b97ee269SEmmanuel Vadot                    };
344b97ee269SEmmanuel Vadot                };
345*7ef62cebSEmmanuel Vadot            };
346*7ef62cebSEmmanuel Vadot        };
347b97ee269SEmmanuel Vadot    };
348b97ee269SEmmanuel Vadot
349*7ef62cebSEmmanuel Vadot  # Example 2: MT7530 in MT7623AI SoC
350*7ef62cebSEmmanuel Vadot  - |
351*7ef62cebSEmmanuel Vadot    #include <dt-bindings/reset/mt2701-resets.h>
352*7ef62cebSEmmanuel Vadot
353*7ef62cebSEmmanuel Vadot    mdio {
354b97ee269SEmmanuel Vadot        #address-cells = <1>;
355b97ee269SEmmanuel Vadot        #size-cells = <0>;
356b97ee269SEmmanuel Vadot
357*7ef62cebSEmmanuel Vadot        switch@1f {
358*7ef62cebSEmmanuel Vadot            compatible = "mediatek,mt7530";
359b97ee269SEmmanuel Vadot            reg = <0x1f>;
360b97ee269SEmmanuel Vadot
361*7ef62cebSEmmanuel Vadot            mediatek,mcm;
362*7ef62cebSEmmanuel Vadot            resets = <&ethsys MT2701_ETHSYS_MCM_RST>;
363b97ee269SEmmanuel Vadot            reset-names = "mcm";
364b97ee269SEmmanuel Vadot
365*7ef62cebSEmmanuel Vadot            core-supply = <&mt6323_vpa_reg>;
366*7ef62cebSEmmanuel Vadot            io-supply = <&mt6323_vemc3v3_reg>;
367*7ef62cebSEmmanuel Vadot
368b97ee269SEmmanuel Vadot            ethernet-ports {
369b97ee269SEmmanuel Vadot                #address-cells = <1>;
370b97ee269SEmmanuel Vadot                #size-cells = <0>;
371b97ee269SEmmanuel Vadot
372b97ee269SEmmanuel Vadot                port@0 {
373b97ee269SEmmanuel Vadot                    reg = <0>;
374*7ef62cebSEmmanuel Vadot                    label = "lan1";
375b97ee269SEmmanuel Vadot                };
376b97ee269SEmmanuel Vadot
377b97ee269SEmmanuel Vadot                port@1 {
378b97ee269SEmmanuel Vadot                    reg = <1>;
379*7ef62cebSEmmanuel Vadot                    label = "lan2";
380b97ee269SEmmanuel Vadot                };
381b97ee269SEmmanuel Vadot
382b97ee269SEmmanuel Vadot                port@2 {
383b97ee269SEmmanuel Vadot                    reg = <2>;
384*7ef62cebSEmmanuel Vadot                    label = "lan3";
385b97ee269SEmmanuel Vadot                };
386b97ee269SEmmanuel Vadot
387b97ee269SEmmanuel Vadot                port@3 {
388b97ee269SEmmanuel Vadot                    reg = <3>;
389b97ee269SEmmanuel Vadot                    label = "lan4";
390b97ee269SEmmanuel Vadot                };
391*7ef62cebSEmmanuel Vadot
392*7ef62cebSEmmanuel Vadot                port@4 {
393*7ef62cebSEmmanuel Vadot                    reg = <4>;
394*7ef62cebSEmmanuel Vadot                    label = "wan";
395*7ef62cebSEmmanuel Vadot                };
396b97ee269SEmmanuel Vadot
397b97ee269SEmmanuel Vadot                port@6 {
398b97ee269SEmmanuel Vadot                    reg = <6>;
399b97ee269SEmmanuel Vadot                    ethernet = <&gmac0>;
400*7ef62cebSEmmanuel Vadot                    phy-mode = "trgmii";
401b97ee269SEmmanuel Vadot
402b97ee269SEmmanuel Vadot                    fixed-link {
403b97ee269SEmmanuel Vadot                        speed = <1000>;
404b97ee269SEmmanuel Vadot                        full-duplex;
405b97ee269SEmmanuel Vadot                        pause;
406b97ee269SEmmanuel Vadot                    };
407b97ee269SEmmanuel Vadot                };
408b97ee269SEmmanuel Vadot            };
409b97ee269SEmmanuel Vadot        };
410b97ee269SEmmanuel Vadot    };
411*7ef62cebSEmmanuel Vadot
412*7ef62cebSEmmanuel Vadot  # Example 3: Standalone MT7531
413*7ef62cebSEmmanuel Vadot  - |
414*7ef62cebSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
415*7ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
416*7ef62cebSEmmanuel Vadot
417*7ef62cebSEmmanuel Vadot    mdio {
418*7ef62cebSEmmanuel Vadot        #address-cells = <1>;
419*7ef62cebSEmmanuel Vadot        #size-cells = <0>;
420*7ef62cebSEmmanuel Vadot
421*7ef62cebSEmmanuel Vadot        switch@0 {
422*7ef62cebSEmmanuel Vadot            compatible = "mediatek,mt7531";
423*7ef62cebSEmmanuel Vadot            reg = <0>;
424*7ef62cebSEmmanuel Vadot
425*7ef62cebSEmmanuel Vadot            reset-gpios = <&pio 54 0>;
426*7ef62cebSEmmanuel Vadot
427*7ef62cebSEmmanuel Vadot            interrupt-controller;
428*7ef62cebSEmmanuel Vadot            #interrupt-cells = <1>;
429*7ef62cebSEmmanuel Vadot            interrupt-parent = <&pio>;
430*7ef62cebSEmmanuel Vadot            interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
431*7ef62cebSEmmanuel Vadot
432*7ef62cebSEmmanuel Vadot            ethernet-ports {
433*7ef62cebSEmmanuel Vadot                #address-cells = <1>;
434*7ef62cebSEmmanuel Vadot                #size-cells = <0>;
435*7ef62cebSEmmanuel Vadot
436*7ef62cebSEmmanuel Vadot                port@0 {
437*7ef62cebSEmmanuel Vadot                    reg = <0>;
438*7ef62cebSEmmanuel Vadot                    label = "lan1";
439b97ee269SEmmanuel Vadot                };
440b97ee269SEmmanuel Vadot
441*7ef62cebSEmmanuel Vadot                port@1 {
442*7ef62cebSEmmanuel Vadot                    reg = <1>;
443*7ef62cebSEmmanuel Vadot                    label = "lan2";
444*7ef62cebSEmmanuel Vadot                };
445*7ef62cebSEmmanuel Vadot
446*7ef62cebSEmmanuel Vadot                port@2 {
447*7ef62cebSEmmanuel Vadot                    reg = <2>;
448*7ef62cebSEmmanuel Vadot                    label = "lan3";
449*7ef62cebSEmmanuel Vadot                };
450*7ef62cebSEmmanuel Vadot
451*7ef62cebSEmmanuel Vadot                port@3 {
452*7ef62cebSEmmanuel Vadot                    reg = <3>;
453*7ef62cebSEmmanuel Vadot                    label = "lan4";
454*7ef62cebSEmmanuel Vadot                };
455*7ef62cebSEmmanuel Vadot
456*7ef62cebSEmmanuel Vadot                port@4 {
457*7ef62cebSEmmanuel Vadot                    reg = <4>;
458*7ef62cebSEmmanuel Vadot                    label = "wan";
459*7ef62cebSEmmanuel Vadot                };
460*7ef62cebSEmmanuel Vadot
461*7ef62cebSEmmanuel Vadot                port@6 {
462*7ef62cebSEmmanuel Vadot                    reg = <6>;
463*7ef62cebSEmmanuel Vadot                    ethernet = <&gmac0>;
464*7ef62cebSEmmanuel Vadot                    phy-mode = "2500base-x";
465*7ef62cebSEmmanuel Vadot
466*7ef62cebSEmmanuel Vadot                    fixed-link {
467*7ef62cebSEmmanuel Vadot                        speed = <2500>;
468*7ef62cebSEmmanuel Vadot                        full-duplex;
469*7ef62cebSEmmanuel Vadot                        pause;
470*7ef62cebSEmmanuel Vadot                    };
471*7ef62cebSEmmanuel Vadot                };
472*7ef62cebSEmmanuel Vadot            };
473*7ef62cebSEmmanuel Vadot        };
474*7ef62cebSEmmanuel Vadot    };
475*7ef62cebSEmmanuel Vadot
476*7ef62cebSEmmanuel Vadot  # Example 4: MT7530 in MT7621AT, MT7621DAT and MT7621ST SoCs
477b97ee269SEmmanuel Vadot  - |
478*7ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/mips-gic.h>
479*7ef62cebSEmmanuel Vadot    #include <dt-bindings/reset/mt7621-reset.h>
480*7ef62cebSEmmanuel Vadot
481*7ef62cebSEmmanuel Vadot    mdio {
482*7ef62cebSEmmanuel Vadot        #address-cells = <1>;
483*7ef62cebSEmmanuel Vadot        #size-cells = <0>;
484*7ef62cebSEmmanuel Vadot
485*7ef62cebSEmmanuel Vadot        switch@1f {
486*7ef62cebSEmmanuel Vadot            compatible = "mediatek,mt7621";
487*7ef62cebSEmmanuel Vadot            reg = <0x1f>;
488*7ef62cebSEmmanuel Vadot
489*7ef62cebSEmmanuel Vadot            mediatek,mcm;
490*7ef62cebSEmmanuel Vadot            resets = <&sysc MT7621_RST_MCM>;
491*7ef62cebSEmmanuel Vadot            reset-names = "mcm";
492*7ef62cebSEmmanuel Vadot
493*7ef62cebSEmmanuel Vadot            interrupt-controller;
494*7ef62cebSEmmanuel Vadot            #interrupt-cells = <1>;
495*7ef62cebSEmmanuel Vadot            interrupt-parent = <&gic>;
496*7ef62cebSEmmanuel Vadot            interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
497*7ef62cebSEmmanuel Vadot
498*7ef62cebSEmmanuel Vadot            ethernet-ports {
499*7ef62cebSEmmanuel Vadot                #address-cells = <1>;
500*7ef62cebSEmmanuel Vadot                #size-cells = <0>;
501*7ef62cebSEmmanuel Vadot
502*7ef62cebSEmmanuel Vadot                port@0 {
503*7ef62cebSEmmanuel Vadot                    reg = <0>;
504*7ef62cebSEmmanuel Vadot                    label = "lan1";
505*7ef62cebSEmmanuel Vadot                };
506*7ef62cebSEmmanuel Vadot
507*7ef62cebSEmmanuel Vadot                port@1 {
508*7ef62cebSEmmanuel Vadot                    reg = <1>;
509*7ef62cebSEmmanuel Vadot                    label = "lan2";
510*7ef62cebSEmmanuel Vadot                };
511*7ef62cebSEmmanuel Vadot
512*7ef62cebSEmmanuel Vadot                port@2 {
513*7ef62cebSEmmanuel Vadot                    reg = <2>;
514*7ef62cebSEmmanuel Vadot                    label = "lan3";
515*7ef62cebSEmmanuel Vadot                };
516*7ef62cebSEmmanuel Vadot
517*7ef62cebSEmmanuel Vadot                port@3 {
518*7ef62cebSEmmanuel Vadot                    reg = <3>;
519*7ef62cebSEmmanuel Vadot                    label = "lan4";
520*7ef62cebSEmmanuel Vadot                };
521*7ef62cebSEmmanuel Vadot
522*7ef62cebSEmmanuel Vadot                port@4 {
523*7ef62cebSEmmanuel Vadot                    reg = <4>;
524*7ef62cebSEmmanuel Vadot                    label = "wan";
525*7ef62cebSEmmanuel Vadot                };
526*7ef62cebSEmmanuel Vadot
527*7ef62cebSEmmanuel Vadot                port@6 {
528*7ef62cebSEmmanuel Vadot                    reg = <6>;
529*7ef62cebSEmmanuel Vadot                    ethernet = <&gmac0>;
530*7ef62cebSEmmanuel Vadot                    phy-mode = "trgmii";
531*7ef62cebSEmmanuel Vadot
532*7ef62cebSEmmanuel Vadot                    fixed-link {
533*7ef62cebSEmmanuel Vadot                        speed = <1000>;
534*7ef62cebSEmmanuel Vadot                        full-duplex;
535*7ef62cebSEmmanuel Vadot                        pause;
536*7ef62cebSEmmanuel Vadot                    };
537*7ef62cebSEmmanuel Vadot                };
538*7ef62cebSEmmanuel Vadot            };
539*7ef62cebSEmmanuel Vadot        };
540*7ef62cebSEmmanuel Vadot    };
541*7ef62cebSEmmanuel Vadot
542*7ef62cebSEmmanuel Vadot  # Example 5: MT7621: mux MT7530's phy4 to SoC's gmac1
543*7ef62cebSEmmanuel Vadot  - |
544*7ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/mips-gic.h>
545*7ef62cebSEmmanuel Vadot    #include <dt-bindings/reset/mt7621-reset.h>
546b97ee269SEmmanuel Vadot
547b97ee269SEmmanuel Vadot    ethernet {
548b97ee269SEmmanuel Vadot        #address-cells = <1>;
549b97ee269SEmmanuel Vadot        #size-cells = <0>;
550*7ef62cebSEmmanuel Vadot
551*7ef62cebSEmmanuel Vadot        pinctrl-names = "default";
552*7ef62cebSEmmanuel Vadot        pinctrl-0 = <&rgmii2_pins>;
553*7ef62cebSEmmanuel Vadot
554*7ef62cebSEmmanuel Vadot        mac@1 {
555b97ee269SEmmanuel Vadot            compatible = "mediatek,eth-mac";
556*7ef62cebSEmmanuel Vadot            reg = <1>;
557*7ef62cebSEmmanuel Vadot
558b97ee269SEmmanuel Vadot            phy-mode = "rgmii";
559*7ef62cebSEmmanuel Vadot            phy-handle = <&example5_ethphy4>;
560b97ee269SEmmanuel Vadot        };
561b97ee269SEmmanuel Vadot
562*7ef62cebSEmmanuel Vadot        mdio {
563b97ee269SEmmanuel Vadot            #address-cells = <1>;
564b97ee269SEmmanuel Vadot            #size-cells = <0>;
565b97ee269SEmmanuel Vadot
566*7ef62cebSEmmanuel Vadot            /* MT7530's phy4 */
567*7ef62cebSEmmanuel Vadot            example5_ethphy4: ethernet-phy@4 {
568*7ef62cebSEmmanuel Vadot                reg = <4>;
569b97ee269SEmmanuel Vadot            };
570b97ee269SEmmanuel Vadot
571b97ee269SEmmanuel Vadot            switch@1f {
572b97ee269SEmmanuel Vadot                compatible = "mediatek,mt7621";
573b97ee269SEmmanuel Vadot                reg = <0x1f>;
574b97ee269SEmmanuel Vadot
575*7ef62cebSEmmanuel Vadot                mediatek,mcm;
576*7ef62cebSEmmanuel Vadot                resets = <&sysc MT7621_RST_MCM>;
577b97ee269SEmmanuel Vadot                reset-names = "mcm";
578b97ee269SEmmanuel Vadot
579*7ef62cebSEmmanuel Vadot                interrupt-controller;
580*7ef62cebSEmmanuel Vadot                #interrupt-cells = <1>;
581*7ef62cebSEmmanuel Vadot                interrupt-parent = <&gic>;
582*7ef62cebSEmmanuel Vadot                interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
583*7ef62cebSEmmanuel Vadot
584b97ee269SEmmanuel Vadot                ethernet-ports {
585b97ee269SEmmanuel Vadot                    #address-cells = <1>;
586b97ee269SEmmanuel Vadot                    #size-cells = <0>;
587b97ee269SEmmanuel Vadot
588b97ee269SEmmanuel Vadot                    port@0 {
589b97ee269SEmmanuel Vadot                        reg = <0>;
590*7ef62cebSEmmanuel Vadot                        label = "lan1";
591b97ee269SEmmanuel Vadot                    };
592b97ee269SEmmanuel Vadot
593b97ee269SEmmanuel Vadot                    port@1 {
594b97ee269SEmmanuel Vadot                        reg = <1>;
595*7ef62cebSEmmanuel Vadot                        label = "lan2";
596b97ee269SEmmanuel Vadot                    };
597b97ee269SEmmanuel Vadot
598b97ee269SEmmanuel Vadot                    port@2 {
599b97ee269SEmmanuel Vadot                        reg = <2>;
600*7ef62cebSEmmanuel Vadot                        label = "lan3";
601b97ee269SEmmanuel Vadot                    };
602b97ee269SEmmanuel Vadot
603b97ee269SEmmanuel Vadot                    port@3 {
604b97ee269SEmmanuel Vadot                        reg = <3>;
605*7ef62cebSEmmanuel Vadot                        label = "lan4";
606*7ef62cebSEmmanuel Vadot                    };
607*7ef62cebSEmmanuel Vadot
608*7ef62cebSEmmanuel Vadot                    /* Commented out, phy4 is muxed to gmac1.
609*7ef62cebSEmmanuel Vadot                    port@4 {
610*7ef62cebSEmmanuel Vadot                        reg = <4>;
611*7ef62cebSEmmanuel Vadot                        label = "wan";
612*7ef62cebSEmmanuel Vadot                    };
613*7ef62cebSEmmanuel Vadot                    */
614*7ef62cebSEmmanuel Vadot
615*7ef62cebSEmmanuel Vadot                    port@6 {
616*7ef62cebSEmmanuel Vadot                        reg = <6>;
617*7ef62cebSEmmanuel Vadot                        ethernet = <&gmac0>;
618*7ef62cebSEmmanuel Vadot                        phy-mode = "trgmii";
619*7ef62cebSEmmanuel Vadot
620*7ef62cebSEmmanuel Vadot                        fixed-link {
621*7ef62cebSEmmanuel Vadot                            speed = <1000>;
622*7ef62cebSEmmanuel Vadot                            full-duplex;
623*7ef62cebSEmmanuel Vadot                            pause;
624*7ef62cebSEmmanuel Vadot                        };
625*7ef62cebSEmmanuel Vadot                    };
626*7ef62cebSEmmanuel Vadot                };
627*7ef62cebSEmmanuel Vadot            };
628*7ef62cebSEmmanuel Vadot        };
629*7ef62cebSEmmanuel Vadot    };
630*7ef62cebSEmmanuel Vadot
631*7ef62cebSEmmanuel Vadot  # Example 6: MT7621: mux external phy to SoC's gmac1
632*7ef62cebSEmmanuel Vadot  - |
633*7ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/mips-gic.h>
634*7ef62cebSEmmanuel Vadot    #include <dt-bindings/reset/mt7621-reset.h>
635*7ef62cebSEmmanuel Vadot
636*7ef62cebSEmmanuel Vadot    ethernet {
637*7ef62cebSEmmanuel Vadot        #address-cells = <1>;
638*7ef62cebSEmmanuel Vadot        #size-cells = <0>;
639*7ef62cebSEmmanuel Vadot
640*7ef62cebSEmmanuel Vadot        pinctrl-names = "default";
641*7ef62cebSEmmanuel Vadot        pinctrl-0 = <&rgmii2_pins>;
642*7ef62cebSEmmanuel Vadot
643*7ef62cebSEmmanuel Vadot        mac@1 {
644*7ef62cebSEmmanuel Vadot            compatible = "mediatek,eth-mac";
645*7ef62cebSEmmanuel Vadot            reg = <1>;
646*7ef62cebSEmmanuel Vadot
647*7ef62cebSEmmanuel Vadot            phy-mode = "rgmii";
648*7ef62cebSEmmanuel Vadot            phy-handle = <&example6_ethphy7>;
649*7ef62cebSEmmanuel Vadot        };
650*7ef62cebSEmmanuel Vadot
651*7ef62cebSEmmanuel Vadot        mdio {
652*7ef62cebSEmmanuel Vadot            #address-cells = <1>;
653*7ef62cebSEmmanuel Vadot            #size-cells = <0>;
654*7ef62cebSEmmanuel Vadot
655*7ef62cebSEmmanuel Vadot            /* External PHY */
656*7ef62cebSEmmanuel Vadot            example6_ethphy7: ethernet-phy@7 {
657*7ef62cebSEmmanuel Vadot                reg = <7>;
658*7ef62cebSEmmanuel Vadot                phy-mode = "rgmii";
659*7ef62cebSEmmanuel Vadot            };
660*7ef62cebSEmmanuel Vadot
661*7ef62cebSEmmanuel Vadot            switch@1f {
662*7ef62cebSEmmanuel Vadot                compatible = "mediatek,mt7621";
663*7ef62cebSEmmanuel Vadot                reg = <0x1f>;
664*7ef62cebSEmmanuel Vadot
665*7ef62cebSEmmanuel Vadot                mediatek,mcm;
666*7ef62cebSEmmanuel Vadot                resets = <&sysc MT7621_RST_MCM>;
667*7ef62cebSEmmanuel Vadot                reset-names = "mcm";
668*7ef62cebSEmmanuel Vadot
669*7ef62cebSEmmanuel Vadot                interrupt-controller;
670*7ef62cebSEmmanuel Vadot                #interrupt-cells = <1>;
671*7ef62cebSEmmanuel Vadot                interrupt-parent = <&gic>;
672*7ef62cebSEmmanuel Vadot                interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
673*7ef62cebSEmmanuel Vadot
674*7ef62cebSEmmanuel Vadot                ethernet-ports {
675*7ef62cebSEmmanuel Vadot                    #address-cells = <1>;
676*7ef62cebSEmmanuel Vadot                    #size-cells = <0>;
677*7ef62cebSEmmanuel Vadot
678*7ef62cebSEmmanuel Vadot                    port@0 {
679*7ef62cebSEmmanuel Vadot                        reg = <0>;
680*7ef62cebSEmmanuel Vadot                        label = "lan1";
681*7ef62cebSEmmanuel Vadot                    };
682*7ef62cebSEmmanuel Vadot
683*7ef62cebSEmmanuel Vadot                    port@1 {
684*7ef62cebSEmmanuel Vadot                        reg = <1>;
685*7ef62cebSEmmanuel Vadot                        label = "lan2";
686*7ef62cebSEmmanuel Vadot                    };
687*7ef62cebSEmmanuel Vadot
688*7ef62cebSEmmanuel Vadot                    port@2 {
689*7ef62cebSEmmanuel Vadot                        reg = <2>;
690b97ee269SEmmanuel Vadot                        label = "lan3";
691b97ee269SEmmanuel Vadot                    };
692b97ee269SEmmanuel Vadot
693*7ef62cebSEmmanuel Vadot                    port@3 {
694*7ef62cebSEmmanuel Vadot                        reg = <3>;
695*7ef62cebSEmmanuel Vadot                        label = "lan4";
696*7ef62cebSEmmanuel Vadot                    };
697*7ef62cebSEmmanuel Vadot
698b97ee269SEmmanuel Vadot                    port@4 {
699b97ee269SEmmanuel Vadot                        reg = <4>;
700*7ef62cebSEmmanuel Vadot                        label = "wan";
701*7ef62cebSEmmanuel Vadot                    };
702*7ef62cebSEmmanuel Vadot
703*7ef62cebSEmmanuel Vadot                    port@6 {
704*7ef62cebSEmmanuel Vadot                        reg = <6>;
705*7ef62cebSEmmanuel Vadot                        ethernet = <&gmac0>;
706*7ef62cebSEmmanuel Vadot                        phy-mode = "trgmii";
707*7ef62cebSEmmanuel Vadot
708*7ef62cebSEmmanuel Vadot                        fixed-link {
709*7ef62cebSEmmanuel Vadot                            speed = <1000>;
710*7ef62cebSEmmanuel Vadot                            full-duplex;
711*7ef62cebSEmmanuel Vadot                            pause;
712*7ef62cebSEmmanuel Vadot                        };
713*7ef62cebSEmmanuel Vadot                    };
714*7ef62cebSEmmanuel Vadot                };
715*7ef62cebSEmmanuel Vadot            };
716*7ef62cebSEmmanuel Vadot        };
717*7ef62cebSEmmanuel Vadot    };
718*7ef62cebSEmmanuel Vadot
719*7ef62cebSEmmanuel Vadot  # Example 7: MT7621: mux external phy to MT7530's port 5
720*7ef62cebSEmmanuel Vadot  - |
721*7ef62cebSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/mips-gic.h>
722*7ef62cebSEmmanuel Vadot    #include <dt-bindings/reset/mt7621-reset.h>
723*7ef62cebSEmmanuel Vadot
724*7ef62cebSEmmanuel Vadot    ethernet {
725*7ef62cebSEmmanuel Vadot        #address-cells = <1>;
726*7ef62cebSEmmanuel Vadot        #size-cells = <0>;
727*7ef62cebSEmmanuel Vadot
728*7ef62cebSEmmanuel Vadot        pinctrl-names = "default";
729*7ef62cebSEmmanuel Vadot        pinctrl-0 = <&rgmii2_pins>;
730*7ef62cebSEmmanuel Vadot
731*7ef62cebSEmmanuel Vadot        mdio {
732*7ef62cebSEmmanuel Vadot            #address-cells = <1>;
733*7ef62cebSEmmanuel Vadot            #size-cells = <0>;
734*7ef62cebSEmmanuel Vadot
735*7ef62cebSEmmanuel Vadot            /* External PHY */
736*7ef62cebSEmmanuel Vadot            example7_ethphy7: ethernet-phy@7 {
737*7ef62cebSEmmanuel Vadot                reg = <7>;
738*7ef62cebSEmmanuel Vadot                phy-mode = "rgmii";
739*7ef62cebSEmmanuel Vadot            };
740*7ef62cebSEmmanuel Vadot
741*7ef62cebSEmmanuel Vadot            switch@1f {
742*7ef62cebSEmmanuel Vadot                compatible = "mediatek,mt7621";
743*7ef62cebSEmmanuel Vadot                reg = <0x1f>;
744*7ef62cebSEmmanuel Vadot
745*7ef62cebSEmmanuel Vadot                mediatek,mcm;
746*7ef62cebSEmmanuel Vadot                resets = <&sysc MT7621_RST_MCM>;
747*7ef62cebSEmmanuel Vadot                reset-names = "mcm";
748*7ef62cebSEmmanuel Vadot
749*7ef62cebSEmmanuel Vadot                interrupt-controller;
750*7ef62cebSEmmanuel Vadot                #interrupt-cells = <1>;
751*7ef62cebSEmmanuel Vadot                interrupt-parent = <&gic>;
752*7ef62cebSEmmanuel Vadot                interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
753*7ef62cebSEmmanuel Vadot
754*7ef62cebSEmmanuel Vadot                ethernet-ports {
755*7ef62cebSEmmanuel Vadot                    #address-cells = <1>;
756*7ef62cebSEmmanuel Vadot                    #size-cells = <0>;
757*7ef62cebSEmmanuel Vadot
758*7ef62cebSEmmanuel Vadot                    port@0 {
759*7ef62cebSEmmanuel Vadot                        reg = <0>;
760*7ef62cebSEmmanuel Vadot                        label = "lan1";
761*7ef62cebSEmmanuel Vadot                    };
762*7ef62cebSEmmanuel Vadot
763*7ef62cebSEmmanuel Vadot                    port@1 {
764*7ef62cebSEmmanuel Vadot                        reg = <1>;
765*7ef62cebSEmmanuel Vadot                        label = "lan2";
766*7ef62cebSEmmanuel Vadot                    };
767*7ef62cebSEmmanuel Vadot
768*7ef62cebSEmmanuel Vadot                    port@2 {
769*7ef62cebSEmmanuel Vadot                        reg = <2>;
770*7ef62cebSEmmanuel Vadot                        label = "lan3";
771*7ef62cebSEmmanuel Vadot                    };
772*7ef62cebSEmmanuel Vadot
773*7ef62cebSEmmanuel Vadot                    port@3 {
774*7ef62cebSEmmanuel Vadot                        reg = <3>;
775b97ee269SEmmanuel Vadot                        label = "lan4";
776b97ee269SEmmanuel Vadot                    };
777b97ee269SEmmanuel Vadot
778*7ef62cebSEmmanuel Vadot                    port@4 {
779*7ef62cebSEmmanuel Vadot                        reg = <4>;
780*7ef62cebSEmmanuel Vadot                        label = "wan";
781*7ef62cebSEmmanuel Vadot                    };
782*7ef62cebSEmmanuel Vadot
783b97ee269SEmmanuel Vadot                    port@5 {
784b97ee269SEmmanuel Vadot                        reg = <5>;
785*7ef62cebSEmmanuel Vadot                        label = "extphy";
786*7ef62cebSEmmanuel Vadot                        phy-mode = "rgmii-txid";
787*7ef62cebSEmmanuel Vadot                        phy-handle = <&example7_ethphy7>;
788b97ee269SEmmanuel Vadot                    };
789b97ee269SEmmanuel Vadot
790*7ef62cebSEmmanuel Vadot                    port@6 {
791b97ee269SEmmanuel Vadot                        reg = <6>;
792*7ef62cebSEmmanuel Vadot                        ethernet = <&gmac0>;
793*7ef62cebSEmmanuel Vadot                        phy-mode = "trgmii";
794b97ee269SEmmanuel Vadot
795b97ee269SEmmanuel Vadot                        fixed-link {
796b97ee269SEmmanuel Vadot                            speed = <1000>;
797b97ee269SEmmanuel Vadot                            full-duplex;
798b97ee269SEmmanuel Vadot                            pause;
799b97ee269SEmmanuel Vadot                        };
800b97ee269SEmmanuel Vadot                    };
801b97ee269SEmmanuel Vadot                };
802b97ee269SEmmanuel Vadot            };
803b97ee269SEmmanuel Vadot        };
804b97ee269SEmmanuel Vadot    };
805