# Freescale MSI interrupt controller

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

> Device-tree binding reference for Freescale MSI interrupt 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;interrupt&#45;controller&#47;fsl&#44;mpic&#45;msi&#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>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The Freescale hypervisor and msi-address-64
-------------------------------------------</p>
<p style="white-space: pre-wrap">Normally, PCI devices have access to all of CCSR via an ATMU mapping.  The
Freescale MSI driver calculates the address of MSIIR (in the MSI register
block) and sets that address as the MSI message address.</p>
<p style="white-space: pre-wrap">In a virtualized environment, the hypervisor may need to create an IOMMU
mapping for MSIIR.  The Freescale ePAPR hypervisor has this requirement
because of hardware limitations of the Peripheral Access Management Unit
(PAMU), which is currently the only IOMMU that the hypervisor supports.
The ATMU is programmed with the guest physical address, and the PAMU
intercepts transactions and reroutes them to the true physical address.</p>
<p style="white-space: pre-wrap">In the PAMU, each PCI controller is given only one primary window.  The
PAMU restricts DMA operations so that they can only occur within a window.
Because PCI devices must be able to DMA to memory, the primary window must
be used to cover all of the guest's memory space.</p>
<p style="white-space: pre-wrap">PAMU primary windows can be divided into 256 subwindows, and each
subwindow can have its own address mapping ("guest physical" to "true
physical").  However, each subwindow has to have the same alignment, which
means they cannot be located at just any address.  Because of these
restrictions, it is usually impossible to create a 4KB subwindow that
covers MSIIR where it's normally located.</p>
<p style="white-space: pre-wrap">Therefore, the hypervisor has to create a subwindow inside the same
primary window used for memory, but mapped to the MSIR block (where MSIIR
lives).  The first subwindow after the end of guest memory is used for
this.  The address specified in the msi-address-64 property is the PCI
address of MSIIR.  The hypervisor configures the PAMU to map that address to
the true physical address of MSIIR.</p>
</div>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;J&#46; Neuschäfer &#60;j&#46;ne&#64;posteo&#46;net&#62;&#34;</code></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-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;fsl&#44;mpic&#45;msi&#34;</code></span>, <span id="dt-44b402f75e7bf3caf313"><code>&#34;fsl&#44;mpic&#45;msi&#45;v4&#46;3&#34;</code></span>, <span id="dt-f03e1478792ca587ff5c"><code>&#34;fsl&#44;ipic&#45;msi&#34;</code></span>, <span id="dt-34cab0afbb7f2b55efc5"><code>&#34;fsl&#44;vmpic&#45;msi&#34;</code></span>, <span id="dt-d29c3f554eb9a606c63a"><code>&#34;fsl&#44;vmpic&#45;msi&#45;v4&#46;3&#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**
>
> > **Allowed values (<code>enum</code>):** <a id="dt-aa1230b5a2b80f9fb387"></a> <span id="dt-49b534c9c8948cfc8034"><code>&#34;fsl&#44;mpc8572&#45;msi&#34;</code></span>, <span id="dt-93451931f534c9a92fb4"><code>&#34;fsl&#44;mpc8610&#45;msi&#34;</code></span>, <span id="dt-bdca084879537277097b"><code>&#34;fsl&#44;mpc8641&#45;msi&#34;</code></span>
>
> <a id="dt-bdc26de0ccb1d52bb6a4"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-cc26fa5d96bc7cf0a818"><code>&#34;fsl&#44;mpic&#45;msi&#34;</code></span>

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

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

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

<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">Address and length of the shared message interrupt register set</p>
> </div>

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

**Item 2**

> <div id="dt-b729cb065b03c20c0e01">
> <p style="white-space: pre-wrap">Address of aliased MSIIR or MSIIR1 register for platforms that have such an alias. If using MSIIR1, the second region must be added because different MSI group has different MSIIR1 offset.</p>
> </div>

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

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

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

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

<div id="dt-b3ddec0f69e9f0c0dc40">
<p style="white-space: pre-wrap">Each one of the interrupts here is one entry per 32 MSIs, and routed to the host interrupt controller. The interrupts should be set as edge sensitive. If msi-available-ranges is present, only the interrupts that correspond to available ranges shall be present.</p>
</div>

<a id="dt-7091e8e0a27c4483c8d5"></a>

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

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

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

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

> <a id="dt-afdb6c05b43f090d91d3"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-d9f981afabc29a9772df"></a>
>
> **Item 1**
>
> > <div id="dt-8d055cca31f2d984470f">
> > <p style="white-space: pre-wrap">First MSI interrupt in this range</p>
> > </div>
>
> <a id="dt-84d912b2e206f3e9e185"></a>
>
> **Item 2**
>
> > <div id="dt-fee35d5b1eb9e1c10169">
> > <p style="white-space: pre-wrap">Number of MSI interrupts in this range</p>
> > </div>

<div id="dt-2b207a7af0e566a9ae59">
<p style="white-space: pre-wrap">Define which MSI interrupt can be used in the 256 MSI interrupts. If not specified, all the MSI interrupts can be used. Each available range must begin and end on a multiple of 32 (i.e. no splitting an individual MSI register or the associated PIC interrupt).</p>
</div>

<a id="dt-03f5b82905755658265c"></a>

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

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

<div id="dt-f0c9ee43c31035bac235">
<p style="white-space: pre-wrap">64-bit PCI address of the MSIIR register. The MSIIR register is used for MSI messaging.  The address of MSIIR in PCI address space is the MSI message address.
This property may be used in virtualized environments where the hypervisor has created an alternate mapping for the MSIR block.  See the top-level description for an explanation.</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;interrupts&#34;</code></span>

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

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

### Rule 1

> <a id="dt-3bbb54dfa1f05dfb4d25"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-97f47e9dc804c839f86d"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-bbadeeb73dfaefabae79"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > <a id="dt-ebe43a424f4497a78746"></a>
> >
> > **Rule for matching array elements (<code>contains</code>)**
> >
> > > **Allowed values (<code>enum</code>):** <a id="dt-b5c9dbe70762f9ad7bb5"></a> <span id="dt-d017b1b1b5a0bb01c549"><code>&#34;fsl&#44;mpic&#45;msi&#45;v4&#46;3&#34;</code></span>, <span id="dt-b1891799a94ae03bda89"><code>&#34;fsl&#44;vmpic&#45;msi&#45;v4&#46;3&#34;</code></span>
>
> <a id="dt-1ba25143802b75b74702"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > <a id="dt-b212c2ef78c22fab2e20"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-7787b28725c144fbfc92"></a>
> >
> > **<code>interrupts</code> — not listed as required here**
> >
> > **Minimum number of items (<code>minItems</code>):** <span id="dt-434103e5dab0dc9821c6"><code>16</code></span>
> >
> > <div id="dt-db9cbcb0477ebc9c53f2">
> > <p style="white-space: pre-wrap">Version 4.3 implies that there are 16 shared interrupts, and they are configured through MSIIR1.</p>
> > </div>
> >
> > <a id="dt-79adf79f6b8e29ea9b4f"></a>
> >
> > **<code>msi&#45;available&#45;ranges</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.
> >
> > <a id="dt-f6af340cf87a1ddfe255"></a>
> >
> > **<code>reg</code> — not listed as required here**
> >
> > **Minimum number of items (<code>minItems</code>):** <span id="dt-fffe812d0ea9e20356f9"><code>2</code></span>
>
> <a id="dt-f985d6aaa3f73a650205"></a>
>
> #### When the condition does not match (<code>else</code>)
>
> > <a id="dt-0b56c96a40292905ded0"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-c67bbe72af985902ec8f"></a>
> >
> > **<code>interrupts</code> — not listed as required here**
> >
> > **Maximum number of items (<code>maxItems</code>):** <span id="dt-1acbcc4149f500ebfc36"><code>8</code></span>
> >
> > <div id="dt-36d3b06895693a92591b">
> > <p style="white-space: pre-wrap">In versions before 4.3, only 8 shared interrupts are available, and they are configured through MSIIR.</p>
> > </div>

<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">msi@41600 {
        compatible = "fsl,mpc8610-msi", "fsl,mpic-msi";
        reg = &lt;0x41600 0x80&gt;;
        msi-available-ranges = &lt;0 0x100&gt;;
        interrupts = &lt;0xe0 0&gt;, &lt;0xe1 0&gt;, &lt;0xe2 0&gt;, &lt;0xe3 0&gt;,
                     &lt;0xe4 0&gt;, &lt;0xe5 0&gt;, &lt;0xe6 0&gt;, &lt;0xe7 0&gt;;
};
</code></pre>

<pre id="dt-bae0d43ea48e35208b4a"><code class="language-dts">msi@41600 {
        compatible = "fsl,mpic-msi-v4.3";
        reg = &lt;0x41600 0x200&gt;, &lt;0x44148 4&gt;;
        interrupts = &lt;0xe0 0 0 0&gt;, &lt;0xe1 0 0 0&gt;, &lt;0xe2 0 0 0&gt;, &lt;0xe3 0 0 0&gt;,
                     &lt;0xe4 0 0 0&gt;, &lt;0xe5 0 0 0&gt;, &lt;0xe6 0 0 0&gt;, &lt;0xe7 0 0 0&gt;,
                     &lt;0x100 0 0 0&gt;, &lt;0x101 0 0 0&gt;, &lt;0x102 0 0 0&gt;, &lt;0x103 0 0 0&gt;,
                     &lt;0x104 0 0 0&gt;, &lt;0x105 0 0 0&gt;, &lt;0x106 0 0 0&gt;, &lt;0x107 0 0 0&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>

<p id="dt-comment-1"><strong>Line 124:</strong> <span> MPIC v4.3 does not support this property because the 32 interrupts of</span></p>

<p id="dt-comment-2"><strong>Line 125:</strong> <span> an individual register are not continuous when using MSIIR1.</span></p>

</details>
