# SiFive Platform-Level Interrupt Controller (PLIC)

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

> Device-tree binding reference for SiFive Platform-Level Interrupt Controller (PLIC).

<!-- 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;sifive&#44;plic&#45;1&#46;0&#46;0&#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">SiFive SoCs and other RISC-V SoCs include an implementation of the Platform-Level Interrupt Controller (PLIC) high-level specification in the RISC-V Privileged Architecture specification. The PLIC connects all external interrupts in the system to all hart contexts in the system, via the external interrupt source in each hart.
A hart context is a privilege mode in a hardware execution thread. For example, in an 4 core system with 2-way SMT, you have 8 harts and probably at least two privilege modes per hart; machine mode and supervisor mode.
Each interrupt can be enabled on per-context basis. Any context can claim a pending enabled interrupt and then release it once it has been handled.
Each interrupt has a configurable priority. Higher priority interrupts are serviced first.  Each context can specify a priority threshold. Interrupts with priority below this threshold will not cause the PLIC to raise its interrupt line leading to the context.
The PLIC supports both edge-triggered and level-triggered interrupts. For edge-triggered interrupts, the RISC-V PLIC spec allows two responses to edges seen while an interrupt handler is active; the PLIC may either queue them or ignore them. In the first case, handlers are oblivious to the trigger type, so it is not included in the interrupt specifier. In the second case, software needs to know the trigger type, so it can reorder the interrupt flow to avoid missing interrupts. This special handling is needed by at least the Renesas RZ/Five SoC (AX45MP AndesCore with a NCEPLIC100) and the T-HEAD C900 PLIC.
While the RISC-V ISA doesn't specify a memory layout for the PLIC, the "sifive,plic-1.0.0" device is a concrete implementation of the PLIC that contains a specific memory layout, which is documented in chapter 8 of the SiFive U5 Coreplex Series Manual &lt;https://static.dev.sifive.com/U54-MC-RVCoreIP.pdf&gt;.
The thead,c900-plic is different from sifive,plic-1.0.0 in opensbi, the T-HEAD PLIC implementation requires setting a delegation bit to allow access from S-mode. So add thead,c900-plic to distinguish them.</p>
</div>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Paul Walmsley  &#60;paul&#46;walmsley&#64;sifive&#46;com&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Palmer Dabbelt &#60;palmer&#64;dabbelt&#46;com&#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**

> <a id="dt-07409cc9508405f48983"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-822691c82c9797f7b1f9"></a>
>
> **Item 1**
>
> > **Allowed values (<code>enum</code>):** <a id="dt-3b212051dcd0fc641cd8"></a> <span id="dt-bd6e6716d05ec45653db"><code>&#34;andestech&#44;qilai&#45;plic&#34;</code></span>, <span id="dt-3e7fb897881b12f43f81"><code>&#34;renesas&#44;r9a07g043&#45;plic&#34;</code></span>
>
> <a id="dt-bc83d1191bdc72da8559"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-1da74b37131fdcec1073"><code>&#34;andestech&#44;nceplic100&#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;anlogic&#44;dr1v90&#45;plic&#34;</code></span>, <span id="dt-93451931f534c9a92fb4"><code>&#34;canaan&#44;k210&#45;plic&#34;</code></span>, <span id="dt-bdca084879537277097b"><code>&#34;eswin&#44;eic7700&#45;plic&#34;</code></span>, <span id="dt-922f7901d25b667972ac"><code>&#34;microchip&#44;pic64gx&#45;plic&#34;</code></span>, <span id="dt-eb61ad381053476dae55"><code>&#34;sifive&#44;fu540&#45;c000&#45;plic&#34;</code></span>, <span id="dt-05b29c21ca38ad337d53"><code>&#34;spacemit&#44;k1&#45;plic&#34;</code></span>, <span id="dt-93c2763ada782db7e26c"><code>&#34;starfive&#44;jh7100&#45;plic&#34;</code></span>, <span id="dt-36a81d983bbaf2a6b89d"><code>&#34;starfive&#44;jh7110&#45;plic&#34;</code></span>, <span id="dt-bbccc6a1a74023520617"><code>&#34;tenstorrent&#44;blackhole&#45;plic&#34;</code></span>
>
> <a id="dt-bdc26de0ccb1d52bb6a4"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-cc26fa5d96bc7cf0a818"><code>&#34;sifive&#44;plic&#45;1&#46;0&#46;0&#34;</code></span>

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

**Rule 3**

> <a id="dt-e626d61e9d5d76cc48f9"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-6b46935eab08de6d1f0a"></a>
>
> **Item 1**
>
> > **Allowed values (<code>enum</code>):** <a id="dt-9d5b9f6fd2f9759f6e43"></a> <span id="dt-73fb2f4b762df7b35870"><code>&#34;allwinner&#44;sun20i&#45;d1&#45;plic&#34;</code></span>, <span id="dt-4f2dd487e4b2e6e79827"><code>&#34;sophgo&#44;cv1800b&#45;plic&#34;</code></span>, <span id="dt-dba59cbb664a09df0380"><code>&#34;sophgo&#44;cv1812h&#45;plic&#34;</code></span>, <span id="dt-7337bb6973adc8f5010d"><code>&#34;sophgo&#44;sg2002&#45;plic&#34;</code></span>, <span id="dt-2a4824de128057522b89"><code>&#34;sophgo&#44;sg2042&#45;plic&#34;</code></span>, <span id="dt-9d0b7e5fcd963b685b0d"><code>&#34;sophgo&#44;sg2044&#45;plic&#34;</code></span>, <span id="dt-53e062f93be7aa5d7bb3"><code>&#34;thead&#44;th1520&#45;plic&#34;</code></span>
>
> <a id="dt-5ea82ea034747ba6da29"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-e9c55cb91230c7ee5a28"><code>&#34;thead&#44;c900&#45;plic&#34;</code></span>

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

**Rule 4**

> <a id="dt-a1b1c435b08c85ff96c7"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-4758c8f9c99bfa28b10c"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-4c3894ced8f7125f7050"><code>&#34;ultrarisc&#44;dp1000&#45;plic&#34;</code></span>
>
> <a id="dt-c99d921c49bf15e79633"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-9e0f2ef968dd632f09b7"><code>&#34;ultrarisc&#44;cp100&#45;plic&#34;</code></span>

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

**Rule 5**

> <a id="dt-196210d7e8a5e94e1226"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-4b7c967de45ba4ead27f"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-3f49949a764b6257a77a"><code>&#34;sifive&#44;plic&#45;1&#46;0&#46;0&#34;</code></span>
>
> <a id="dt-caf6ce7d7f34e1e8d173"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-4a97b7e5e83d59103118"><code>&#34;riscv&#44;plic0&#34;</code></span>
>
> **Deprecated (<code>deprecated</code>):** <span id="dt-d907917c0634ece2cf1f"><code>true</code></span>
>
> <div id="dt-67e1c2ab404e45238d0a">
> <p style="white-space: pre-wrap">For the QEMU virt machine only</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-2efe70314a961a652abe"></a>

### <code>&#35;address&#45;cells</code> — required here

**Exact value (<code>const</code>):** <span id="dt-e6e6af09ab617572731b"><code>0</code></span>

<a id="dt-8586fac2d9a71adf4795"></a>

### <code>&#35;interrupt&#45;cells</code> — required here

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

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

### <code>interrupt&#45;controller</code> — required here

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

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

### <code>interrupts&#45;extended</code> — required here

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

**Maximum number of items (<code>maxItems</code>):** <span id="dt-0fa45bd7e7f39b9405fc"><code>15872</code></span>

<div id="dt-374fadb395de5ea0d76c">
<p style="white-space: pre-wrap">Specifies which contexts are connected to the PLIC, with "-1" specifying that a context is not present. Each node pointed to should be a riscv,cpu-intc node, which has a riscv node as parent.</p>
</div>

<a id="dt-795a897ac3d52936991b"></a>

### <code>riscv&#44;ndev</code> — required here

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

<div id="dt-bdd5add10746d87a40bc">
<p style="white-space: pre-wrap">Specifies how many external (device) interrupts are supported by this controller.  Note that source 0 is reserved in PLIC, so the valid interrupt sources are 1 to riscv,ndev inclusive.</p>
</div>

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

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

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

<a id="dt-030bda573e8c53177f1a"></a>

### <code>power&#45;domains</code> — not listed as required here

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

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

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

<code>true</code> — No constraints added by this property 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;&#35;address&#45;cells&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;&#35;interrupt&#45;cells&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;interrupt&#45;controller&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;reg&#34;</code></span>, <span id="dt-c127a87237cb22622910"><code>&#34;interrupts&#45;extended&#34;</code></span>, <span id="dt-a5d07fc4223c155670a0"><code>&#34;riscv&#44;ndev&#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;andestech&#44;nceplic100&#34;</code></span>, <span id="dt-b1891799a94ae03bda89"><code>&#34;thead&#44;c900&#45;plic&#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-94f666587eafcf4a5215"></a>
> >
> > **<code>&#35;interrupt&#45;cells</code> — not listed as required here**
> >
> > **Exact value (<code>const</code>):** <span id="dt-b3320c2583d436e9668a"><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-6061fbbcecdb4f56a470"></a>
> >
> > **<code>&#35;interrupt&#45;cells</code> — not listed as required here**
> >
> > **Exact value (<code>const</code>):** <span id="dt-2c712d31aeb85c9537d7"><code>1</code></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;renesas&#44;r9a07g043&#45;plic&#34;</code></span>
>
> <a id="dt-0971d01a730acc20e97a"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > <a id="dt-26d1c84fcc55a7d91dea"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-cc2edf6d98aafaff5f44"></a>
> >
> > **<code>clocks</code> — required here**
> >
> > **Maximum number of items (<code>maxItems</code>):** <span id="dt-3aa42810e911ab2a41de"><code>1</code></span>
> >
> > <a id="dt-1b8565854dd631544e0f"></a>
> >
> > **<code>power&#45;domains</code> — required here**
> >
> > **Maximum number of items (<code>maxItems</code>):** <span id="dt-68ca2c9596d3c2767dd6"><code>1</code></span>
> >
> > <a id="dt-205788d1fea947f3ac3d"></a>
> >
> > **<code>resets</code> — required here**
> >
> > **Maximum number of items (<code>maxItems</code>):** <span id="dt-40c1f417f6c3fc3d7f32"><code>1</code></span>
> >
> > **Required in this object (<code>required</code>):** <a id="dt-ee96a18d4bb2a9d39bd9"></a> <span id="dt-96ee7f71687cd234a9f8"><code>&#34;clocks&#34;</code></span>, <span id="dt-5daae4bef35eb1615659"><code>&#34;power&#45;domains&#34;</code></span>, <span id="dt-dabdc46fe881a853c5d7"><code>&#34;resets&#34;</code></span>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</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">plic: interrupt-controller@c000000 {
  #address-cells = &lt;0&gt;;
  #interrupt-cells = &lt;1&gt;;
  compatible = "sifive,fu540-c000-plic", "sifive,plic-1.0.0";
  interrupt-controller;
  interrupts-extended = &lt;&amp;cpu0_intc 11&gt;,
                        &lt;&amp;cpu1_intc 11&gt;, &lt;&amp;cpu1_intc 9&gt;,
                        &lt;&amp;cpu2_intc 11&gt;, &lt;&amp;cpu2_intc 9&gt;,
                        &lt;&amp;cpu3_intc 11&gt;, &lt;&amp;cpu3_intc 9&gt;,
                        &lt;&amp;cpu4_intc 11&gt;, &lt;&amp;cpu4_intc 9&gt;;
  reg = &lt;0xc000000 0x4000000&gt;;
  riscv,ndev = &lt;10&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 2:</strong> <span> Copyright (C) 2020 SiFive, Inc.</span></p>

</details>
