# MediaTek MT7621 PCIe controller

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

> Device-tree binding reference for MediaTek MT7621 PCIe controller.

<!-- 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;pci&#47;mediatek&#44;mt7621&#45;pcie&#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;Sergio Paracuellos &#60;sergio&#46;paracuellos&#64;gmail&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">MediaTek MT7621 PCIe subsys supports a single Root Complex (RC)
with 3 Root Ports. Each Root Port supports a Gen1 1-lane Link</p>
<pre><code>                        MT7621 PCIe HOST Topology</code></pre>
<pre><code>                                 .-------.
                                 |       |
                                 |  CPU  |
                                 |       |
                                 '-------'
                                     |
                                     |
                                     |
                                     v
                            .------------------.
                .-----------|  HOST/PCI Bridge |------------.
                |           '------------------'            | Type1
           BUS0 |                     |                     | Access
                v                     v                     v On Bus0
        .-------------.        .-------------.       .-------------.
        | VIRTUAL P2P |        | VIRTUAL P2P |       | VIRTUAL P2P |
        |    BUS0     |        |    BUS0     |       |    BUS0     |
        |    DEV0     |        |    DEV1     |       |    DEV2     |
        '-------------'        '-------------'       '-------------'
  Type0        |          Type0       |         Type0       |
 Access   BUS1 |         Access   BUS2|        Access   BUS3|
 On Bus1       v         On Bus2      v        On Bus3      v
         .----------.           .----------.          .----------.
         | Device 0 |           | Device 0 |          | Device 0 |
         |  Func 0  |           |  Func 0  |          |  Func 0  |
         '----------'           '----------'          '----------'</code></pre>
</div>

<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>&#47;schemas&#47;pci&#47;pci&#45;host&#45;bridge&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-shared/pci/pci-host-bridge.md#dt-root>)</span>

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

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

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

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

**Exact value (<code>const</code>):** <span id="dt-1765195bf8e86c3ccec6"><code>&#34;mediatek&#44;mt7621&#45;pci&#34;</code></span>

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

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

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

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

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

**Item 1**

> <div id="dt-e773fec0b410a1422253">
> <p style="white-space: pre-wrap">host-pci bridge registers</p>
> </div>

<a id="dt-302751dd79bfd514b9d7"></a>

**Item 2**

> <div id="dt-b729cb065b03c20c0e01">
> <p style="white-space: pre-wrap">pcie port 0 RC control registers</p>
> </div>

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

**Item 3**

> <div id="dt-5151e97c331b693ee0dd">
> <p style="white-space: pre-wrap">pcie port 1 RC control registers</p>
> </div>

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

**Item 4**

> <div id="dt-e7b71b4619e949c538b1">
> <p style="white-space: pre-wrap">pcie port 2 RC control registers</p>
> </div>

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

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

**Maximum number of items (<code>maxItems</code>):** <span id="dt-7928d91ff1b85834b6df"><code>2</code></span>

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

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

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

### <code>&#94;pcie&#64;&#91;0&#45;2&#93;&#44;0&#36;</code> — name matches this regular expression

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

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-08c09d67953692d4779c">[<code>&#47;schemas&#47;pci&#47;pci&#45;pci&#45;bridge&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-shared/pci/pci-pci-bridge.md#dt-root>)</span>

<a id="dt-00715e5830d8d8cc63b6"></a>

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

<a id="dt-140cfa97afa01453fb47"></a>

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

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

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

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

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

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

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

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

<a id="dt-5838556ed124926c313e"></a>

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

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

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

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

**String pattern (<code>pattern</code>):** <span id="dt-3f3c9bcd72657c940ba5"><code>&#34;&#94;pcie&#45;phy&#91;0&#45;2&#93;&#36;&#34;</code></span>

**Required in this object (<code>required</code>):** <a id="dt-af965565f26c49d12d8f"></a> <span id="dt-26c101d025598ff4729e"><code>&#34;&#35;interrupt&#45;cells&#34;</code></span>, <span id="dt-1d4ca763e1e1636d5cbe"><code>&#34;interrupt&#45;map&#45;mask&#34;</code></span>, <span id="dt-454c3e0f81f10f842f1a"><code>&#34;interrupt&#45;map&#34;</code></span>, <span id="dt-0004a05d3d2d7d438ecb"><code>&#34;resets&#34;</code></span>, <span id="dt-360d82662a600748a924"><code>&#34;clocks&#34;</code></span>, <span id="dt-773971f083211a658c1f"><code>&#34;phys&#34;</code></span>, <span id="dt-2913ba318a3e23c0be8c"><code>&#34;phy&#45;names&#34;</code></span>, <span id="dt-66997a148a5971b80725"><code>&#34;ranges&#34;</code></span>

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

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

<code>false</code>

Not allowed by this rule.

**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;&#35;interrupt&#45;cells&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;interrupt&#45;map&#45;mask&#34;</code></span>, <span id="dt-c127a87237cb22622910"><code>&#34;interrupt&#45;map&#34;</code></span>, <span id="dt-a5d07fc4223c155670a0"><code>&#34;reset&#45;gpios&#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/interrupt-controller/mips-gic.h&gt;

pcie: pcie@1e140000 {
    compatible = "mediatek,mt7621-pci";
    reg = &lt;0x1e140000 0x100&gt;,
          &lt;0x1e142000 0x100&gt;,
          &lt;0x1e143000 0x100&gt;,
          &lt;0x1e144000 0x100&gt;;

    #address-cells = &lt;3&gt;;
    #size-cells = &lt;2&gt;;
    pinctrl-names = "default";
    pinctrl-0 = &lt;&amp;pcie_pins&gt;;
    device_type = "pci";
    ranges = &lt;0x02000000 0 0x60000000 0x60000000 0 0x10000000&gt;,  /* pci memory */
             &lt;0x01000000 0 0x1e160000 0x1e160000 0 0x00010000&gt;;  /* io space */
    #interrupt-cells = &lt;1&gt;;
    interrupt-map-mask = &lt;0xF800 0 0 0&gt;;
    interrupt-map = &lt;0x0000 0 0 0 &amp;gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH&gt;,
                    &lt;0x0800 0 0 0 &amp;gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH&gt;,
                    &lt;0x1000 0 0 0 &amp;gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH&gt;;
    reset-gpios = &lt;&amp;gpio 19 GPIO_ACTIVE_LOW&gt;;

    pcie@0,0 {
        reg = &lt;0x0000 0 0 0 0&gt;;
        #address-cells = &lt;3&gt;;
        #size-cells = &lt;2&gt;;
        device_type = "pci";
        #interrupt-cells = &lt;1&gt;;
        interrupt-map-mask = &lt;0 0 0 0&gt;;
        interrupt-map = &lt;0 0 0 0 &amp;gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH&gt;;
        resets = &lt;&amp;rstctrl 24&gt;;
        clocks = &lt;&amp;clkctrl 24&gt;;
        phys = &lt;&amp;pcie0_phy 1&gt;;
        phy-names = "pcie-phy0";
        ranges;
    };

    pcie@1,0 {
        reg = &lt;0x0800 0 0 0 0&gt;;
        #address-cells = &lt;3&gt;;
        #size-cells = &lt;2&gt;;
        device_type = "pci";
        #interrupt-cells = &lt;1&gt;;
        interrupt-map-mask = &lt;0 0 0 0&gt;;
        interrupt-map = &lt;0 0 0 0 &amp;gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH&gt;;
        resets = &lt;&amp;rstctrl 25&gt;;
        clocks = &lt;&amp;clkctrl 25&gt;;
        phys = &lt;&amp;pcie0_phy 1&gt;;
        phy-names = "pcie-phy1";
        ranges;
    };

    pcie@2,0 {
        reg = &lt;0x1000 0 0 0 0&gt;;
        #address-cells = &lt;3&gt;;
        #size-cells = &lt;2&gt;;
        device_type = "pci";
        #interrupt-cells = &lt;1&gt;;
        interrupt-map-mask = &lt;0 0 0 0&gt;;
        interrupt-map = &lt;0 0 0 0 &amp;gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH&gt;;
        resets = &lt;&amp;rstctrl 26&gt;;
        clocks = &lt;&amp;clkctrl 26&gt;;
        phys = &lt;&amp;pcie2_phy 0&gt;;
        phy-names = "pcie-phy2";
        ranges;
    };
};
</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>
