xref: /linux/Documentation/devicetree/bindings/interrupt-controller/mti,gic.yaml (revision e4fd970752ec663b80495117c706368087b4e486)
1*e4fd9707SSerge Semin# SPDX-License-Identifier: GPL-2.0-only
2*e4fd9707SSerge Semin%YAML 1.2
3*e4fd9707SSerge Semin---
4*e4fd9707SSerge Semin$id: http://devicetree.org/schemas/interrupt-controller/mti,gic.yaml#
5*e4fd9707SSerge Semin$schema: http://devicetree.org/meta-schemas/core.yaml#
6*e4fd9707SSerge Semin
7*e4fd9707SSerge Semintitle: MIPS Global Interrupt Controller
8*e4fd9707SSerge Semin
9*e4fd9707SSerge Seminmaintainers:
10*e4fd9707SSerge Semin  - Paul Burton <paulburton@kernel.org>
11*e4fd9707SSerge Semin  - Thomas Bogendoerfer <tsbogend@alpha.franken.de>
12*e4fd9707SSerge Semin
13*e4fd9707SSerge Semindescription: |
14*e4fd9707SSerge Semin  The MIPS GIC routes external interrupts to individual VPEs and IRQ pins.
15*e4fd9707SSerge Semin  It also supports local (per-processor) interrupts and software-generated
16*e4fd9707SSerge Semin  interrupts which can be used as IPIs. The GIC also includes a free-running
17*e4fd9707SSerge Semin  global timer, per-CPU count/compare timers, and a watchdog.
18*e4fd9707SSerge Semin
19*e4fd9707SSerge Seminproperties:
20*e4fd9707SSerge Semin  compatible:
21*e4fd9707SSerge Semin    const: mti,gic
22*e4fd9707SSerge Semin
23*e4fd9707SSerge Semin  "#interrupt-cells":
24*e4fd9707SSerge Semin    const: 3
25*e4fd9707SSerge Semin    description: |
26*e4fd9707SSerge Semin      The 1st cell is the type of interrupt: local or shared defined in the
27*e4fd9707SSerge Semin      file 'dt-bindings/interrupt-controller/mips-gic.h'. The 2nd cell is the
28*e4fd9707SSerge Semin      GIC interrupt number. The 3d cell encodes the interrupt flags setting up
29*e4fd9707SSerge Semin      the IRQ trigger modes, which are defined in the file
30*e4fd9707SSerge Semin      'dt-bindings/interrupt-controller/irq.h'.
31*e4fd9707SSerge Semin
32*e4fd9707SSerge Semin  reg:
33*e4fd9707SSerge Semin    description: |
34*e4fd9707SSerge Semin      Base address and length of the GIC registers space. If not present,
35*e4fd9707SSerge Semin      the base address reported by the hardware GCR_GIC_BASE will be used.
36*e4fd9707SSerge Semin    maxItems: 1
37*e4fd9707SSerge Semin
38*e4fd9707SSerge Semin  interrupt-controller: true
39*e4fd9707SSerge Semin
40*e4fd9707SSerge Semin  mti,reserved-cpu-vectors:
41*e4fd9707SSerge Semin    description: |
42*e4fd9707SSerge Semin      Specifies the list of CPU interrupt vectors to which the GIC may not
43*e4fd9707SSerge Semin      route interrupts. This property is ignored if the CPU is started in EIC
44*e4fd9707SSerge Semin      mode.
45*e4fd9707SSerge Semin    allOf:
46*e4fd9707SSerge Semin      - $ref: /schemas/types.yaml#definitions/uint32-array
47*e4fd9707SSerge Semin      - minItems: 1
48*e4fd9707SSerge Semin        maxItems: 6
49*e4fd9707SSerge Semin        uniqueItems: true
50*e4fd9707SSerge Semin        items:
51*e4fd9707SSerge Semin          minimum: 2
52*e4fd9707SSerge Semin          maximum: 7
53*e4fd9707SSerge Semin
54*e4fd9707SSerge Semin  mti,reserved-ipi-vectors:
55*e4fd9707SSerge Semin    description: |
56*e4fd9707SSerge Semin      Specifies the range of GIC interrupts that are reserved for IPIs.
57*e4fd9707SSerge Semin      It accepts two values: the 1st is the starting interrupt and the 2nd is
58*e4fd9707SSerge Semin      the size of the reserved range. If not specified, the driver will
59*e4fd9707SSerge Semin      allocate the last (2 * number of VPEs in the system).
60*e4fd9707SSerge Semin    allOf:
61*e4fd9707SSerge Semin      - $ref: /schemas/types.yaml#definitions/uint32-array
62*e4fd9707SSerge Semin      - items:
63*e4fd9707SSerge Semin          - minimum: 0
64*e4fd9707SSerge Semin            maximum: 254
65*e4fd9707SSerge Semin          - minimum: 2
66*e4fd9707SSerge Semin            maximum: 254
67*e4fd9707SSerge Semin
68*e4fd9707SSerge Semin  timer:
69*e4fd9707SSerge Semin    type: object
70*e4fd9707SSerge Semin    description: |
71*e4fd9707SSerge Semin      MIPS GIC includes a free-running global timer, per-CPU count/compare
72*e4fd9707SSerge Semin      timers, and a watchdog. Currently only the GIC Timer is supported.
73*e4fd9707SSerge Semin    properties:
74*e4fd9707SSerge Semin      compatible:
75*e4fd9707SSerge Semin        const: mti,gic-timer
76*e4fd9707SSerge Semin
77*e4fd9707SSerge Semin      interrupts:
78*e4fd9707SSerge Semin        description: |
79*e4fd9707SSerge Semin          Interrupt for the GIC local timer, so normally it's suppose to be of
80*e4fd9707SSerge Semin          <GIC_LOCAL X IRQ_TYPE_NONE> format.
81*e4fd9707SSerge Semin        maxItems: 1
82*e4fd9707SSerge Semin
83*e4fd9707SSerge Semin      clocks:
84*e4fd9707SSerge Semin        maxItems: 1
85*e4fd9707SSerge Semin
86*e4fd9707SSerge Semin      clock-frequency: true
87*e4fd9707SSerge Semin
88*e4fd9707SSerge Semin    required:
89*e4fd9707SSerge Semin      - compatible
90*e4fd9707SSerge Semin      - interrupts
91*e4fd9707SSerge Semin
92*e4fd9707SSerge Semin    oneOf:
93*e4fd9707SSerge Semin      - required:
94*e4fd9707SSerge Semin          - clocks
95*e4fd9707SSerge Semin      - required:
96*e4fd9707SSerge Semin          - clock-frequency
97*e4fd9707SSerge Semin
98*e4fd9707SSerge Semin    additionalProperties: false
99*e4fd9707SSerge Semin
100*e4fd9707SSerge SeminunevaluatedProperties: false
101*e4fd9707SSerge Semin
102*e4fd9707SSerge Seminrequired:
103*e4fd9707SSerge Semin  - compatible
104*e4fd9707SSerge Semin  - "#interrupt-cells"
105*e4fd9707SSerge Semin  - interrupt-controller
106*e4fd9707SSerge Semin
107*e4fd9707SSerge Seminexamples:
108*e4fd9707SSerge Semin  - |
109*e4fd9707SSerge Semin    #include <dt-bindings/interrupt-controller/mips-gic.h>
110*e4fd9707SSerge Semin    #include <dt-bindings/interrupt-controller/irq.h>
111*e4fd9707SSerge Semin
112*e4fd9707SSerge Semin    interrupt-controller@1bdc0000 {
113*e4fd9707SSerge Semin      compatible = "mti,gic";
114*e4fd9707SSerge Semin      reg = <0x1bdc0000 0x20000>;
115*e4fd9707SSerge Semin      interrupt-controller;
116*e4fd9707SSerge Semin      #interrupt-cells = <3>;
117*e4fd9707SSerge Semin      mti,reserved-cpu-vectors = <7>;
118*e4fd9707SSerge Semin      mti,reserved-ipi-vectors = <40 8>;
119*e4fd9707SSerge Semin
120*e4fd9707SSerge Semin      timer {
121*e4fd9707SSerge Semin        compatible = "mti,gic-timer";
122*e4fd9707SSerge Semin        interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
123*e4fd9707SSerge Semin        clock-frequency = <50000000>;
124*e4fd9707SSerge Semin      };
125*e4fd9707SSerge Semin    };
126*e4fd9707SSerge Semin  - |
127*e4fd9707SSerge Semin    #include <dt-bindings/interrupt-controller/mips-gic.h>
128*e4fd9707SSerge Semin    #include <dt-bindings/interrupt-controller/irq.h>
129*e4fd9707SSerge Semin
130*e4fd9707SSerge Semin    interrupt-controller@1bdc0000 {
131*e4fd9707SSerge Semin      compatible = "mti,gic";
132*e4fd9707SSerge Semin      reg = <0x1bdc0000 0x20000>;
133*e4fd9707SSerge Semin      interrupt-controller;
134*e4fd9707SSerge Semin      #interrupt-cells = <3>;
135*e4fd9707SSerge Semin
136*e4fd9707SSerge Semin      timer {
137*e4fd9707SSerge Semin        compatible = "mti,gic-timer";
138*e4fd9707SSerge Semin        interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
139*e4fd9707SSerge Semin        clocks = <&cpu_pll>;
140*e4fd9707SSerge Semin      };
141*e4fd9707SSerge Semin    };
142*e4fd9707SSerge Semin  - |
143*e4fd9707SSerge Semin    interrupt-controller {
144*e4fd9707SSerge Semin      compatible = "mti,gic";
145*e4fd9707SSerge Semin      interrupt-controller;
146*e4fd9707SSerge Semin      #interrupt-cells = <3>;
147*e4fd9707SSerge Semin    };
148*e4fd9707SSerge Semin...
149