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>
16 There are two versions of MT7530, standalone and in a multi-chip module.
18 MT7530 is a part of the multi-chip module in MT7620AN, MT7620DA, MT7620DAN,
19 MT7620NN, MT7621AT, MT7621DAT, MT7621ST and MT7623AI SoCs.
21 MT7530 in MT7620AN, MT7620DA, MT7620DAN and MT7620NN SoCs has got 10/100 PHYs
22 and the switch registers are directly mapped into SoC's memory map rather than
23 using MDIO. The DSA driver currently doesn't support this.
25 There is only the standalone version of MT7531.
27 Port 5 on MT7530 has got various ways of configuration.
29 For standalone MT7530:
31 - Port 5 can be used as a CPU port.
33 - PHY 0 or 4 of the switch can be muxed to connect to the gmac of the SoC
34 which port 5 is wired to. Usually used for connecting the wan port
35 directly to the CPU to achieve 2 Gbps routing in total.
37 The driver looks up the reg on the ethernet-phy node which the phy-handle
38 property refers to on the gmac node to mux the specified phy.
40 The driver requires the gmac of the SoC to have "mediatek,eth-mac" as the
41 compatible string and the reg must be 1. So, for now, only gmac1 of an
42 MediaTek SoC can benefit this. Banana Pi BPI-R2 suits this.
43 Check out example 5 for a similar configuration.
45 - Port 5 can be wired to an external phy. Port 5 becomes a DSA slave.
46 Check out example 7 for a similar configuration.
48 For multi-chip module MT7530:
50 - Port 5 can be used as a CPU port.
52 - PHY 0 or 4 of the switch can be muxed to connect to gmac1 of the SoC.
53 Usually used for connecting the wan port directly to the CPU to achieve 2
54 Gbps routing in total.
56 The driver looks up the reg on the ethernet-phy node which the phy-handle
57 property refers to on the gmac node to mux the specified phy.
59 For the MT7621 SoCs, rgmii2 group must be claimed with rgmii2 function.
62 - In case of an external phy wired to gmac1 of the SoC, port 5 must not be
65 In case of muxing PHY 0 or 4, the external phy must not be enabled.
67 For the MT7621 SoCs, rgmii2 group must be claimed with rgmii2 function.
70 - Port 5 can be muxed to an external phy. Port 5 becomes a DSA slave.
71 The external phy must be wired TX to TX to gmac1 of the SoC for this to
72 work. Ubiquiti EdgeRouter X SFP is wired this way.
74 Muxing PHY 0 or 4 won't work when the external phy is connected TX to TX.
76 For the MT7621 SoCs, rgmii2 group must be claimed with gpio function.
83 Standalone MT7530 and multi-chip module MT7530 in MT7623AI SoC
84 const: mediatek,mt7530
88 const: mediatek,mt7531
91 Multi-chip module MT7530 in MT7621AT, MT7621DAT and MT7621ST SoCs
92 const: mediatek,mt7621
99 Phandle to the regulator node necessary for the core power.
107 If defined, LED controller of the MT7530 switch will run on GPIO mode.
109 There are 15 controllable pins.
110 port 0 LED 0..2 as GPIO 0..2
111 port 1 LED 0..2 as GPIO 3..5
112 port 2 LED 0..2 as GPIO 6..8
113 port 3 LED 0..2 as GPIO 9..11
114 port 4 LED 0..2 as GPIO 12..14
119 interrupt-controller: true
126 Phandle to the regulator node necessary for the I/O power.
127 See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt for
128 details for the regulator setup on these boards.
133 Used for MT7621AT, MT7621DAT, MT7621ST and MT7623AI SoCs which the MT7530
134 switch is a part of the multi-chip module.
138 GPIO to reset the switch. Use this if mediatek,mcm is not used.
139 This property is optional because some boards share the reset line with
140 other components which makes it impossible to probe the switch if the
149 Phandle pointing to the system reset controller with line index for the
154 "^(ethernet-)?ports$":
158 "^(ethernet-)?port@[0-9]+$":
160 description: Ethernet switch ports
162 unevaluatedProperties: false
167 Port address described must be 5 or 6 for CPU port and from 0 to 5
171 - $ref: dsa-port.yaml#
173 required: [ ethernet ]
188 "^(ethernet-)?ports$":
190 "^(ethernet-)?port@[0-9]+$":
192 required: [ ethernet ]
214 "^(ethernet-)?ports$":
216 "^(ethernet-)?port@[0-9]+$":
218 required: [ ethernet ]
254 interrupt-controller: [ interrupts ]
259 const: mediatek,mt7530
261 $ref: "#/$defs/mt7530-dsa-port"
269 const: mediatek,mt7531
271 $ref: "#/$defs/mt7531-dsa-port"
273 gpio-controller: false
279 const: mediatek,mt7621
281 $ref: "#/$defs/mt7530-dsa-port"
285 unevaluatedProperties: false
288 # Example 1: Standalone MT7530
290 #include <dt-bindings/gpio/gpio.h>
293 #address-cells = <1>;
297 compatible = "mediatek,mt7530";
300 reset-gpios = <&pio 33 0>;
302 core-supply = <&mt6323_vpa_reg>;
303 io-supply = <&mt6323_vemc3v3_reg>;
306 #address-cells = <1>;
349 # Example 2: MT7530 in MT7623AI SoC
351 #include <dt-bindings/reset/mt2701-resets.h>
354 #address-cells = <1>;
358 compatible = "mediatek,mt7530";
362 resets = <ðsys MT2701_ETHSYS_MCM_RST>;
365 core-supply = <&mt6323_vpa_reg>;
366 io-supply = <&mt6323_vemc3v3_reg>;
369 #address-cells = <1>;
412 # Example 3: Standalone MT7531
414 #include <dt-bindings/gpio/gpio.h>
415 #include <dt-bindings/interrupt-controller/irq.h>
418 #address-cells = <1>;
422 compatible = "mediatek,mt7531";
425 reset-gpios = <&pio 54 0>;
427 interrupt-controller;
428 #interrupt-cells = <1>;
429 interrupt-parent = <&pio>;
430 interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
433 #address-cells = <1>;
464 phy-mode = "2500base-x";
476 # Example 4: MT7530 in MT7621AT, MT7621DAT and MT7621ST SoCs
478 #include <dt-bindings/interrupt-controller/mips-gic.h>
479 #include <dt-bindings/reset/mt7621-reset.h>
482 #address-cells = <1>;
486 compatible = "mediatek,mt7621";
490 resets = <&sysc MT7621_RST_MCM>;
493 interrupt-controller;
494 #interrupt-cells = <1>;
495 interrupt-parent = <&gic>;
496 interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
499 #address-cells = <1>;
542 # Example 5: MT7621: mux MT7530's phy4 to SoC's gmac1
544 #include <dt-bindings/interrupt-controller/mips-gic.h>
545 #include <dt-bindings/reset/mt7621-reset.h>
548 #address-cells = <1>;
551 pinctrl-names = "default";
552 pinctrl-0 = <&rgmii2_pins>;
555 compatible = "mediatek,eth-mac";
559 phy-handle = <&example5_ethphy4>;
563 #address-cells = <1>;
567 example5_ethphy4: ethernet-phy@4 {
572 compatible = "mediatek,mt7621";
576 resets = <&sysc MT7621_RST_MCM>;
579 interrupt-controller;
580 #interrupt-cells = <1>;
581 interrupt-parent = <&gic>;
582 interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
585 #address-cells = <1>;
608 /* Commented out, phy4 is muxed to gmac1.
631 # Example 6: MT7621: mux external phy to SoC's gmac1
633 #include <dt-bindings/interrupt-controller/mips-gic.h>
634 #include <dt-bindings/reset/mt7621-reset.h>
637 #address-cells = <1>;
640 pinctrl-names = "default";
641 pinctrl-0 = <&rgmii2_pins>;
644 compatible = "mediatek,eth-mac";
648 phy-handle = <&example6_ethphy7>;
652 #address-cells = <1>;
656 example6_ethphy7: ethernet-phy@7 {
662 compatible = "mediatek,mt7621";
666 resets = <&sysc MT7621_RST_MCM>;
669 interrupt-controller;
670 #interrupt-cells = <1>;
671 interrupt-parent = <&gic>;
672 interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
675 #address-cells = <1>;
719 # Example 7: MT7621: mux external phy to MT7530's port 5
721 #include <dt-bindings/interrupt-controller/mips-gic.h>
722 #include <dt-bindings/reset/mt7621-reset.h>
725 #address-cells = <1>;
728 pinctrl-names = "default";
729 pinctrl-0 = <&rgmii2_pins>;
732 #address-cells = <1>;
736 example7_ethphy7: ethernet-phy@7 {
742 compatible = "mediatek,mt7621";
746 resets = <&sysc MT7621_RST_MCM>;
749 interrupt-controller;
750 #interrupt-cells = <1>;
751 interrupt-parent = <&gic>;
752 interrupts = <GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH>;
755 #address-cells = <1>;
786 phy-mode = "rgmii-txid";
787 phy-handle = <&example7_ethphy7>;