# RISC-V Hart-Level Interrupt Controller (HLIC)

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

> Device-tree binding reference for RISC-V Hart-Level Interrupt Controller (HLIC).

<!-- SPDX-License-Identifier: GPL-2.0 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;riscv&#44;cpu&#45;intc&#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">RISC-V cores include Control Status Registers (CSRs) which are local to each CPU core (HART in RISC-V terminology) and can be read or written by software. Some of these CSRs are used to control local interrupts connected to the core. Every interrupt is ultimately routed through a hart's HLIC before it interrupts that hart.
The RISC-V supervisor ISA manual specifies three interrupt sources that are attached to every HLIC namely software interrupts, the timer interrupt, and external interrupts. Software interrupts are used to send IPIs between cores.  The timer interrupt comes from an architecturally mandated real- time timer that is controlled via Supervisor Binary Interface (SBI) calls and CSR reads. External interrupts connect all other device interrupts to the HLIC, which are routed via the platform-level interrupt controller (PLIC).
All RISC-V systems that conform to the supervisor ISA specification are required to have a HLIC with these three interrupt sources present.  Since the interrupt map is defined by the ISA it's not listed in the HLIC's device tree entry, though external interrupt controllers (like the PLIC, for example) will need to define how their interrupts map to the relevant HLICs. This means a PLIC interrupt property will typically list the HLICs for all present HARTs in the system.</p>
</div>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Palmer Dabbelt &#60;palmer&#64;dabbelt&#46;com&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Paul Walmsley &#60;paul&#46;walmsley&#64;sifive&#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**
>
> > **Exact value (<code>const</code>):** <span id="dt-5deec2612224d8d915da"><code>&#34;andestech&#44;cpu&#45;intc&#34;</code></span>
>
> <a id="dt-bc83d1191bdc72da8559"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-1da74b37131fdcec1073"><code>&#34;riscv&#44;cpu&#45;intc&#34;</code></span>

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

**Rule 2**

> **Exact value (<code>const</code>):** <span id="dt-58a429cd4bf531951c0d"><code>&#34;riscv&#44;cpu&#45;intc&#34;</code></span>

<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-8586fac2d9a71adf4795"></a>

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

**Exact value (<code>const</code>):** <span id="dt-317bbf786489389e8233"><code>1</code></span>

<div id="dt-0cc2c51365b6879fba3b">
<pre><code>The interrupt sources are defined by the RISC-V supervisor ISA manual,
with only the following three interrupts being defined for
supervisor mode:
  - Source 1 is the supervisor software interrupt, which can be sent by
    an SBI call and is reserved for use by software.
  - Source 5 is the supervisor timer interrupt, which can be configured
    by SBI calls and implements a one-shot timer.
  - Source 9 is the supervisor external interrupt, which chains to all
    other device interrupts.</code></pre>
</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;&#35;interrupt&#45;cells&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;interrupt&#45;controller&#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">interrupt-controller {
    #interrupt-cells = &lt;1&gt;;
    compatible = "riscv,cpu-intc";
    interrupt-controller;
};
</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 OR BSD-2-Clause</span></p>

</details>
