1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
4 $id: http://devicetree.org/schemas/net/dsa/mediatek,mt7530.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: Mediatek MT7530 and MT7531 Ethernet Switches
10 - Arınç ÜNAL <arinc.unal@arinc9.com>
11 - Landen Chao <Landen.Chao@mediatek.com>
12 - DENG Qingfang <dqfext@gmail.com>
13 - Sean Wang <sean.wang@mediatek.com>
14 - Daniel Golle <daniel@makrotopia.org>
17 There are three versions of MT7530, standalone, in a multi-chip module and
20 MT7530 is a part of the multi-chip module in MT7620AN, MT7620DA, MT7620DAN,
21 MT7620NN, MT7621AT, MT7621DAT, MT7621ST and MT7623AI SoCs.
23 The MT7988 SoC comes with a built-in switch similar to MT7531 as well as four
24 Gigabit Ethernet PHYs. The switch registers are directly mapped into the SoC's
25 memory map rather than using MDIO. The switch got an internally connected 10G
26 CPU port and 4 user ports connected to the built-in Gigabit Ethernet PHYs.
28 MT7530 in MT7620AN, MT7620DA, MT7620DAN and MT7620NN SoCs has got 10/100 PHYs
29 and the switch registers are directly mapped into SoC's memory map rather than
30 using MDIO. The DSA driver currently doesn't support MT7620 variants.
32 There is only the standalone version of MT7531.
34 Port 5 on MT7530 has got various ways of configuration:
36 - Port 5 can be used as a CPU port.
38 - PHY 0 or 4 of the switch can be muxed to gmac5 of the switch. Therefore,
39 the gmac of the SoC which is wired to port 5 can connect to the PHY.
40 This is usually used for connecting the wan port directly to the CPU to
41 achieve 2 Gbps routing in total.
43 The driver looks up the reg on the ethernet-phy node, which the phy-handle
44 property on the gmac node refers to, to mux the specified phy.
46 The driver requires the gmac of the SoC to have "mediatek,eth-mac" as the
47 compatible string and the reg must be 1. So, for now, only gmac1 of a
48 MediaTek SoC can benefit this. Banana Pi BPI-R2 suits this.
50 For the MT7621 SoCs, rgmii2 group must be claimed with rgmii2 function.
54 - For the multi-chip module MT7530, in case of an external phy wired to
55 gmac1 of the SoC, port 5 must not be enabled.
57 In case of muxing PHY 0 or 4, the external phy must not be enabled.
59 For the MT7621 SoCs, rgmii2 group must be claimed with rgmii2 function.
63 - Port 5 can be wired to an external phy. Port 5 becomes a DSA user port.
65 For the multi-chip module MT7530, the external phy must be wired TX to TX
66 to gmac1 of the SoC for this to work. Ubiquiti EdgeRouter X SFP is wired
69 For the multi-chip module MT7530, muxing PHY 0 or 4 won't work when the
70 external phy is connected TX to TX.
72 For the MT7621 SoCs, rgmii2 group must be claimed with gpio function.
80 Standalone MT7530 and multi-chip module MT7530 in MT7623AI SoC
81 const: mediatek,mt7530
85 const: mediatek,mt7531
88 Multi-chip module MT7530 in MT7621AT, MT7621DAT and MT7621ST SoCs
89 const: mediatek,mt7621
92 Built-in switch of the MT7988 SoC
93 const: mediatek,mt7988-switch
100 Phandle to the regulator node necessary for the core power.
108 If defined, LED controller of the MT7530 switch will run on GPIO mode.
110 There are 15 controllable pins.
111 port 0 LED 0..2 as GPIO 0..2
112 port 1 LED 0..2 as GPIO 3..5
113 port 2 LED 0..2 as GPIO 6..8
114 port 3 LED 0..2 as GPIO 9..11
115 port 4 LED 0..2 as GPIO 12..14
120 interrupt-controller: true
127 Phandle to the regulator node necessary for the I/O power.
128 See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt for
129 details for the regulator setup on these boards.
134 Used for MT7621AT, MT7621DAT, MT7621ST and MT7623AI SoCs which the MT7530
135 switch is a part of the multi-chip module.
139 GPIO to reset the switch. Use this if mediatek,mcm is not used.
140 This property is optional because some boards share the reset line with
141 other components which makes it impossible to probe the switch if the
150 Phandle pointing to the system reset controller with line index for the
155 "^(ethernet-)?ports$":
157 additionalProperties: true
160 "^(ethernet-)?port@[0-6]$":
162 additionalProperties: true
167 Port address described must be 5 or 6 for CPU port and from 0 to 5
172 required: [ ethernet ]
187 "^(ethernet-)?ports$":
189 "^(ethernet-)?port@[0-6]$":
191 required: [ ethernet ]
213 "^(ethernet-)?ports$":
215 "^(ethernet-)?port@[0-6]$":
217 required: [ ethernet ]
240 - $ref: dsa.yaml#/$defs/ethernet-ports
253 interrupt-controller: [ interrupts ]
258 const: mediatek,mt7530
260 $ref: "#/$defs/mt7530-dsa-port"
268 const: mediatek,mt7531
270 $ref: "#/$defs/mt7531-dsa-port"
272 gpio-controller: false
278 const: mediatek,mt7621
280 $ref: "#/$defs/mt7530-dsa-port"
287 const: mediatek,mt7988-switch
289 $ref: "#/$defs/mt7530-dsa-port"
291 gpio-controller: false
295 unevaluatedProperties: false
298 # Example 1: Standalone MT7530
300 #include <dt-bindings/gpio/gpio.h>
303 #address-cells = <1>;
307 compatible = "mediatek,mt7530";
310 reset-gpios = <&pio 33 0>;
312 core-supply = <&mt6323_vpa_reg>;
313 io-supply = <&mt6323_vemc3v3_reg>;
316 #address-cells = <1>;
359 # Example 2: MT7530 in MT7623AI SoC
361 #include <dt-bindings/reset/mt2701-resets.h>
364 #address-cells = <1>;
368 compatible = "mediatek,mt7530";
372 resets = <ðsys MT2701_ETHSYS_MCM_RST>;
375 core-supply = <&mt6323_vpa_reg>;
376 io-supply = <&mt6323_vemc3v3_reg>;
379 #address-cells = <1>;
422 # Example 3: Standalone MT7531
424 #include <dt-bindings/gpio/gpio.h>
425 #include <dt-bindings/interrupt-controller/irq.h>
428 #address-cells = <1>;
432 compatible = "mediatek,mt7531";
435 reset-gpios = <&pio 54 0>;
437 interrupt-controller;
438 #interrupt-cells = <1>;
439 interrupt-parent = <&pio>;
440 interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
443 #address-cells = <1>;
474 phy-mode = "2500base-x";
486 # Example 4: MT7530 in MT7621AT, MT7621DAT and MT7621ST SoCs
488 #include <dt-bindings/interrupt-controller/mips-gic.h>
489 #include <dt-bindings/reset/mt7621-reset.h>
492 #address-cells = <1>;
496 compatible = "mediatek,mt7621";
500 resets = <&sysc MT7621_RST_MCM>;
503 interrupt-controller;
504 #interrupt-cells = <1>;
505 interrupt-parent = <&gic>;
506 interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
509 #address-cells = <1>;
552 # Example 5: MT7621: mux MT7530's phy4 to SoC's gmac1
554 #include <dt-bindings/interrupt-controller/mips-gic.h>
555 #include <dt-bindings/reset/mt7621-reset.h>
558 #address-cells = <1>;
561 pinctrl-names = "default";
562 pinctrl-0 = <&rgmii2_pins>;
565 compatible = "mediatek,eth-mac";
569 phy-handle = <&example5_ethphy4>;
573 #address-cells = <1>;
577 example5_ethphy4: ethernet-phy@4 {
582 compatible = "mediatek,mt7621";
586 resets = <&sysc MT7621_RST_MCM>;
589 interrupt-controller;
590 #interrupt-cells = <1>;
591 interrupt-parent = <&gic>;
592 interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
595 #address-cells = <1>;
618 /* Commented out, phy4 is connected to gmac1.
641 # Example 6: MT7621: mux external phy to SoC's gmac1
643 #include <dt-bindings/interrupt-controller/mips-gic.h>
644 #include <dt-bindings/reset/mt7621-reset.h>
647 #address-cells = <1>;
650 pinctrl-names = "default";
651 pinctrl-0 = <&rgmii2_pins>;
654 compatible = "mediatek,eth-mac";
658 phy-handle = <&example6_ethphy7>;
662 #address-cells = <1>;
666 example6_ethphy7: ethernet-phy@7 {
672 compatible = "mediatek,mt7621";
676 resets = <&sysc MT7621_RST_MCM>;
679 interrupt-controller;
680 #interrupt-cells = <1>;
681 interrupt-parent = <&gic>;
682 interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
685 #address-cells = <1>;
729 # Example 7: MT7621: mux external phy to MT7530's port 5
731 #include <dt-bindings/interrupt-controller/mips-gic.h>
732 #include <dt-bindings/reset/mt7621-reset.h>
735 #address-cells = <1>;
738 pinctrl-names = "default";
739 pinctrl-0 = <&rgmii2_pins>;
742 #address-cells = <1>;
746 example7_ethphy7: ethernet-phy@7 {
752 compatible = "mediatek,mt7621";
756 resets = <&sysc MT7621_RST_MCM>;
759 interrupt-controller;
760 #interrupt-cells = <1>;
761 interrupt-parent = <&gic>;
762 interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
765 #address-cells = <1>;
796 phy-mode = "rgmii-txid";
797 phy-handle = <&example7_ethphy7>;