# HiSilicon Kirin SoCs PCIe host DT description

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

> Device-tree binding reference for HiSilicon Kirin SoCs PCIe host DT description.

<!-- SPDX-License-Identifier: GPL-2.0 -->


<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;hisilicon&#44;kirin&#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;Xiaowei Song &#60;songxiaowei&#64;hisilicon&#46;com&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Binghui Wang &#60;wangbinghui&#64;hisilicon&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Kirin PCIe host controller is based on the Synopsys DesignWare PCI core.
It shares common functions with the PCIe DesignWare core driver and
inherits common properties defined in
Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml.</p>
</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;snps&#44;dw&#45;pcie&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-pci/snps-dw-pcie.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

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

#### Rule for matching array elements (<code>contains</code>)

> **Allowed values (<code>enum</code>):** <a id="dt-e94a17cf5e636efa744d"></a> <span id="dt-fc12e483d817548be400"><code>&#34;hisilicon&#44;kirin960&#45;pcie&#34;</code></span>, <span id="dt-20064a6865f5d9b325e1"><code>&#34;hisilicon&#44;kirin970&#45;pcie&#34;</code></span>

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

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

<div id="dt-571d87f60678ead6c5ff">
<p style="white-space: pre-wrap">Should contain dbi, apb, config registers location and length.
For hisilicon,kirin960-pcie, it should also contain phy.</p>
</div>

**Minimum number of items (<code>minItems</code>):** <span id="dt-4b3e7791b11b96c3db87"><code>3</code></span>

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

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

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

**Minimum number of items (<code>minItems</code>):** <span id="dt-3f2820449161ca72af98"><code>3</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-58a7d566e1c7a6b0e414"><code>4</code></span>

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

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

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

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

### <code>clock&#45;names</code> — not listed as 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;pcie&#95;phy&#95;ref&#34;</code></span>

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

**Item 2**

> **Exact value (<code>const</code>):** <span id="dt-0298e5f353a64a09a8a6"><code>&#34;pcie&#95;aux&#34;</code></span>

<a id="dt-261be8310c899fd46631"></a>

**Item 3**

> **Exact value (<code>const</code>):** <span id="dt-ad55fa67f3e765bf6ab6"><code>&#34;pcie&#95;apb&#95;phy&#34;</code></span>

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

**Item 4**

> **Exact value (<code>const</code>):** <span id="dt-a00c09b3bb0bf38fee22"><code>&#34;pcie&#95;apb&#95;sys&#34;</code></span>

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

**Item 5**

> **Exact value (<code>const</code>):** <span id="dt-0662e29e8e0f6fa46046"><code>&#34;pcie&#95;aclk&#34;</code></span>

<a id="dt-398f0f80d64ad8c16804"></a>

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

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

<a id="dt-17397b244cddacd7b235"></a>

### <code>hisilicon&#44;clken&#45;gpios</code> — not listed as required here

<div id="dt-23472cfb88248b7ec975">
<p style="white-space: pre-wrap">Clock input enablement GPIOs from PCI devices like Ethernet, M.2 and
mini-PCIe slots.</p>
</div>

**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;reg&#45;names&#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/interrupt-controller/arm-gic.h&gt;
#include &lt;dt-bindings/clock/hi3660-clock.h&gt;
#include &lt;dt-bindings/clock/hi3670-clock.h&gt;

soc {
  #address-cells = &lt;2&gt;;
  #size-cells = &lt;2&gt;;

  pcie@f4000000 {
    compatible = "hisilicon,kirin960-pcie";
    reg = &lt;0x0 0xf4000000 0x0 0x1000&gt;,
          &lt;0x0 0xff3fe000 0x0 0x1000&gt;,
          &lt;0x0 0xf3f20000 0x0 0x40000&gt;,
          &lt;0x0 0xf5000000 0x0 0x2000&gt;;
    reg-names = "dbi", "apb", "phy", "config";
    bus-range = &lt;0x0  0xff&gt;;
    #address-cells = &lt;3&gt;;
    #size-cells = &lt;2&gt;;
    device_type = "pci";
    ranges = &lt;0x02000000 0x0 0x00000000
              0x0 0xf6000000
              0x0 0x02000000&gt;;
    num-lanes = &lt;1&gt;;
    #interrupt-cells = &lt;1&gt;;
    interrupts = &lt;0 283 4&gt;;
    interrupt-names = "msi";
    interrupt-map-mask = &lt;0xf800 0 0 7&gt;;
    interrupt-map = &lt;0x0 0 0 1 &amp;gic GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH&gt;,
                    &lt;0x0 0 0 2 &amp;gic GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH&gt;,
                    &lt;0x0 0 0 3 &amp;gic GIC_SPI 284 IRQ_TYPE_LEVEL_HIGH&gt;,
                    &lt;0x0 0 0 4 &amp;gic GIC_SPI 285 IRQ_TYPE_LEVEL_HIGH&gt;;
    clocks = &lt;&amp;crg_ctrl HI3660_PCIEPHY_REF&gt;,
             &lt;&amp;crg_ctrl HI3660_CLK_GATE_PCIEAUX&gt;,
             &lt;&amp;crg_ctrl HI3660_PCLK_GATE_PCIE_PHY&gt;,
             &lt;&amp;crg_ctrl HI3660_PCLK_GATE_PCIE_SYS&gt;,
             &lt;&amp;crg_ctrl HI3660_ACLK_GATE_PCIE&gt;;
    clock-names = "pcie_phy_ref", "pcie_aux", "pcie_apb_phy",
                  "pcie_apb_sys", "pcie_aclk";
  };

  pcie@f5000000 {
    compatible = "hisilicon,kirin970-pcie";
    reg = &lt;0x0 0xf4000000 0x0 0x1000000&gt;,
          &lt;0x0 0xfc180000 0x0 0x1000&gt;,
          &lt;0x0 0xf5000000 0x0 0x2000&gt;;
    reg-names = "dbi", "apb", "config";
    bus-range = &lt;0x0  0xff&gt;;
    #address-cells = &lt;3&gt;;
    #size-cells = &lt;2&gt;;
    device_type = "pci";
    phys = &lt;&amp;pcie_phy&gt;;
    ranges = &lt;0x02000000 0x0 0x00000000
              0x0 0xf6000000
              0x0 0x02000000&gt;;
    num-lanes = &lt;1&gt;;
    #interrupt-cells = &lt;1&gt;;
    interrupts = &lt;GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH&gt;;
    interrupt-names = "msi";
    interrupt-map-mask = &lt;0 0 0 7&gt;;
    interrupt-map = &lt;0x0 0 0 1 &amp;gic GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH&gt;,
                    &lt;0x0 0 0 2 &amp;gic GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH&gt;,
                    &lt;0x0 0 0 3 &amp;gic GIC_SPI 284 IRQ_TYPE_LEVEL_HIGH&gt;,
                    &lt;0x0 0 0 4 &amp;gic GIC_SPI 285 IRQ_TYPE_LEVEL_HIGH&gt;;
    reset-gpios = &lt;&amp;gpio7 0 0&gt;;
    hisilicon,clken-gpios = &lt;&amp;gpio27 3 0&gt;, &lt;&amp;gpio17 0 0&gt;, &lt;&amp;gpio20 6 0&gt;;
    pcie@0,0 { // Lane 0: PCIe switch: Bus 1, Device 0
      reg = &lt;0 0 0 0 0&gt;;
      compatible = "pciclass,0604";
      device_type = "pci";
      #address-cells = &lt;3&gt;;
      #size-cells = &lt;2&gt;;
      ranges;

      pcie@0,0 { // Lane 0: upstream
        reg = &lt;0 0 0 0 0&gt;;
        compatible = "pciclass,0604";
        device_type = "pci";
        #address-cells = &lt;3&gt;;
        #size-cells = &lt;2&gt;;
        ranges;

        pcie@1,0 { // Lane 4: M.2
          reg = &lt;0x0800 0 0 0 0&gt;;
          compatible = "pciclass,0604";
          device_type = "pci";
          reset-gpios = &lt;&amp;gpio3 1 0&gt;;
          #address-cells = &lt;3&gt;;
          #size-cells = &lt;2&gt;;
          ranges;
        };

        pcie@5,0 { // Lane 5: Mini PCIe
          reg = &lt;0x2800 0 0 0 0&gt;;
          compatible = "pciclass,0604";
          device_type = "pci";
          reset-gpios = &lt;&amp;gpio27 4 0 &gt;;
          #address-cells = &lt;3&gt;;
          #size-cells = &lt;2&gt;;
          ranges;
        };

        pcie@7,0 { // Lane 6: Ethernet
          reg = &lt;0x03800 0 0 0 0&gt;;
          compatible = "pciclass,0604";
          device_type = "pci";
          reset-gpios = &lt;&amp;gpio25 2 0 &gt;;
          #address-cells = &lt;3&gt;;
          #size-cells = &lt;2&gt;;
          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</span></p>

</details>
