xref: /freebsd-src/sys/contrib/device-tree/Bindings/interrupt-controller/mips-gic.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotMIPS Global Interrupt Controller (GIC)
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotThe MIPS GIC routes external interrupts to individual VPEs and IRQ pins.
4*c66ec88fSEmmanuel VadotIt also supports local (per-processor) interrupts and software-generated
5*c66ec88fSEmmanuel Vadotinterrupts which can be used as IPIs.  The GIC also includes a free-running
6*c66ec88fSEmmanuel Vadotglobal timer, per-CPU count/compare timers, and a watchdog.
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel VadotRequired properties:
9*c66ec88fSEmmanuel Vadot- compatible : Should be "mti,gic".
10*c66ec88fSEmmanuel Vadot- interrupt-controller : Identifies the node as an interrupt controller
11*c66ec88fSEmmanuel Vadot- #interrupt-cells : Specifies the number of cells needed to encode an
12*c66ec88fSEmmanuel Vadot  interrupt specifier.  Should be 3.
13*c66ec88fSEmmanuel Vadot  - The first cell is the type of interrupt, local or shared.
14*c66ec88fSEmmanuel Vadot    See <include/dt-bindings/interrupt-controller/mips-gic.h>.
15*c66ec88fSEmmanuel Vadot  - The second cell is the GIC interrupt number.
16*c66ec88fSEmmanuel Vadot  - The third cell encodes the interrupt flags.
17*c66ec88fSEmmanuel Vadot    See <include/dt-bindings/interrupt-controller/irq.h> for a list of valid
18*c66ec88fSEmmanuel Vadot    flags.
19*c66ec88fSEmmanuel Vadot
20*c66ec88fSEmmanuel VadotOptional properties:
21*c66ec88fSEmmanuel Vadot- reg : Base address and length of the GIC registers.  If not present,
22*c66ec88fSEmmanuel Vadot  the base address reported by the hardware GCR_GIC_BASE will be used.
23*c66ec88fSEmmanuel Vadot- mti,reserved-cpu-vectors : Specifies the list of CPU interrupt vectors
24*c66ec88fSEmmanuel Vadot  to which the GIC may not route interrupts.  Valid values are 2 - 7.
25*c66ec88fSEmmanuel Vadot  This property is ignored if the CPU is started in EIC mode.
26*c66ec88fSEmmanuel Vadot- mti,reserved-ipi-vectors : Specifies the range of GIC interrupts that are
27*c66ec88fSEmmanuel Vadot  reserved for IPIs.
28*c66ec88fSEmmanuel Vadot  It accepts 2 values, the 1st is the starting interrupt and the 2nd is the size
29*c66ec88fSEmmanuel Vadot  of the reserved range.
30*c66ec88fSEmmanuel Vadot  If not specified, the driver will allocate the last 2 * number of VPEs in the
31*c66ec88fSEmmanuel Vadot  system.
32*c66ec88fSEmmanuel Vadot
33*c66ec88fSEmmanuel VadotRequired properties for timer sub-node:
34*c66ec88fSEmmanuel Vadot- compatible : Should be "mti,gic-timer".
35*c66ec88fSEmmanuel Vadot- interrupts : Interrupt for the GIC local timer.
36*c66ec88fSEmmanuel Vadot
37*c66ec88fSEmmanuel VadotOptional properties for timer sub-node:
38*c66ec88fSEmmanuel Vadot- clocks : GIC timer operating clock.
39*c66ec88fSEmmanuel Vadot- clock-frequency : Clock frequency at which the GIC timers operate.
40*c66ec88fSEmmanuel Vadot
41*c66ec88fSEmmanuel VadotNote that one of clocks or clock-frequency must be specified.
42*c66ec88fSEmmanuel Vadot
43*c66ec88fSEmmanuel VadotExample:
44*c66ec88fSEmmanuel Vadot
45*c66ec88fSEmmanuel Vadot	gic: interrupt-controller@1bdc0000 {
46*c66ec88fSEmmanuel Vadot		compatible = "mti,gic";
47*c66ec88fSEmmanuel Vadot		reg = <0x1bdc0000 0x20000>;
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel Vadot		interrupt-controller;
50*c66ec88fSEmmanuel Vadot		#interrupt-cells = <3>;
51*c66ec88fSEmmanuel Vadot
52*c66ec88fSEmmanuel Vadot		mti,reserved-cpu-vectors = <7>;
53*c66ec88fSEmmanuel Vadot		mti,reserved-ipi-vectors = <40 8>;
54*c66ec88fSEmmanuel Vadot
55*c66ec88fSEmmanuel Vadot		timer {
56*c66ec88fSEmmanuel Vadot			compatible = "mti,gic-timer";
57*c66ec88fSEmmanuel Vadot			interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
58*c66ec88fSEmmanuel Vadot			clock-frequency = <50000000>;
59*c66ec88fSEmmanuel Vadot		};
60*c66ec88fSEmmanuel Vadot	};
61*c66ec88fSEmmanuel Vadot
62*c66ec88fSEmmanuel Vadot	uart@18101400 {
63*c66ec88fSEmmanuel Vadot		...
64*c66ec88fSEmmanuel Vadot		interrupt-parent = <&gic>;
65*c66ec88fSEmmanuel Vadot		interrupts = <GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>;
66*c66ec88fSEmmanuel Vadot		...
67*c66ec88fSEmmanuel Vadot	};
68