# Mediatek MT7530 and MT7531 Ethernet Switches

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Network bindings / dsa_

> Device-tree binding reference for Mediatek MT7530 and MT7531 Ethernet Switches.

<!-- SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;net&#47;dsa&#47;mediatek&#44;mt7530&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Arınç ÜNAL &#60;arinc&#46;unal&#64;arinc9&#46;com&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Landen Chao &#60;Landen&#46;Chao&#64;mediatek&#46;com&#62;&#34;</code></span>, <span id="dt-2f1516674166ff6e66b8"><code>&#34;DENG Qingfang &#60;dqfext&#64;gmail&#46;com&#62;&#34;</code></span>, <span id="dt-3a197c22bf020420f520"><code>&#34;Sean Wang &#60;sean&#46;wang&#64;mediatek&#46;com&#62;&#34;</code></span>, <span id="dt-41b80c63dfd45c913428"><code>&#34;Daniel Golle &#60;daniel&#64;makrotopia&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">There are three versions of MT7530, standalone, in a multi-chip module and
built-into a SoC.</p>
<p style="white-space: pre-wrap">MT7530 is a part of the multi-chip module in MT7620AN, MT7620DA, MT7620DAN,
MT7620NN, MT7621AT, MT7621DAT, MT7621ST and MT7623AI SoCs.</p>
<p style="white-space: pre-wrap">The MT7988 SoC comes with a built-in switch similar to MT7531 as well as four
Gigabit Ethernet PHYs. The switch registers are directly mapped into the SoC's
memory map rather than using MDIO. The switch has an internally connected 10G
CPU port and 4 user ports connected to the built-in Gigabit Ethernet PHYs.</p>
<p style="white-space: pre-wrap">The MT7530 in MT7620AN, MT7620DA, MT7620DAN and MT7620NN SoCs has 10/100 PHYs
and the switch registers are directly mapped into SoC's memory map rather than
using MDIO. The DSA driver currently doesn't support MT7620 variants.</p>
<p style="white-space: pre-wrap">There is only the standalone version of MT7531.</p>
<p style="white-space: pre-wrap">Port 5 on MT7530 supports various configurations:</p>
<pre><code>  - Port 5 can be used as a CPU port.</code></pre>
<pre><code>  - PHY 0 or 4 of the switch can be muxed to gmac5 of the switch. Therefore,
    the gmac of the SoC which is wired to port 5 can connect to the PHY.
    This is usually used for connecting the wan port directly to the CPU to
    achieve 2 Gbps routing in total.</code></pre>
<pre><code>    The driver looks up the reg on the ethernet-phy node, which the phy-handle
    property on the gmac node refers to, to mux the specified phy.</code></pre>
<pre><code>    The driver requires the gmac of the SoC to have "mediatek,eth-mac" as the
    compatible string and the reg must be 1. So, for now, only gmac1 of a
    MediaTek SoC can benefit this. Banana Pi BPI-R2 suits this.</code></pre>
<pre><code>    For the MT7621 SoCs, rgmii2 group must be claimed with rgmii2 function.</code></pre>
<pre><code>    Check out example 5.</code></pre>
<pre><code>  - For the multi-chip module MT7530, in case of an external phy wired to
    gmac1 of the SoC, port 5 must not be enabled.</code></pre>
<pre><code>    In case of muxing PHY 0 or 4, the external phy must not be enabled.</code></pre>
<pre><code>    For the MT7621 SoCs, rgmii2 group must be claimed with rgmii2 function.</code></pre>
<pre><code>    Check out example 6.</code></pre>
<pre><code>  - Port 5 can be wired to an external phy. Port 5 becomes a DSA user port.</code></pre>
<pre><code>    For the multi-chip module MT7530, the external phy must be wired TX to TX
    to gmac1 of the SoC for this to work. Ubiquiti EdgeRouter X SFP is wired
    this way.</code></pre>
<pre><code>    For the multi-chip module MT7530, muxing PHY 0 or 4 won't work when the
    external phy is connected TX to TX.</code></pre>
<pre><code>    For the MT7621 SoCs, rgmii2 group must be claimed with gpio function.</code></pre>
<pre><code>    Check out example 7.</code></pre>
</div>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-5c1d81699dcbe840de83"></a>

### <code>compatible</code> — required here

<a id="dt-39566f01414e34c67b85"></a>

#### Exactly one of these rules must match (<code>oneOf</code>)

<a id="dt-fe13e24e5c9612880f47"></a>

**Rule 1**

> <div id="dt-ab1c3e7063bd95dc962e">
> <p style="white-space: pre-wrap">Standalone MT7530 and multi-chip module MT7530 in MT7623AI SoC</p>
> </div>
>
> **Exact value (<code>const</code>):** <span id="dt-d1fe1b456a54b64074d3"><code>&#34;mediatek&#44;mt7530&#34;</code></span>

<a id="dt-7482b6e745c4f056161a"></a>

**Rule 2**

> <div id="dt-4b64ce44adfe069638c4">
> <p style="white-space: pre-wrap">Standalone MT7531</p>
> </div>
>
> **Exact value (<code>const</code>):** <span id="dt-58a429cd4bf531951c0d"><code>&#34;mediatek&#44;mt7531&#34;</code></span>

<a id="dt-39cb5b72c94e12bd53ea"></a>

**Rule 3**

> <div id="dt-34ebc3371373135d1528">
> <p style="white-space: pre-wrap">Multi-chip module MT7530 in MT7621AT, MT7621DAT and MT7621ST SoCs</p>
> </div>
>
> **Exact value (<code>const</code>):** <span id="dt-710bc579d54b8b6b1f6c"><code>&#34;mediatek&#44;mt7621&#34;</code></span>

<a id="dt-61219c29f99de6d21702"></a>

**Rule 4**

> <div id="dt-2e7dbd5da540c0c7ff41">
> <p style="white-space: pre-wrap">Built-in switch of the MT7988 SoC</p>
> </div>
>
> **Exact value (<code>const</code>):** <span id="dt-bb8aa9a35453860e510c"><code>&#34;mediatek&#44;mt7988&#45;switch&#34;</code></span>

<a id="dt-6932ba24e194ea67730d"></a>

**Rule 5**

> <div id="dt-67e1c2ab404e45238d0a">
> <p style="white-space: pre-wrap">Built-in switch of the Airoha EN7581 SoC</p>
> </div>
>
> **Exact value (<code>const</code>):** <span id="dt-db09842262b0bfa9d4c5"><code>&#34;airoha&#44;en7581&#45;switch&#34;</code></span>

<a id="dt-264a99ec2691e9f8d8d2"></a>

**Rule 6**

> <div id="dt-4045864b8eb90100af37">
> <p style="white-space: pre-wrap">Built-in switch of the Airoha AN7583 SoC</p>
> </div>
>
> **Exact value (<code>const</code>):** <span id="dt-c300a8811f2c7ccc81ad"><code>&#34;airoha&#44;an7583&#45;switch&#34;</code></span>

<a id="dt-9c1635fdb65d87e33d77"></a>

### <code>reg</code> — required here

**Maximum number of items (<code>maxItems</code>):** <span id="dt-71421d35675d9a533ad2"><code>1</code></span>

<a id="dt-90169dc6660d2d2b85df"></a>

### <code>core&#45;supply</code> — not listed as required here

<div id="dt-a436571bf7309e0d0f34">
<p style="white-space: pre-wrap">Phandle to the regulator node necessary for the core power.</p>
</div>

<a id="dt-cfb238e0b7cdb276d83f"></a>

### <code>&#35;gpio&#45;cells</code> — not listed as required here

**Exact value (<code>const</code>):** <span id="dt-8950f722147d2cd640b8"><code>2</code></span>

<a id="dt-f5d51cae76398cdb9d95"></a>

### <code>gpio&#45;controller</code> — not listed as required here

**Value type (<code>type</code>):** <span id="dt-494274df68cd61bc3b92"><code>&#34;boolean&#34;</code></span>

<div id="dt-5168d714e593428371b8">
<p style="white-space: pre-wrap">If defined, LED controller of the MT7530 switch will run on GPIO mode.</p>
<p style="white-space: pre-wrap">There are 15 controllable pins.
port 0 LED 0..2 as GPIO 0..2
port 1 LED 0..2 as GPIO 3..5
port 2 LED 0..2 as GPIO 6..8
port 3 LED 0..2 as GPIO 9..11
port 4 LED 0..2 as GPIO 12..14</p>
</div>

<a id="dt-8586fac2d9a71adf4795"></a>

### <code>&#35;interrupt&#45;cells</code> — not listed as required here

**Exact value (<code>const</code>):** <span id="dt-317bbf786489389e8233"><code>1</code></span>

<a id="dt-b98252f9c39642b1db8f"></a>

### <code>interrupt&#45;controller</code> — not listed as required here

<code>true</code> — No constraints added by this property rule.

<a id="dt-c2de09e7f7fd211b679d"></a>

### <code>interrupts</code> — not listed as required here

**Maximum number of items (<code>maxItems</code>):** <span id="dt-b7823fb65b2f27642d26"><code>1</code></span>

<a id="dt-7eb184ff9ff343f6320d"></a>

### <code>io&#45;supply</code> — not listed as required here

<div id="dt-ff93164b061d2d750e90">
<p style="white-space: pre-wrap">Phandle to the regulator node necessary for the I/O power.
See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt for
details for the regulator setup on these boards.</p>
</div>

<a id="dt-61fd0c6095df05615feb"></a>

### <code>mdio</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-980b6ef0e51b942a4596">[<code>&#47;schemas&#47;net&#47;mdio&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-net/mdio.md#dt-root>)</span>

<a id="dt-3293bd7c0139f521bb91"></a>

#### Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-58181d8a88e3fb0be0cd"></a>

#### Properties and child nodes (<code>properties</code>)

<a id="dt-2538ffad648ea7ceea68"></a>

**<code>mediatek&#44;pio</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-e247105265740210c5c7">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;phandle</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-2533fa46618221e83225>)</span>

<div id="dt-55cd082f3724174414cf">
<p style="white-space: pre-wrap">Phandle pointing to the mediatek pinctrl node.</p>
</div>

<a id="dt-6b4423d7bafa97cda696"></a>

### <code>mediatek&#44;mcm</code> — not listed as required here

**Value type (<code>type</code>):** <span id="dt-51800fc019b53a88f175"><code>&#34;boolean&#34;</code></span>

<div id="dt-846bf4d129f129d1cbb9">
<p style="white-space: pre-wrap">Used for MT7621AT, MT7621DAT, MT7621ST and MT7623AI SoCs which the MT7530 switch is a part of the multi-chip module.</p>
</div>

<a id="dt-fdf18029f1f43a541a62"></a>

### <code>reset&#45;gpios</code> — not listed as required here

<div id="dt-451564af2b6998692dea">
<p style="white-space: pre-wrap">GPIO to reset the switch. Use this if mediatek,mcm is not used.
This property is optional because some boards share the reset line with
other components which makes it impossible to probe the switch if the
reset line is used.</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-140c9736042c6903f7ff"><code>1</code></span>

<a id="dt-563c20491090a57ac4c9"></a>

### <code>reset&#45;names</code> — not listed as required here

**Exact value (<code>const</code>):** <span id="dt-fc45b57fcd1ba81d2c64"><code>&#34;mcm&#34;</code></span>

<a id="dt-df397b2b98a8cf834e89"></a>

### <code>resets</code> — not listed as required here

<div id="dt-d372137de588ae9d23ee">
<p style="white-space: pre-wrap">Phandle pointing to the system reset controller with line index for the ethsys.</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-86a6993fcd90367ac91d"><code>1</code></span>

<a id="dt-e92215bd3c2f5373b164"></a>

## Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-72f7c7e4702b1d0922c3"></a>

### <code>&#94;&#40;ethernet&#45;&#41;&#63;ports&#36;</code> — name matches this regular expression

**Value type (<code>type</code>):** <span id="dt-b8022744e1b5b5813e6a"><code>&#34;object&#34;</code></span>

<a id="dt-f309d320ef8c71226ac4"></a>

#### Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>true</code>

Allowed by this rule.

<a id="dt-9ccb3562f541d96281b2"></a>

#### Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-f3e2878a014b99a58525"></a>

**<code>&#94;&#40;ethernet&#45;&#41;&#63;port&#64;&#91;0&#45;6&#93;&#36;</code> — name matches this regular expression**

**Value type (<code>type</code>):** <span id="dt-e3cc6b075822bfb2f850"><code>&#34;object&#34;</code></span>

<a id="dt-fd257911d3fb4266cb59"></a>

**Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)**

<code>true</code>

Allowed by this rule.

<a id="dt-55a5a3136b8711b66ecf"></a>

**Properties and child nodes (<code>properties</code>)**

<a id="dt-714cd92ebd77fcad425e"></a>

**<code>reg</code> — not listed as required here**

<div id="dt-cdcf473d036f183c7acf">
<p style="white-space: pre-wrap">Port address described must be 5 or 6 for CPU port and from 0 to 5 for user ports.</p>
</div>

<a id="dt-487399357da86d53724c"></a>

**All of these rules must match (<code>allOf</code>)**

<a id="dt-bd8288f0b9f14ac4b97d"></a>

**Rule 1**

> <a id="dt-5e6e55f7a9eb136de30b"></a>
>
> **Condition (<code>if</code>)**
>
> > **Required in this object (<code>required</code>):** <a id="dt-0e5a2a18e053cef29c5b"></a> <span id="dt-87aba828f68067c4eb4d"><code>&#34;ethernet&#34;</code></span>
>
> <a id="dt-e1fdda59a883189bc31c"></a>
>
> **When the condition matches (<code>then</code>)**
>
> > <a id="dt-9c7abb2d50f3fc0b49e8"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-409695cbe32079cdfc58"></a>
> >
> > **<code>reg</code> — not listed as required here**
> >
> > **Allowed values (<code>enum</code>):** <a id="dt-d128ae9bada3263a34ff"></a> <span id="dt-cf0d24ae0522c6a04ea4"><code>5</code></span>, <span id="dt-9de939cc7dd6b13f4d3b"><code>6</code></span>

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;compatible&#34;</code></span>, <span id="dt-ee7433925c1528c16b99"><code>&#34;reg&#34;</code></span>

<a id="dt-7fcd144dee0d1b44122a"></a>

## Reusable definitions (<code>&#36;defs</code>)

<a id="dt-74b1965a563ce37a01ce"></a>

### <code>builtin&#45;dsa&#45;port</code>

<a id="dt-f76bc408203536433758"></a>

#### Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-bbb370666615f8493116"></a>

**<code>&#94;&#40;ethernet&#45;&#41;&#63;ports&#36;</code> — name matches this regular expression**

<a id="dt-0e5445c68e32e3488eed"></a>

**Properties matching a name pattern (<code>patternProperties</code>)**

<a id="dt-962dfc56f76d6a09689c"></a>

**<code>&#94;&#40;ethernet&#45;&#41;&#63;port&#64;&#91;0&#45;6&#93;&#36;</code> — name matches this regular expression**

<a id="dt-64dc9e24e0d2e38613bf"></a>

**Condition (<code>if</code>)**

> **Required in this object (<code>required</code>):** <a id="dt-99ebd890d89049253140"></a> <span id="dt-91101a1f0462cff959b7"><code>&#34;ethernet&#34;</code></span>

<a id="dt-e3ab437942f0b8bb6a62"></a>

**When the condition matches (<code>then</code>)**

> <a id="dt-4f182bd411f95ac00a93"></a>
>
> **Properties and child nodes (<code>properties</code>)**
>
> <a id="dt-cfbe9d0abfe081fd663f"></a>
>
> **<code>phy&#45;mode</code> — not listed as required here**
>
> **Exact value (<code>const</code>):** <span id="dt-778ab4bb922439778bc4"><code>&#34;internal&#34;</code></span>

<a id="dt-cdfa92e67bd2359f4f7e"></a>

### <code>mt7530&#45;dsa&#45;port</code>

<a id="dt-855bd09954d67775cefa"></a>

#### Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-3c4407c0bdfd34b7ccd1"></a>

**<code>&#94;&#40;ethernet&#45;&#41;&#63;ports&#36;</code> — name matches this regular expression**

<a id="dt-564106f71869708f1571"></a>

**Properties matching a name pattern (<code>patternProperties</code>)**

<a id="dt-0fb7dc06f2b40853c79e"></a>

**<code>&#94;&#40;ethernet&#45;&#41;&#63;port&#64;&#91;0&#45;6&#93;&#36;</code> — name matches this regular expression**

<a id="dt-2029ac7c3ce5f25ba970"></a>

**Condition (<code>if</code>)**

> **Required in this object (<code>required</code>):** <a id="dt-11ad376f54552680feca"></a> <span id="dt-57b9efc7b83697dda557"><code>&#34;ethernet&#34;</code></span>

<a id="dt-4936cb197d1e438f0c2b"></a>

**When the condition matches (<code>then</code>)**

> <a id="dt-75f0a1a2c03e6f8c8116"></a>
>
> **Condition (<code>if</code>)**
>
> > <a id="dt-e55c6addd2cf16668971"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-71a4776410a3fc451831"></a>
> >
> > **<code>reg</code> — not listed as required here**
> >
> > **Exact value (<code>const</code>):** <span id="dt-898d748d4c458d00b74e"><code>5</code></span>
>
> <a id="dt-20f4070fdb98a3e9bca6"></a>
>
> **When the condition matches (<code>then</code>)**
>
> > <a id="dt-b9c4cbbda1fbaffcc87e"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-d45ca709ff989bb89cf8"></a>
> >
> > **<code>phy&#45;mode</code> — not listed as required here**
> >
> > **Allowed values (<code>enum</code>):** <a id="dt-6fb00962d3eb71528123"></a> <span id="dt-edfc69cb4cab84888af2"><code>&#34;gmii&#34;</code></span>, <span id="dt-1bf862bce9bd834baac6"><code>&#34;mii&#34;</code></span>, <span id="dt-23dd8fcd9c466ae91d7b"><code>&#34;rgmii&#34;</code></span>
>
> <a id="dt-bc6c3a519fc3eb0f6af8"></a>
>
> **When the condition does not match (<code>else</code>)**
>
> > <a id="dt-774a01670516f3f87b5d"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-c717e553487f18f3d7fa"></a>
> >
> > **<code>phy&#45;mode</code> — not listed as required here**
> >
> > **Allowed values (<code>enum</code>):** <a id="dt-730755955e515736e14b"></a> <span id="dt-82da60593628059a56b4"><code>&#34;rgmii&#34;</code></span>, <span id="dt-d6aa2daf9d449b9c16a7"><code>&#34;trgmii&#34;</code></span>

<a id="dt-3ef0b74397cc45f9cdf4"></a>

### <code>mt7531&#45;dsa&#45;port</code>

<a id="dt-979e74120e8030029f96"></a>

#### Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-a65f9fd2f963ac5cce32"></a>

**<code>&#94;&#40;ethernet&#45;&#41;&#63;ports&#36;</code> — name matches this regular expression**

<a id="dt-ea91bdfb7222224d7016"></a>

**Properties matching a name pattern (<code>patternProperties</code>)**

<a id="dt-97967ed05221471384a5"></a>

**<code>&#94;&#40;ethernet&#45;&#41;&#63;port&#64;&#91;0&#45;6&#93;&#36;</code> — name matches this regular expression**

<a id="dt-ffe1a9634d0880753422"></a>

**Condition (<code>if</code>)**

> **Required in this object (<code>required</code>):** <a id="dt-1477323d890539c67920"></a> <span id="dt-6a42581649a9df29b1a3"><code>&#34;ethernet&#34;</code></span>

<a id="dt-59c7f04f6ac07fe4029e"></a>

**When the condition matches (<code>then</code>)**

> <a id="dt-93dbe7ebf00b3c5e18f6"></a>
>
> **Condition (<code>if</code>)**
>
> > <a id="dt-4fd37ecf3810b3a0ad71"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-1643a16cd9e34cc241db"></a>
> >
> > **<code>reg</code> — not listed as required here**
> >
> > **Exact value (<code>const</code>):** <span id="dt-975f8a4cf7c5cd0ec1e5"><code>5</code></span>
>
> <a id="dt-5140b8b39afa6ca788d8"></a>
>
> **When the condition matches (<code>then</code>)**
>
> > <a id="dt-6e69a640d0473baef9d9"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-843ff1113f3aa6f6fe13"></a>
> >
> > **<code>phy&#45;mode</code> — not listed as required here**
> >
> > **Allowed values (<code>enum</code>):** <a id="dt-a9e7047dfb6115d5cddc"></a> <span id="dt-e68fadadd32957c0210e"><code>&#34;1000base&#45;x&#34;</code></span>, <span id="dt-23625713ffc826267e76"><code>&#34;2500base&#45;x&#34;</code></span>, <span id="dt-b5375e4552e7b7158ac7"><code>&#34;rgmii&#34;</code></span>, <span id="dt-d0e2118b57d3a9dbe8da"><code>&#34;sgmii&#34;</code></span>
>
> <a id="dt-e789b62f6ceec07bd404"></a>
>
> **When the condition does not match (<code>else</code>)**
>
> > <a id="dt-a22a7efba795435c2a97"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-16433dda00f0d1dfb44c"></a>
> >
> > **<code>phy&#45;mode</code> — not listed as required here**
> >
> > **Allowed values (<code>enum</code>):** <a id="dt-e000015d5d64ccf79f5f"></a> <span id="dt-600b8f4afd390c2e5329"><code>&#34;1000base&#45;x&#34;</code></span>, <span id="dt-6627558796ec4f78fbb3"><code>&#34;2500base&#45;x&#34;</code></span>, <span id="dt-801dbe97066234491f63"><code>&#34;sgmii&#34;</code></span>

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

<a id="dt-d33de94ac1d3652cd22a"></a>

### Rule 1

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-95c8874f25311f4b1ab1">[<code>dsa&#46;yaml&#35;&#47;&#36;defs&#47;ethernet&#45;ports</code>](</kernel/hardware/devicetree-bindings/dt-net/dsa/dsa.md#dt-902a57891fd19db703ff>)</span>

<a id="dt-22ca5ec5b89308748ecc"></a>

### Rule 2

> <a id="dt-ffbf5afb799d5f07b3e1"></a>
>
> #### Condition (<code>if</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-5f135e3db8ef1aa53700"></a> <span id="dt-0164887f025a095456fa"><code>&#34;mediatek&#44;mcm&#34;</code></span>
>
> <a id="dt-0971d01a730acc20e97a"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > <a id="dt-26d1c84fcc55a7d91dea"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-398076edceb8f164a46e"></a>
> >
> > **<code>reset&#45;gpios</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.
> >
> > **Required in this object (<code>required</code>):** <a id="dt-ee96a18d4bb2a9d39bd9"></a> <span id="dt-96ee7f71687cd234a9f8"><code>&#34;resets&#34;</code></span>, <span id="dt-5daae4bef35eb1615659"><code>&#34;reset&#45;names&#34;</code></span>

<a id="dt-317510ea5c8bf789ca60"></a>

### Rule 3

> <a id="dt-5d29a79714a1ca577428"></a>
>
> #### Property dependencies (<code>dependencies</code>)
>
> <a id="dt-9195976e9527c0c9bc05"></a>
>
> **<code>interrupt&#45;controller</code> — applies when this property is present**
>
> Also requires: <span id="dt-702410a5e99b8d034fcf"><code>&#34;interrupts&#34;</code></span>

<a id="dt-e198e1d898e7c60d5fed"></a>

### Rule 4

> <a id="dt-5d622c5a2672c1e49b35"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-8d84f7bba76b4e26221f"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-11dc65c5cf7abc0317bb"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > **Exact value (<code>const</code>):** <span id="dt-a467c629e24e4e59c2d9"><code>&#34;mediatek&#44;mt7530&#34;</code></span>
>
> <a id="dt-889ceb40bc531bf0dc1d"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-d6251d1678924234fb0a">[<code>&#35;&#47;&#36;defs&#47;mt7530&#45;dsa&#45;port</code>](<#dt-cdfa92e67bd2359f4f7e>)</span>
> >
> > **Required in this object (<code>required</code>):** <a id="dt-e8e2f7d7ecdebb81c712"></a> <span id="dt-1a51fa9eec7d4fe91130"><code>&#34;core&#45;supply&#34;</code></span>, <span id="dt-a1f07a977cb8e39a4174"><code>&#34;io&#45;supply&#34;</code></span>

<a id="dt-1c66024c2be5a725f708"></a>

### Rule 5

> <a id="dt-30dd43480a02ff52099e"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-815e247e2e39708faa21"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-95159efb137dae08a1e1"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > **Exact value (<code>const</code>):** <span id="dt-d589629a4de865435b4c"><code>&#34;mediatek&#44;mt7531&#34;</code></span>
>
> <a id="dt-b13bdf6bf01ba2db1729"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-63ad1b6e4041ecb9414c">[<code>&#35;&#47;&#36;defs&#47;mt7531&#45;dsa&#45;port</code>](<#dt-3ef0b74397cc45f9cdf4>)</span>
> >
> > <a id="dt-61105cb355bf27434ff1"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-331422543613cda8fbe2"></a>
> >
> > **<code>gpio&#45;controller</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.
> >
> > <a id="dt-44fee5302522f40fb6d9"></a>
> >
> > **<code>mediatek&#44;mcm</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.

<a id="dt-51879ae9be030b28e888"></a>

### Rule 6

> <a id="dt-29f1a7d11303016de0fb"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-31db8c2b34419cd49333"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-049791ad441d801be5c0"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > **Exact value (<code>const</code>):** <span id="dt-77a1fb412c20aee0905b"><code>&#34;mediatek&#44;mt7621&#34;</code></span>
>
> <a id="dt-5d3814a6fa606b79b9a6"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-54fd8709479a5b62bfa7">[<code>&#35;&#47;&#36;defs&#47;mt7530&#45;dsa&#45;port</code>](<#dt-cdfa92e67bd2359f4f7e>)</span>
> >
> > **Required in this object (<code>required</code>):** <a id="dt-4d24b4f1e20ac26d3bb0"></a> <span id="dt-5222e20791875e6a5bb0"><code>&#34;mediatek&#44;mcm&#34;</code></span>

<a id="dt-60e5f24c7565f25c976f"></a>

### Rule 7

> <a id="dt-adc37659b18b744ffc21"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-d05034e35339a4228f73"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-012adea3ff9b123e6012"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > **Allowed values (<code>enum</code>):** <a id="dt-8ba93bbe03f8029ad704"></a> <span id="dt-95e341bbffb420ba155f"><code>&#34;mediatek&#44;mt7988&#45;switch&#34;</code></span>, <span id="dt-e618575a8c92d4b1c15b"><code>&#34;airoha&#44;en7581&#45;switch&#34;</code></span>, <span id="dt-98c542467dbf490d3422"><code>&#34;airoha&#44;an7583&#45;switch&#34;</code></span>
>
> <a id="dt-53bae45a2e235a9fb120"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-e35fc72fd5f84e31ba99">[<code>&#35;&#47;&#36;defs&#47;builtin&#45;dsa&#45;port</code>](<#dt-74b1965a563ce37a01ce>)</span>
> >
> > <a id="dt-46da8c9fe8477efbe234"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-1a8aa0090f62f3376144"></a>
> >
> > **<code>gpio&#45;controller</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.
> >
> > <a id="dt-1c6d19ac1a4cfe0456ea"></a>
> >
> > **<code>mediatek&#44;mcm</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.
> >
> > <a id="dt-f687adad21d5131e22c7"></a>
> >
> > **<code>reset&#45;names</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.

<a id="dt-63ab525a9812ac23c446"></a>

## Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/gpio/gpio.h&gt;

mdio {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    switch@1f {
        compatible = "mediatek,mt7530";
        reg = &lt;0x1f&gt;;

        reset-gpios = &lt;&amp;pio 33 0&gt;;

        core-supply = &lt;&amp;mt6323_vpa_reg&gt;;
        io-supply = &lt;&amp;mt6323_vemc3v3_reg&gt;;

        ethernet-ports {
            #address-cells = &lt;1&gt;;
            #size-cells = &lt;0&gt;;

            port@0 {
                reg = &lt;0&gt;;
                label = "lan1";
            };

            port@1 {
                reg = &lt;1&gt;;
                label = "lan2";
            };

            port@2 {
                reg = &lt;2&gt;;
                label = "lan3";
            };

            port@3 {
                reg = &lt;3&gt;;
                label = "lan4";
            };

            port@4 {
                reg = &lt;4&gt;;
                label = "wan";
            };

            port@6 {
                reg = &lt;6&gt;;
                ethernet = &lt;&amp;gmac0&gt;;
                phy-mode = "rgmii";

                fixed-link {
                    speed = &lt;1000&gt;;
                    full-duplex;
                    pause;
                };
            };
        };
    };
};
</code></pre>

<pre id="dt-bae0d43ea48e35208b4a"><code class="language-dts">#include &lt;dt-bindings/reset/mt2701-resets.h&gt;

mdio {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    switch@1f {
        compatible = "mediatek,mt7530";
        reg = &lt;0x1f&gt;;

        mediatek,mcm;
        resets = &lt;&amp;ethsys MT2701_ETHSYS_MCM_RST&gt;;
        reset-names = "mcm";

        core-supply = &lt;&amp;mt6323_vpa_reg&gt;;
        io-supply = &lt;&amp;mt6323_vemc3v3_reg&gt;;

        ethernet-ports {
            #address-cells = &lt;1&gt;;
            #size-cells = &lt;0&gt;;

            port@0 {
                reg = &lt;0&gt;;
                label = "lan1";
            };

            port@1 {
                reg = &lt;1&gt;;
                label = "lan2";
            };

            port@2 {
                reg = &lt;2&gt;;
                label = "lan3";
            };

            port@3 {
                reg = &lt;3&gt;;
                label = "lan4";
            };

            port@4 {
                reg = &lt;4&gt;;
                label = "wan";
            };

            port@6 {
                reg = &lt;6&gt;;
                ethernet = &lt;&amp;gmac0&gt;;
                phy-mode = "trgmii";

                fixed-link {
                    speed = &lt;1000&gt;;
                    full-duplex;
                    pause;
                };
            };
        };
    };
};
</code></pre>

<pre id="dt-d0212a4cd671f89a0b40"><code class="language-dts">#include &lt;dt-bindings/gpio/gpio.h&gt;
#include &lt;dt-bindings/interrupt-controller/irq.h&gt;

mdio {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    switch@0 {
        compatible = "mediatek,mt7531";
        reg = &lt;0&gt;;

        reset-gpios = &lt;&amp;pio 54 0&gt;;

        interrupt-controller;
        #interrupt-cells = &lt;1&gt;;
        interrupt-parent = &lt;&amp;pio&gt;;
        interrupts = &lt;53 IRQ_TYPE_LEVEL_HIGH&gt;;

        ethernet-ports {
            #address-cells = &lt;1&gt;;
            #size-cells = &lt;0&gt;;

            port@0 {
                reg = &lt;0&gt;;
                label = "lan1";
            };

            port@1 {
                reg = &lt;1&gt;;
                label = "lan2";
            };

            port@2 {
                reg = &lt;2&gt;;
                label = "lan3";
            };

            port@3 {
                reg = &lt;3&gt;;
                label = "lan4";
            };

            port@4 {
                reg = &lt;4&gt;;
                label = "wan";
            };

            port@6 {
                reg = &lt;6&gt;;
                ethernet = &lt;&amp;gmac0&gt;;
                phy-mode = "2500base-x";

                fixed-link {
                    speed = &lt;2500&gt;;
                    full-duplex;
                    pause;
                };
            };
        };
    };
};
</code></pre>

<pre id="dt-cf8a683b5a963eb1c566"><code class="language-dts">#include &lt;dt-bindings/interrupt-controller/mips-gic.h&gt;
#include &lt;dt-bindings/reset/mt7621-reset.h&gt;

mdio {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    switch@1f {
        compatible = "mediatek,mt7621";
        reg = &lt;0x1f&gt;;

        mediatek,mcm;
        resets = &lt;&amp;sysc MT7621_RST_MCM&gt;;
        reset-names = "mcm";

        interrupt-controller;
        #interrupt-cells = &lt;1&gt;;
        interrupt-parent = &lt;&amp;gic&gt;;
        interrupts = &lt;GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH&gt;;

        ethernet-ports {
            #address-cells = &lt;1&gt;;
            #size-cells = &lt;0&gt;;

            port@0 {
                reg = &lt;0&gt;;
                label = "lan1";
            };

            port@1 {
                reg = &lt;1&gt;;
                label = "lan2";
            };

            port@2 {
                reg = &lt;2&gt;;
                label = "lan3";
            };

            port@3 {
                reg = &lt;3&gt;;
                label = "lan4";
            };

            port@4 {
                reg = &lt;4&gt;;
                label = "wan";
            };

            port@6 {
                reg = &lt;6&gt;;
                ethernet = &lt;&amp;gmac0&gt;;
                phy-mode = "trgmii";

                fixed-link {
                    speed = &lt;1000&gt;;
                    full-duplex;
                    pause;
                };
            };
        };
    };
};
</code></pre>

<pre id="dt-89dd782fdab7d446b5b9"><code class="language-dts">#include &lt;dt-bindings/interrupt-controller/mips-gic.h&gt;
#include &lt;dt-bindings/reset/mt7621-reset.h&gt;

ethernet {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    pinctrl-names = "default";
    pinctrl-0 = &lt;&amp;rgmii2_pins&gt;;

    mac@1 {
        compatible = "mediatek,eth-mac";
        reg = &lt;1&gt;;

        phy-mode = "rgmii";
        phy-handle = &lt;&amp;example5_ethphy4&gt;;
    };

    mdio {
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;

        /* MT7530's phy4 */
        example5_ethphy4: ethernet-phy@4 {
            reg = &lt;4&gt;;
        };

        switch@1f {
            compatible = "mediatek,mt7621";
            reg = &lt;0x1f&gt;;

            mediatek,mcm;
            resets = &lt;&amp;sysc MT7621_RST_MCM&gt;;
            reset-names = "mcm";

            interrupt-controller;
            #interrupt-cells = &lt;1&gt;;
            interrupt-parent = &lt;&amp;gic&gt;;
            interrupts = &lt;GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH&gt;;

            ethernet-ports {
                #address-cells = &lt;1&gt;;
                #size-cells = &lt;0&gt;;

                port@0 {
                    reg = &lt;0&gt;;
                    label = "lan1";
                };

                port@1 {
                    reg = &lt;1&gt;;
                    label = "lan2";
                };

                port@2 {
                    reg = &lt;2&gt;;
                    label = "lan3";
                };

                port@3 {
                    reg = &lt;3&gt;;
                    label = "lan4";
                };

                /* Commented out, phy4 is connected to gmac1.
                port@4 {
                    reg = &lt;4&gt;;
                    label = "wan";
                };
                */

                port@6 {
                    reg = &lt;6&gt;;
                    ethernet = &lt;&amp;gmac0&gt;;
                    phy-mode = "trgmii";

                    fixed-link {
                        speed = &lt;1000&gt;;
                        full-duplex;
                        pause;
                    };
                };
            };
        };
    };
};
</code></pre>

<pre id="dt-0a7a1e02b6a2bd0df8c7"><code class="language-dts">#include &lt;dt-bindings/interrupt-controller/mips-gic.h&gt;
#include &lt;dt-bindings/reset/mt7621-reset.h&gt;

ethernet {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    pinctrl-names = "default";
    pinctrl-0 = &lt;&amp;rgmii2_pins&gt;;

    mac@1 {
        compatible = "mediatek,eth-mac";
        reg = &lt;1&gt;;

        phy-mode = "rgmii";
        phy-handle = &lt;&amp;example6_ethphy7&gt;;
    };

    mdio {
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;

        /* External PHY */
        example6_ethphy7: ethernet-phy@7 {
            reg = &lt;7&gt;;
            phy-mode = "rgmii";
        };

        switch@1f {
            compatible = "mediatek,mt7621";
            reg = &lt;0x1f&gt;;

            mediatek,mcm;
            resets = &lt;&amp;sysc MT7621_RST_MCM&gt;;
            reset-names = "mcm";

            interrupt-controller;
            #interrupt-cells = &lt;1&gt;;
            interrupt-parent = &lt;&amp;gic&gt;;
            interrupts = &lt;GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH&gt;;

            ethernet-ports {
                #address-cells = &lt;1&gt;;
                #size-cells = &lt;0&gt;;

                port@0 {
                    reg = &lt;0&gt;;
                    label = "lan1";
                };

                port@1 {
                    reg = &lt;1&gt;;
                    label = "lan2";
                };

                port@2 {
                    reg = &lt;2&gt;;
                    label = "lan3";
                };

                port@3 {
                    reg = &lt;3&gt;;
                    label = "lan4";
                };

                port@4 {
                    reg = &lt;4&gt;;
                    label = "wan";
                };

                port@6 {
                    reg = &lt;6&gt;;
                    ethernet = &lt;&amp;gmac0&gt;;
                    phy-mode = "trgmii";

                    fixed-link {
                        speed = &lt;1000&gt;;
                        full-duplex;
                        pause;
                    };
                };
            };
        };
    };
};
</code></pre>

<pre id="dt-f015148604ca561352a9"><code class="language-dts">#include &lt;dt-bindings/interrupt-controller/mips-gic.h&gt;
#include &lt;dt-bindings/reset/mt7621-reset.h&gt;

ethernet {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    pinctrl-names = "default";
    pinctrl-0 = &lt;&amp;rgmii2_pins&gt;;

    mdio {
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;

        /* External PHY */
        example7_ethphy7: ethernet-phy@7 {
            reg = &lt;7&gt;;
            phy-mode = "rgmii";
        };

        switch@1f {
            compatible = "mediatek,mt7621";
            reg = &lt;0x1f&gt;;

            mediatek,mcm;
            resets = &lt;&amp;sysc MT7621_RST_MCM&gt;;
            reset-names = "mcm";

            interrupt-controller;
            #interrupt-cells = &lt;1&gt;;
            interrupt-parent = &lt;&amp;gic&gt;;
            interrupts = &lt;GIC_SHARED 23 IRQ_TYPE_LEVEL_HIGH&gt;;

            ethernet-ports {
                #address-cells = &lt;1&gt;;
                #size-cells = &lt;0&gt;;

                port@0 {
                    reg = &lt;0&gt;;
                    label = "lan1";
                };

                port@1 {
                    reg = &lt;1&gt;;
                    label = "lan2";
                };

                port@2 {
                    reg = &lt;2&gt;;
                    label = "lan3";
                };

                port@3 {
                    reg = &lt;3&gt;;
                    label = "lan4";
                };

                port@4 {
                    reg = &lt;4&gt;;
                    label = "wan";
                };

                port@5 {
                    reg = &lt;5&gt;;
                    label = "extphy";
                    phy-mode = "rgmii-txid";
                    phy-handle = &lt;&amp;example7_ethphy7&gt;;
                };

                port@6 {
                    reg = &lt;6&gt;;
                    ethernet = &lt;&amp;gmac0&gt;;
                    phy-mode = "trgmii";

                    fixed-link {
                        speed = &lt;1000&gt;;
                        full-duplex;
                        pause;
                    };
                };
            };
        };
    };
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)</span></p>

<p id="dt-comment-1"><strong>Line 331:</strong> <span> Example 1: Standalone MT7530</span></p>

<p id="dt-comment-2"><strong>Line 392:</strong> <span> Example 2: MT7530 in MT7623AI SoC</span></p>

<p id="dt-comment-3"><strong>Line 455:</strong> <span> Example 3: Standalone MT7531</span></p>

<p id="dt-comment-4"><strong>Line 519:</strong> <span> Example 4: MT7530 in MT7621AT, MT7621DAT and MT7621ST SoCs</span></p>

<p id="dt-comment-5"><strong>Line 585:</strong> <span> Example 5: MT7621: mux MT7530's phy4 to SoC's gmac1</span></p>

<p id="dt-comment-6"><strong>Line 674:</strong> <span> Example 6: MT7621: mux external phy to SoC's gmac1</span></p>

<p id="dt-comment-7"><strong>Line 762:</strong> <span> Example 7: MT7621: mux external phy to MT7530's port 5</span></p>

</details>
