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