# MIPS Global Interrupt Controller

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

> Device-tree binding reference for MIPS Global Interrupt Controller.

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


<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;mti&#44;gic&#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;Paul Burton &#60;paulburton&#64;kernel&#46;org&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Thomas Bogendoerfer &#60;tsbogend&#64;alpha&#46;franken&#46;de&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The MIPS GIC routes external interrupts to individual VPEs and IRQ pins.
It also supports local (per-processor) interrupts and software-generated
interrupts which can be used as IPIs. The GIC also includes a free-running
global timer, per-CPU count/compare timers, and a watchdog.</p>
</div>

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

## Properties and child nodes (<code>properties</code>)

<a id="dt-5c1d81699dcbe840de83"></a>

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

**Exact value (<code>const</code>):** <span id="dt-1765195bf8e86c3ccec6"><code>&#34;mti&#44;gic&#34;</code></span>

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

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

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

<div id="dt-0cc2c51365b6879fba3b">
<p style="white-space: pre-wrap">The 1st cell is the type of interrupt: local or shared defined in the
file 'dt-bindings/interrupt-controller/mips-gic.h'. The 2nd cell is the
GIC interrupt number. The 3d cell encodes the interrupt flags setting up
the IRQ trigger modes, which are defined in the file
'dt-bindings/interrupt-controller/irq.h'.</p>
</div>

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

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

<div id="dt-571d87f60678ead6c5ff">
<p style="white-space: pre-wrap">Base address and length of the GIC registers space. If not present,
the base address reported by the hardware GCR_GIC_BASE will be used.</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-71421d35675d9a533ad2"><code>1</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-e9e13952de6879399a2f"></a>

### <code>mti&#44;reserved&#45;cpu&#45;vectors</code> — not listed as required here

<div id="dt-7547b7bb9a0433169ee5">
<p style="white-space: pre-wrap">Specifies the list of CPU interrupt vectors to which the GIC may not
route interrupts. This property is ignored if the CPU is started in EIC
mode.</p>
</div>

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

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

**Maximum number of items (<code>maxItems</code>):** <span id="dt-219fc59828c9d3ceddeb"><code>6</code></span>

**Items must be unique (<code>uniqueItems</code>):** <span id="dt-63b35cdd2a59ef8bf6d5"><code>true</code></span>

<a id="dt-8111d244505fe4cb6441"></a>

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

> **Minimum value (<code>minimum</code>):** <span id="dt-e350366af3cfc9803c12"><code>2</code></span>
>
> **Maximum value (<code>maximum</code>):** <span id="dt-7bdfb683558c466f5ba9"><code>7</code></span>

<a id="dt-77e871b553a0abb49f45"></a>

### <code>mti&#44;reserved&#45;ipi&#45;vectors</code> — not listed as required here

<div id="dt-86002cf3c4f1aabe4243">
<p style="white-space: pre-wrap">Specifies the range of GIC interrupts that are reserved for IPIs.
It accepts two values: the 1st is the starting interrupt and the 2nd is
the size of the reserved range. If not specified, the driver will
allocate the last (2 * number of VPEs in the system).</p>
</div>

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

<a id="dt-33b6ce8e10478fcb0c30"></a>

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

<a id="dt-317083b7588b2f7b1af9"></a>

**Item 1**

> **Minimum value (<code>minimum</code>):** <span id="dt-1a688eabde9139f4e492"><code>0</code></span>
>
> **Maximum value (<code>maximum</code>):** <span id="dt-1d6150ceab8821368d9a"><code>254</code></span>

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

**Item 2**

> **Minimum value (<code>minimum</code>):** <span id="dt-a2626d8764f1a6cca604"><code>2</code></span>
>
> **Maximum value (<code>maximum</code>):** <span id="dt-25a5fbf037ca7fb72565"><code>254</code></span>

<a id="dt-971dddb30b6f4df71cdf"></a>

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

**Value type (<code>type</code>):** <span id="dt-04fc274363edb6ece19f"><code>&#34;object&#34;</code></span>

<div id="dt-caf8ed3b4a5bd83e93c3">
<p style="white-space: pre-wrap">MIPS GIC includes a free-running global timer, per-CPU count/compare
timers, and a watchdog. Currently only the GIC Timer is supported.</p>
</div>

<a id="dt-06312f683724efab59c8"></a>

#### Properties and child nodes (<code>properties</code>)

<a id="dt-10663ae16b1c8f2ce9c2"></a>

**<code>compatible</code> — required here**

**Exact value (<code>const</code>):** <span id="dt-34c68b141daaa93bbeb0"><code>&#34;mti&#44;gic&#45;timer&#34;</code></span>

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

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

<div id="dt-89ada92af56dac39d880">
<p style="white-space: pre-wrap">Interrupt for the GIC local timer, so normally it's suppose to be of
&lt;GIC_LOCAL X IRQ_TYPE_NONE&gt; format.</p>
</div>

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

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

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

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

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

**<code>clock&#45;frequency</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-2b8e4a634f263cd9558e"></a> <span id="dt-58aa2044e7df085029d1"><code>&#34;compatible&#34;</code></span>, <span id="dt-0eea311bf6bae637c3ff"><code>&#34;interrupts&#34;</code></span>

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

#### Exactly one of these rules must match (<code>oneOf</code>)

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

**Rule 1**

> **Required in this object (<code>required</code>):** <a id="dt-634a94cd301ee57786bd"></a> <span id="dt-aaad6341c24e1829ab80"><code>&#34;clocks&#34;</code></span>

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

**Rule 2**

> **Required in this object (<code>required</code>):** <a id="dt-349c0349f8ac93d9eb95"></a> <span id="dt-017c621beab292802e46"><code>&#34;clock&#45;frequency&#34;</code></span>

<a id="dt-c46f7ada5d50b191dd87"></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-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this 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;interrupt&#45;cells&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;interrupt&#45;controller&#34;</code></span>

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

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/interrupt-controller/mips-gic.h&gt;
#include &lt;dt-bindings/interrupt-controller/irq.h&gt;

interrupt-controller@1bdc0000 {
  compatible = "mti,gic";
  reg = &lt;0x1bdc0000 0x20000&gt;;
  interrupt-controller;
  #interrupt-cells = &lt;3&gt;;
  mti,reserved-cpu-vectors = &lt;7&gt;;
  mti,reserved-ipi-vectors = &lt;40 8&gt;;

  timer {
    compatible = "mti,gic-timer";
    interrupts = &lt;GIC_LOCAL 1 IRQ_TYPE_NONE&gt;;
    clock-frequency = &lt;50000000&gt;;
  };
};
</code></pre>

<pre id="dt-bae0d43ea48e35208b4a"><code class="language-dts">#include &lt;dt-bindings/interrupt-controller/mips-gic.h&gt;
#include &lt;dt-bindings/interrupt-controller/irq.h&gt;

interrupt-controller@1bdc0000 {
  compatible = "mti,gic";
  reg = &lt;0x1bdc0000 0x20000&gt;;
  interrupt-controller;
  #interrupt-cells = &lt;3&gt;;

  timer {
    compatible = "mti,gic-timer";
    interrupts = &lt;GIC_LOCAL 1 IRQ_TYPE_NONE&gt;;
    clocks = &lt;&amp;cpu_pll&gt;;
  };
};
</code></pre>

<pre id="dt-d0212a4cd671f89a0b40"><code class="language-dts">interrupt-controller {
  compatible = "mti,gic";
  interrupt-controller;
  #interrupt-cells = &lt;3&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</span></p>

</details>
