# Qualcomm Atheros QCA83xx switch family

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

> Device-tree binding reference for Qualcomm Atheros QCA83xx switch family.

<!-- 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;qca8k&#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;John Crispin &#60;john&#64;phrozen&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">If the QCA8K switch is connect to an SoC's external mdio-bus, each subnode describing a port needs to have a valid phandle referencing the internal PHY it is connected to. This is because there is no N:N mapping of port and PHY ID. To declare the internal mdio-bus configuration, declare an MDIO node in the switch node and declare the phandle for the port, referencing the internal PHY it is connected to. In this config, an internal mdio-bus is registered and the MDIO master is used for communication. Mixed external and internal mdio-bus configurations are not supported by the hardware. Each phy has at most 3 LEDs connected and can be declared using the standard LEDs structure.</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**

> **Allowed values (<code>enum</code>):** <a id="dt-617e1a2040e2496013d4"></a> <span id="dt-c31075c43df89b2793e3"><code>&#34;qca&#44;qca8327&#34;</code></span>, <span id="dt-44b402f75e7bf3caf313"><code>&#34;qca&#44;qca8328&#34;</code></span>, <span id="dt-f03e1478792ca587ff5c"><code>&#34;qca&#44;qca8334&#34;</code></span>, <span id="dt-34cab0afbb7f2b55efc5"><code>&#34;qca&#44;qca8337&#34;</code></span>

<div id="dt-e84064a2d568e9bcb9c3">
<p style="white-space: pre-wrap">qca,qca8328: referenced as AR8328(N)-AK1(A/B) QFN 176 pin package
qca,qca8327: referenced as AR8327(N)-AL1A DR-QFN 148 pin package
qca,qca8334: referenced as QCA8334-AL3C QFN 88 pin package
qca,qca8337: referenced as QCA8337N-AL3(B/C) DR-QFN 148 pin package</p>
</div>

<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-fdf18029f1f43a541a62"></a>

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

<div id="dt-451564af2b6998692dea">
<p style="white-space: pre-wrap">GPIO to be used to reset the whole device</p>
</div>

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

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

### <code>qca&#44;ignore&#45;power&#45;on&#45;sel</code> — not listed as required here

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

<div id="dt-b995562d4c8df863ac25">
<p style="white-space: pre-wrap">Ignore power-on pin strapping to configure LED open-drain or EEPROM presence. This is needed for devices with incorrect configuration or when the OEM has decided not to use pin strapping and falls back to SW regs.</p>
</div>

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

### <code>qca&#44;led&#45;open&#45;drain</code> — not listed as required here

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

<div id="dt-4b413dbef8c626b94b26">
<p style="white-space: pre-wrap">Set LEDs to open-drain mode. This requires the qca,ignore-power-on-sel to be set, otherwise the driver will fail at probe. This is required if the OEM does not use pin strapping to set this mode and prefers to set it using SW regs. The pin strappings related to LED open-drain mode are B68 on the QCA832x and B49 on the QCA833x.</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.

<div id="dt-b86f745d7bfe1958a20c">
<p style="white-space: pre-wrap">Qca8k switch have an internal mdio to access switch port. If this is not present, the legacy mapping is used and the internal mdio access is used. With the legacy mapping the reg corresponding to the internal mdio is the switch reg with an offset of -1.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-d5c57c22d966a033492b">[<code>dsa&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-net/dsa/dsa.md#dt-root>)</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>

<div id="dt-391a9b7cf869f6e12120">
<p style="white-space: pre-wrap">Ethernet switch ports</p>
</div>

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

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

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

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

**<code>qca&#44;sgmii&#45;rxclk&#45;falling&#45;edge</code> — not listed as required here**

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

<div id="dt-e551bb5f02d5b8945a39">
<p style="white-space: pre-wrap">Set the receive clock phase to falling edge. Mostly commonly used on the QCA8327 with CPU port 0 set to SGMII.</p>
</div>

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

**<code>qca&#44;sgmii&#45;txclk&#45;falling&#45;edge</code> — not listed as required here**

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

<div id="dt-0e902babfb376fda9df2">
<p style="white-space: pre-wrap">Set the transmit clock phase to falling edge.</p>
</div>

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

**<code>qca&#44;sgmii&#45;enable&#45;pll</code> — not listed as required here**

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

<div id="dt-317014c623e1d7d6ab6a">
<p style="white-space: pre-wrap">For SGMII CPU port, explicitly enable PLL, TX and RX chain along with Signal Detection. On the QCA8327 this should not be enabled, otherwise the SGMII port will not initialize. When used on the QCA8337, revision 3 or greater, a warning will be displayed. When the CPU port is set to SGMII on the QCA8337, it is advised to set this unless a communication issue is observed.</p>
</div>

<a id="dt-57f3e112380914e8b1ae"></a>

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

<code>false</code>

Not allowed by this rule.

<a id="dt-51356188806d31ca2021"></a>

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

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

### Rule 1

> **Required in this object (<code>required</code>):** <a id="dt-48cc38ffec184df79a62"></a> <span id="dt-bbd3b687ebb435349af2"><code>&#34;ports&#34;</code></span>

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

### Rule 2

> **Required in this object (<code>required</code>):** <a id="dt-686ce4562589647d257c"></a> <span id="dt-8060cb7221f215eec82f"><code>&#34;ethernet&#45;ports&#34;</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-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;
#include &lt;dt-bindings/leds/common.h&gt;

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

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

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

    external_phy_port3: ethernet-phy@2 {
        reg = &lt;2&gt;;
    };

    external_phy_port4: ethernet-phy@3 {
        reg = &lt;3&gt;;
    };

    external_phy_port5: ethernet-phy@4 {
        reg = &lt;4&gt;;
    };

    switch@10 {
        compatible = "qca,qca8337";
        reset-gpios = &lt;&amp;gpio 42 GPIO_ACTIVE_LOW&gt;;
        reg = &lt;0x10&gt;;

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

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

                fixed-link {
                    speed = &lt;1000&gt;;
                    full-duplex;
                };
            };

            port@1 {
                reg = &lt;1&gt;;
                label = "lan1";
                phy-handle = &lt;&amp;external_phy_port1&gt;;
            };

            port@2 {
                reg = &lt;2&gt;;
                label = "lan2";
                phy-handle = &lt;&amp;external_phy_port2&gt;;
            };

            port@3 {
                reg = &lt;3&gt;;
                label = "lan3";
                phy-handle = &lt;&amp;external_phy_port3&gt;;
            };

            port@4 {
                reg = &lt;4&gt;;
                label = "lan4";
                phy-handle = &lt;&amp;external_phy_port4&gt;;
            };

            port@5 {
                reg = &lt;5&gt;;
                label = "wan";
                phy-handle = &lt;&amp;external_phy_port5&gt;;
            };
        };
    };
};
</code></pre>

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

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

    switch@10 {
        compatible = "qca,qca8337";
        reset-gpios = &lt;&amp;gpio 42 GPIO_ACTIVE_LOW&gt;;
        reg = &lt;0x10&gt;;

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

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

                fixed-link {
                    speed = &lt;1000&gt;;
                    full-duplex;
                };
            };

            port@1 {
                reg = &lt;1&gt;;
                label = "lan1";
                phy-mode = "internal";
                phy-handle = &lt;&amp;internal_phy_port1&gt;;

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

                    led@0 {
                        reg = &lt;0&gt;;
                        color = &lt;LED_COLOR_ID_WHITE&gt;;
                        function = LED_FUNCTION_LAN;
                        default-state = "keep";
                    };

                    led@1 {
                        reg = &lt;1&gt;;
                        color = &lt;LED_COLOR_ID_AMBER&gt;;
                        function = LED_FUNCTION_LAN;
                        default-state = "keep";
                    };
                };
            };

            port@2 {
                reg = &lt;2&gt;;
                label = "lan2";
                phy-mode = "internal";
                phy-handle = &lt;&amp;internal_phy_port2&gt;;
            };

            port@3 {
                reg = &lt;3&gt;;
                label = "lan3";
                phy-mode = "internal";
                phy-handle = &lt;&amp;internal_phy_port3&gt;;
            };

            port@4 {
                reg = &lt;4&gt;;
                label = "lan4";
                phy-mode = "internal";
                phy-handle = &lt;&amp;internal_phy_port4&gt;;
            };

            port@5 {
                reg = &lt;5&gt;;
                label = "wan";
                phy-mode = "internal";
                phy-handle = &lt;&amp;internal_phy_port5&gt;;
            };

            port@6 {
                reg = &lt;0&gt;;
                ethernet = &lt;&amp;gmac1&gt;;
                phy-mode = "sgmii";

                qca,sgmii-rxclk-falling-edge;

                fixed-link {
                    speed = &lt;1000&gt;;
                    full-duplex;
                };
            };
        };

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

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

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

            internal_phy_port3: ethernet-phy@2 {
                reg = &lt;2&gt;;
            };

            internal_phy_port4: ethernet-phy@3 {
                reg = &lt;3&gt;;
            };

            internal_phy_port5: ethernet-phy@4 {
                reg = &lt;4&gt;;
            };
        };
    };
};
</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>
