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