# TI SoC Ethernet Switch Controller (CPSW)

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

> Device-tree binding reference for TI SoC Ethernet Switch Controller (CPSW).

<!-- 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;ti&#44;cpsw&#45;switch&#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;Siddharth Vadapalli &#60;s&#45;vadapalli&#64;ti&#46;com&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Roger Quadros &#60;rogerq&#64;kernel&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The 3-port switch gigabit ethernet subsystem provides ethernet packet communication and can be configured as an ethernet switch. It provides the gigabit media independent interface (GMII),reduced gigabit media independent interface (RGMII), reduced media independent interface (RMII), the management data input output (MDIO) for physical layer device (PHY) management.</p>
</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**

> **Exact value (<code>const</code>):** <span id="dt-d1fe1b456a54b64074d3"><code>&#34;ti&#44;cpsw&#45;switch&#34;</code></span>

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

**Rule 2**

> <a id="dt-4c3e118873fbaedb5de2"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-b02d8860067795c00ae4"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-82dceb5784ff71f5fdf5"><code>&#34;ti&#44;am335x&#45;cpsw&#45;switch&#34;</code></span>
>
> <a id="dt-bdc26de0ccb1d52bb6a4"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-cc26fa5d96bc7cf0a818"><code>&#34;ti&#44;cpsw&#45;switch&#34;</code></span>

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

**Rule 3**

> <a id="dt-e626d61e9d5d76cc48f9"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-6b46935eab08de6d1f0a"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-b4cf31a5f463012e1429"><code>&#34;ti&#44;am4372&#45;cpsw&#45;switch&#34;</code></span>
>
> <a id="dt-5ea82ea034747ba6da29"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-e9c55cb91230c7ee5a28"><code>&#34;ti&#44;cpsw&#45;switch&#34;</code></span>

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

**Rule 4**

> <a id="dt-a1b1c435b08c85ff96c7"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-4758c8f9c99bfa28b10c"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-4c3894ced8f7125f7050"><code>&#34;ti&#44;dra7&#45;cpsw&#45;switch&#34;</code></span>
>
> <a id="dt-c99d921c49bf15e79633"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-9e0f2ef968dd632f09b7"><code>&#34;ti&#44;cpsw&#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>

<div id="dt-571d87f60678ead6c5ff">
<p style="white-space: pre-wrap">The physical base address and size of full the CPSW module IO range</p>
</div>

<a id="dt-2efe70314a961a652abe"></a>

### <code>&#35;address&#45;cells</code> — required here

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

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

### <code>&#35;size&#45;cells</code> — required here

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

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

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

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

<a id="dt-4e9a371963ac013ad39d"></a>

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

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

<div id="dt-853257adf43f6880d753">
<p style="white-space: pre-wrap">CPSW functional clock</p>
</div>

<a id="dt-041d7cd76b652a5de06a"></a>

### <code>clock&#45;names</code> — required here

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

#### Array item rules (<code>items</code>)

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

**Item 1**

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

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

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

<a id="dt-985aed94c3a5de8e946a"></a>

#### Array item rules (<code>items</code>)

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

**Item 1**

> <div id="dt-094ee990c529b33ab668">
> <p style="white-space: pre-wrap">RX_THRESH interrupt</p>
> </div>

<a id="dt-14fdf3275cf454d3c593"></a>

**Item 2**

> <div id="dt-f26fcb0c97f34db34fe4">
> <p style="white-space: pre-wrap">RX interrupt</p>
> </div>

<a id="dt-6825e597892563d56556"></a>

**Item 3**

> <div id="dt-2c85367ad575dfda8b35">
> <p style="white-space: pre-wrap">TX interrupt</p>
> </div>

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

**Item 4**

> <div id="dt-aa4f93a6c04967e709f9">
> <p style="white-space: pre-wrap">MISC interrupt</p>
> </div>

<a id="dt-8aa4fd7705c68de75d2b"></a>

### <code>interrupt&#45;names</code> — required here

<a id="dt-77e94e63ca0b20bb5ef1"></a>

#### Array item rules (<code>items</code>)

<a id="dt-1198ecbdbe49337cf73e"></a>

**Item 1**

> **Exact value (<code>const</code>):** <span id="dt-7f7686a533ef09dda0b1"><code>&#34;rx&#95;thresh&#34;</code></span>

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

**Item 2**

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

<a id="dt-01a6f91e38388cdf0f5a"></a>

**Item 3**

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

<a id="dt-96b5fc50d1d5da0ddc64"></a>

**Item 4**

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

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

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

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

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

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

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-e9a926f7400630e8b664">[<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-94e0d14f31e0ec14b27a">
<p style="white-space: pre-wrap">Phandle to the system control device node which provides access to efuse IO range with MAC addresses</p>
</div>

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

### <code>ethernet&#45;ports</code> — not listed as required here

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

<a id="dt-8acae5f7ff8c8b519220"></a>

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

<code>false</code>

Not allowed by this rule.

<a id="dt-84829fab7b3297b72803"></a>

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

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

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

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

<a id="dt-293afd603e2b744b20b3"></a>

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

**Exact value (<code>const</code>):** <span id="dt-aaf1c56dd59fe2589222"><code>0</code></span>

<a id="dt-97278db8375fd8656b16"></a>

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

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

**<code>&#94;port&#64;&#91;12&#93;&#36;</code> — name matches this regular expression**

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

<div id="dt-d0669634b5c4d89f9da0">
<p style="white-space: pre-wrap">CPSW external ports</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-5e68aaed8cea47b52406">[<code>ethernet&#45;controller&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-net/ethernet-controller.md#dt-root>)</span>

<a id="dt-80d624cef0d682b917ef"></a>

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

<code>false</code>

Not allowed by this rule.

<a id="dt-84a8ba9e5ca188279ffb"></a>

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

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

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

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

**Array item rules (<code>items</code>)**

<a id="dt-32dec509498d2d30a12b"></a>

**Item 1**

> **Allowed values (<code>enum</code>):** <a id="dt-10b2f2aab7595c1c876a"></a> <span id="dt-6262bf6f319e05a7114c"><code>1</code></span>, <span id="dt-1d99f4f8d925a260b80c"><code>2</code></span>

<div id="dt-35f9bb0af2daf8402eaf">
<p style="white-space: pre-wrap">CPSW port number</p>
</div>

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

**<code>phys</code> — required here**

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

<div id="dt-f5608086f4af2283342b">
<p style="white-space: pre-wrap">phandle on phy-gmii-sel PHY</p>
</div>

<a id="dt-373312735f5a94e1c9b7"></a>

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

<div id="dt-0231f7df9b2f04e0bfad">
<p style="white-space: pre-wrap">label associated with this port</p>
</div>

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

**<code>ti&#44;dual&#45;emac&#45;pvid</code> — not listed as required here**

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

**Minimum value (<code>minimum</code>):** <span id="dt-0c28f7e9bd38eb2ed3be"><code>1</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-5a53c691942ac012727d"><code>1024</code></span>

<div id="dt-c848da49f81df891a302">
<p style="white-space: pre-wrap">Specifies default PORT VID to be used to segregate ports. Default value - CPSW port number.</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-131cc74d242b1ae44907"></a> <span id="dt-0027e2d7de3d44cdb57a"><code>&#34;reg&#34;</code></span>, <span id="dt-bec8ac2bf6e67a742611"><code>&#34;phys&#34;</code></span>

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

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

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

<a id="dt-68f692c9835d9aa3ea4c"></a>

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

<code>false</code>

Not allowed by this rule.

<div id="dt-4b4fdfb35ce28716ea16">
<p style="white-space: pre-wrap">The Common Platform Time Sync (CPTS) module</p>
</div>

<a id="dt-13f0d8aa1ec055f88ff6"></a>

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

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

**<code>clocks</code> — required here**

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

<div id="dt-4d2a488304bfbf2bafd8">
<p style="white-space: pre-wrap">CPTS reference clock</p>
</div>

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

**<code>clock&#45;names</code> — required here**

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

**Array item rules (<code>items</code>)**

<a id="dt-4211e6cca99507c0af4f"></a>

**Item 1**

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

<a id="dt-6627cb1a73608e108b58"></a>

**<code>cpts&#95;clock&#95;mult</code> — not listed as required here**

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

<div id="dt-c60154e3109e96a9792a">
<p style="white-space: pre-wrap">Numerator to convert input clock ticks into ns</p>
</div>

<a id="dt-2748029eec1dcaf4a5cb"></a>

**<code>cpts&#95;clock&#95;shift</code> — not listed as required here**

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

<div id="dt-0d97418b3ca4b2ae9c87">
<p style="white-space: pre-wrap">Denominator to convert input clock ticks into ns. Mult and shift will be calculated basing on CPTS rftclk frequency if both cpts_clock_shift and cpts_clock_mult properties are not provided.</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-7bb119bed8fce27b9904"></a> <span id="dt-9c4245a9a51e62787aa8"><code>&#34;clocks&#34;</code></span>, <span id="dt-abf82ecaa6cef74937a4"><code>&#34;clock&#45;names&#34;</code></span>

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

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

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

### <code>&#94;mdio&#64;</code> — name matches this regular expression

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

<div id="dt-8d0cd28ee60e70a6ea9e">
<p style="white-space: pre-wrap">CPSW MDIO bus.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-64152f78accc406a32d8">[<code>ti&#44;davinci&#45;mdio&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-net/ti-davinci-mdio.md#dt-root>)</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>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;ranges&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;clocks&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;clock&#45;names&#34;</code></span>, <span id="dt-c127a87237cb22622910"><code>&#34;interrupts&#34;</code></span>, <span id="dt-a5d07fc4223c155670a0"><code>&#34;interrupt&#45;names&#34;</code></span>, <span id="dt-4503833a9b225761c43a"><code>&#34;&#35;address&#45;cells&#34;</code></span>, <span id="dt-727c9b818c335e022c0e"><code>&#34;&#35;size&#45;cells&#34;</code></span>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</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/interrupt-controller/irq.h&gt;
#include &lt;dt-bindings/interrupt-controller/arm-gic.h&gt;
#include &lt;dt-bindings/clock/dra7.h&gt;

mac_sw: switch@0 {
    compatible = "ti,dra7-cpsw-switch","ti,cpsw-switch";
    reg = &lt;0x0 0x4000&gt;;
    ranges = &lt;0 0 0x4000&gt;;
    clocks = &lt;&amp;gmac_main_clk&gt;;
    clock-names = "fck";
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;
    syscon = &lt;&amp;scm_conf&gt;;

    interrupts = &lt;GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH&gt;,
                 &lt;GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH&gt;,
                 &lt;GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH&gt;,
                 &lt;GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH&gt;;
    interrupt-names = "rx_thresh", "rx", "tx", "misc";

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

            cpsw_port1: port@1 {
                    reg = &lt;1&gt;;
                    label = "port1";
                    mac-address = [ 00 00 00 00 00 00 ];
                    phys = &lt;&amp;phy_gmii_sel 1&gt;;
                    phy-handle = &lt;&amp;ethphy0_sw&gt;;
                    phy-mode = "rgmii";
                    ti,dual-emac-pvid = &lt;1&gt;;
            };

            cpsw_port2: port@2 {
                    reg = &lt;2&gt;;
                    label = "wan";
                    mac-address = [ 00 00 00 00 00 00 ];
                    phys = &lt;&amp;phy_gmii_sel 2&gt;;
                    phy-handle = &lt;&amp;ethphy1_sw&gt;;
                    phy-mode = "rgmii";
                    ti,dual-emac-pvid = &lt;2&gt;;
            };
    };

    davinci_mdio_sw: mdio@1000 {
            compatible = "ti,cpsw-mdio","ti,davinci_mdio";
            reg = &lt;0x1000 0x100&gt;;
            clocks = &lt;&amp;gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0&gt;;
            clock-names = "fck";
            #address-cells = &lt;1&gt;;
            #size-cells = &lt;0&gt;;
            bus_freq = &lt;1000000&gt;;

            ethphy0_sw: ethernet-phy@0 {
                    reg = &lt;0&gt;;
            };

            ethphy1_sw: ethernet-phy@1 {
                    reg = &lt;1&gt;;
            };
    };

    cpts {
            clocks = &lt;&amp;gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 25&gt;;
            clock-names = "cpts";
    };
};
</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>

</details>
