# Generic PCI host controller

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

> Device-tree binding reference for Generic PCI host 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;host&#45;generic&#45;pci&#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;Will Deacon &#60;will&#64;kernel&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Firmware-initialised PCI host controllers and PCI emulations, such as the
virtio-pci implementations found in kvmtool and other para-virtualised
systems, do not require driver support for complexities such as regulator
and clock management. In fact, the controller may not even require the
configuration of a control interface by the operating system, instead
presenting a set of fixed windows describing a subset of IO, Memory and
Configuration Spaces.</p>
<p style="white-space: pre-wrap">Configuration Space is assumed to be memory-mapped (as opposed to being
accessed via an ioport) and laid out with a direct correspondence to the
geography of a PCI bus address by concatenating the various components to
form an offset.</p>
<p style="white-space: pre-wrap">For CAM, this 24-bit offset is:</p>
<pre><code>        cfg_offset(bus, device, function, register) =
                   bus &lt;&lt; 16 | device &lt;&lt; 11 | function &lt;&lt; 8 | register</code></pre>
<p style="white-space: pre-wrap">While ECAM extends this by 4 bits to accommodate 4k of function space:</p>
<pre><code>        cfg_offset(bus, device, function, register) =
                   bus &lt;&lt; 20 | device &lt;&lt; 15 | function &lt;&lt; 12 | register</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

<div id="dt-e84064a2d568e9bcb9c3">
<p style="white-space: pre-wrap">Depends on the layout of configuration space (CAM vs ECAM respectively). May also have more specific compatibles.</p>
</div>

<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">PCIe host controller in Arm Juno based on PLDA XpressRICH3-AXI IP</p>
> </div>
>
> <a id="dt-07409cc9508405f48983"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-822691c82c9797f7b1f9"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-5deec2612224d8d915da"><code>&#34;arm&#44;juno&#45;r1&#45;pcie&#34;</code></span>
>
> <a id="dt-bc83d1191bdc72da8559"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-1da74b37131fdcec1073"><code>&#34;plda&#44;xpressrich3&#45;axi&#34;</code></span>
>
> <a id="dt-8aea0680b70f72ffdfb0"></a>
>
> **Item 3**
>
> > **Exact value (<code>const</code>):** <span id="dt-a8216d5f954c632b59e8"><code>&#34;pci&#45;host&#45;ecam&#45;generic&#34;</code></span>

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

**Rule 2**

> <div id="dt-4b64ce44adfe069638c4">
> <p style="white-space: pre-wrap">ThunderX PCI host controller for pass-1.x silicon</p>
> <p style="white-space: pre-wrap">Firmware-initialized PCI host controller to on-chip devices found on
> some Cavium ThunderX processors.  These devices have ECAM-based config
> access, but the BARs are all at fixed addresses.  We handle the fixed
> addresses by synthesizing Enhanced Allocation (EA) capabilities for
> these devices.</p>
> </div>
>
> **Exact value (<code>const</code>):** <span id="dt-58a429cd4bf531951c0d"><code>&#34;cavium&#44;pci&#45;host&#45;thunder&#45;ecam&#34;</code></span>

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

**Rule 3**

> <div id="dt-34ebc3371373135d1528">
> <p style="white-space: pre-wrap">Cavium ThunderX PEM firmware-initialized PCIe host controller</p>
> </div>
>
> **Exact value (<code>const</code>):** <span id="dt-710bc579d54b8b6b1f6c"><code>&#34;cavium&#44;pci&#45;host&#45;thunder&#45;pem&#34;</code></span>

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

**Rule 4**

> <div id="dt-2e7dbd5da540c0c7ff41">
> <p style="white-space: pre-wrap">HiSilicon Hip06/Hip07 PCIe host bridge in almost-ECAM mode. Some firmware places the host controller in a mode where it is ECAM compliant for all devices other than the root complex.</p>
> </div>
>
> **Allowed values (<code>enum</code>):** <a id="dt-f88e8a4f71f6390c3110"></a> <span id="dt-d24567d6aab2c1d3aee1"><code>&#34;hisilicon&#44;hip06&#45;pcie&#45;ecam&#34;</code></span>, <span id="dt-81e8161c476088ae793e"><code>&#34;hisilicon&#44;hip07&#45;pcie&#45;ecam&#34;</code></span>

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

**Rule 5**

> <div id="dt-67e1c2ab404e45238d0a">
> <p style="white-space: pre-wrap">In some cases, firmware may already have configured the Synopsys
> DesignWare PCIe controller in RC mode with static ATU window mappings
> that cover all config, MMIO and I/O spaces in a [mostly] ECAM
> compatible fashion. In this case, there is no need for the OS to
> perform any low level setup of clocks, PHYs or device registers, nor
> is there any reason for the driver to reconfigure ATU windows for
> config and/or IO space accesses at runtime.</p>
> <p style="white-space: pre-wrap">In cases where the IP was synthesized with a minimum ATU window size
> of 64 KB, it cannot be supported by the generic ECAM driver, because
> it requires special config space accessors that filter accesses to
> device #1 and beyond on the first bus.</p>
> </div>
>
> <a id="dt-196210d7e8a5e94e1226"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-4b7c967de45ba4ead27f"></a>
>
> **Item 1**
>
> > **Allowed values (<code>enum</code>):** <a id="dt-427722b6d265dacc9449"></a> <span id="dt-3e38de7c21c96fb8ed17"><code>&#34;marvell&#44;armada8k&#45;pcie&#45;ecam&#34;</code></span>, <span id="dt-70bcbd54d6039c7aaf2b"><code>&#34;socionext&#44;synquacer&#45;pcie&#45;ecam&#34;</code></span>
>
> <a id="dt-caf6ce7d7f34e1e8d173"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-4a97b7e5e83d59103118"><code>&#34;snps&#44;dw&#45;pcie&#45;ecam&#34;</code></span>

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

**Rule 6**

> <div id="dt-4045864b8eb90100af37">
> <p style="white-space: pre-wrap">CAM or ECAM compliant PCI host controllers without any quirks</p>
> </div>
>
> **Allowed values (<code>enum</code>):** <a id="dt-4b1813581229dccf1348"></a> <span id="dt-722faf77a88273020057"><code>&#34;pci&#45;host&#45;cam&#45;generic&#34;</code></span>, <span id="dt-a7638b1568b6444226f0"><code>&#34;pci&#45;host&#45;ecam&#45;generic&#34;</code></span>

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

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

<div id="dt-571d87f60678ead6c5ff">
<p style="white-space: pre-wrap">The Configuration Space base address and size, as accessed from the parent bus. The base address corresponds to the first bus in the "bus-range" property. If no "bus-range" is specified, this will be bus 0 (the default). Some host controllers have a 2nd non-compliant address range, so 2 entries are allowed.</p>
</div>

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

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

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

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

<div id="dt-e09d62fd28b1cb158f01">
<p style="white-space: pre-wrap">As described in IEEE Std 1275-1994, but must provide at least a definition of non-prefetchable memory. One or both of prefetchable Memory and IO Space may also be provided.</p>
</div>

<a id="dt-4603ee192633e8dffc49"></a>

### <code>dma&#45;coherent</code> — not listed as required here

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

<a id="dt-476cf51129594c4bb1fd"></a>

### <code>iommu&#45;map</code> — not listed as required here

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

<a id="dt-00761d1c23dbb6f3acd2"></a>

### <code>iommu&#45;map&#45;mask</code> — not listed as required here

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

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

### <code>msi&#45;parent</code> — not listed as required here

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

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

### <code>ats&#45;supported</code> — not listed as required here

<div id="dt-e5dd0491165a1280d87e">
<p style="white-space: pre-wrap">Indicates that a PCIe host controller supports ATS, and can handle Memory Requests with Address Type (AT).</p>
</div>

**Value type (<code>type</code>):** <span id="dt-2d66785b37052a1737c9"><code>&#34;boolean&#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>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;ranges&#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>&#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-22ca5ec5b89308748ecc"></a>

### Rule 2

> <a id="dt-ffbf5afb799d5f07b3e1"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-05d9c37a1275e72a170e"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-e9866824361c1aee7933"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > <a id="dt-d1402748b5f4caf0b18a"></a>
> >
> > **Rule for matching array elements (<code>contains</code>)**
> >
> > > **Exact value (<code>const</code>):** <span id="dt-9b74ad9882646c4a5116"><code>&#34;arm&#44;juno&#45;r1&#45;pcie&#34;</code></span>
>
> <a id="dt-0971d01a730acc20e97a"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-ee96a18d4bb2a9d39bd9"></a> <span id="dt-96ee7f71687cd234a9f8"><code>&#34;dma&#45;coherent&#34;</code></span>

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

### Rule 3

> <a id="dt-15ef78abba37234c7e3a"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-81c13bb46c56768b42c8"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-676f6e45d3a322ea7096"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > <a id="dt-d12232da396398a7b221"></a>
> >
> > **This rule must not match (<code>not</code>)**
> >
> > > <a id="dt-294851e26baa556ca1d1"></a>
> > >
> > > **Rule for matching array elements (<code>contains</code>)**
> > >
> > > > **Allowed values (<code>enum</code>):** <a id="dt-6ed7660f1000cc40b4d1"></a> <span id="dt-d7066f873bebdae9cd8d"><code>&#34;cavium&#44;pci&#45;host&#45;thunder&#45;pem&#34;</code></span>, <span id="dt-79b164137b8f505f12d9"><code>&#34;hisilicon&#44;hip06&#45;pcie&#45;ecam&#34;</code></span>, <span id="dt-3f20ed563f46a701a77f"><code>&#34;hisilicon&#44;hip07&#45;pcie&#45;ecam&#34;</code></span>
>
> <a id="dt-86c371e5831ff1f84ce5"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > <a id="dt-4b2e0558620eefde94e1"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-b5c94fac3a56b4f9f0e9"></a>
> >
> > **<code>reg</code> — not listed as required here**
> >
> > **Maximum number of items (<code>maxItems</code>):** <span id="dt-69135558470d5e3ce462"><code>1</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">
bus {
    #address-cells = &lt;2&gt;;
    #size-cells = &lt;2&gt;;
    pcie@40000000 {
        compatible = "pci-host-cam-generic";
        device_type = "pci";
        #address-cells = &lt;3&gt;;
        #size-cells = &lt;2&gt;;
        bus-range = &lt;0x0 0x1&gt;;

        // CPU_PHYSICAL(2)  SIZE(2)
        reg = &lt;0x0 0x40000000  0x0 0x1000000&gt;;

        // BUS_ADDRESS(3)  CPU_PHYSICAL(2)  SIZE(2)
        ranges = &lt;0x01000000 0x0 0x01000000  0x0 0x01000000  0x0 0x00010000&gt;,
                 &lt;0x02000000 0x0 0x41000000  0x0 0x41000000  0x0 0x3f000000&gt;;

        #interrupt-cells = &lt;0x1&gt;;

        // PCI_DEVICE(3)  INT#(1)  CONTROLLER(PHANDLE)  CONTROLLER_DATA(3)
        interrupt-map = &lt;   0x0 0x0 0x0  0x1  &amp;gic  0x0 0x4 0x1&gt;,
                        &lt; 0x800 0x0 0x0  0x1  &amp;gic  0x0 0x5 0x1&gt;,
                        &lt;0x1000 0x0 0x0  0x1  &amp;gic  0x0 0x6 0x1&gt;,
                        &lt;0x1800 0x0 0x0  0x1  &amp;gic  0x0 0x7 0x1&gt;;

        // PCI_DEVICE(3)  INT#(1)
        interrupt-map-mask = &lt;0xf800 0x0 0x0  0x7&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>
