1*c66ec88fSEmmanuel Vadot=====================================================================
2*c66ec88fSEmmanuel VadotFreescale MPIC Interrupt Controller Node
3*c66ec88fSEmmanuel VadotCopyright (C) 2010,2011 Freescale Semiconductor Inc.
4*c66ec88fSEmmanuel Vadot=====================================================================
5*c66ec88fSEmmanuel Vadot
6*c66ec88fSEmmanuel VadotThe Freescale MPIC interrupt controller is found on all PowerQUICC
7*c66ec88fSEmmanuel Vadotand QorIQ processors and is compatible with the Open PIC.  The
8*c66ec88fSEmmanuel Vadotnotable difference from Open PIC binding is the addition of 2
9*c66ec88fSEmmanuel Vadotadditional cells in the interrupt specifier defining interrupt type
10*c66ec88fSEmmanuel Vadotinformation.
11*c66ec88fSEmmanuel Vadot
12*c66ec88fSEmmanuel VadotPROPERTIES
13*c66ec88fSEmmanuel Vadot
14*c66ec88fSEmmanuel Vadot  - compatible
15*c66ec88fSEmmanuel Vadot      Usage: required
16*c66ec88fSEmmanuel Vadot      Value type: <string>
17*c66ec88fSEmmanuel Vadot      Definition: Shall include "fsl,mpic".  Freescale MPIC
18*c66ec88fSEmmanuel Vadot          controllers compatible with this binding have Block
19*c66ec88fSEmmanuel Vadot          Revision Registers BRR1 and BRR2 at offset 0x0 and
20*c66ec88fSEmmanuel Vadot          0x10 in the MPIC.
21*c66ec88fSEmmanuel Vadot
22*c66ec88fSEmmanuel Vadot  - reg
23*c66ec88fSEmmanuel Vadot      Usage: required
24*c66ec88fSEmmanuel Vadot      Value type: <prop-encoded-array>
25*c66ec88fSEmmanuel Vadot      Definition: A standard property.  Specifies the physical
26*c66ec88fSEmmanuel Vadot          offset and length of the device's registers within the
27*c66ec88fSEmmanuel Vadot          CCSR address space.
28*c66ec88fSEmmanuel Vadot
29*c66ec88fSEmmanuel Vadot  - interrupt-controller
30*c66ec88fSEmmanuel Vadot      Usage: required
31*c66ec88fSEmmanuel Vadot      Value type: <empty>
32*c66ec88fSEmmanuel Vadot      Definition: Specifies that this node is an interrupt
33*c66ec88fSEmmanuel Vadot          controller
34*c66ec88fSEmmanuel Vadot
35*c66ec88fSEmmanuel Vadot  - #interrupt-cells
36*c66ec88fSEmmanuel Vadot      Usage: required
37*c66ec88fSEmmanuel Vadot      Value type: <u32>
38*c66ec88fSEmmanuel Vadot      Definition: Shall be 2 or 4.  A value of 2 means that interrupt
39*c66ec88fSEmmanuel Vadot          specifiers do not contain the interrupt-type or type-specific
40*c66ec88fSEmmanuel Vadot          information cells.
41*c66ec88fSEmmanuel Vadot
42*c66ec88fSEmmanuel Vadot  - #address-cells
43*c66ec88fSEmmanuel Vadot      Usage: required
44*c66ec88fSEmmanuel Vadot      Value type: <u32>
45*c66ec88fSEmmanuel Vadot      Definition: Shall be 0.
46*c66ec88fSEmmanuel Vadot
47*c66ec88fSEmmanuel Vadot  - pic-no-reset
48*c66ec88fSEmmanuel Vadot      Usage: optional
49*c66ec88fSEmmanuel Vadot      Value type: <empty>
50*c66ec88fSEmmanuel Vadot      Definition: The presence of this property specifies that the
51*c66ec88fSEmmanuel Vadot          MPIC must not be reset by the client program, and that
52*c66ec88fSEmmanuel Vadot          the boot program has initialized all interrupt source
53*c66ec88fSEmmanuel Vadot          configuration registers to a sane state-- masked or
54*c66ec88fSEmmanuel Vadot          directed at other cores.  This ensures that the client
55*c66ec88fSEmmanuel Vadot          program will not receive interrupts for sources not belonging
56*c66ec88fSEmmanuel Vadot          to the client.  The presence of this property also mandates
57*c66ec88fSEmmanuel Vadot          that any initialization related to interrupt sources shall
58*c66ec88fSEmmanuel Vadot          be limited to sources explicitly referenced in the device tree.
59*c66ec88fSEmmanuel Vadot
60*c66ec88fSEmmanuel Vadot  - big-endian
61*c66ec88fSEmmanuel Vadot      Usage: optional
62*c66ec88fSEmmanuel Vadot      Value type: <empty>
63*c66ec88fSEmmanuel Vadot          If present the MPIC will be assumed to be big-endian.  Some
64*c66ec88fSEmmanuel Vadot          device-trees omit this property on MPIC nodes even when the MPIC is
65*c66ec88fSEmmanuel Vadot          in fact big-endian, so certain boards override this property.
66*c66ec88fSEmmanuel Vadot
67*c66ec88fSEmmanuel Vadot  - single-cpu-affinity
68*c66ec88fSEmmanuel Vadot      Usage: optional
69*c66ec88fSEmmanuel Vadot      Value type: <empty>
70*c66ec88fSEmmanuel Vadot          If present the MPIC will be assumed to only be able to route
71*c66ec88fSEmmanuel Vadot          non-IPI interrupts to a single CPU at a time (EG: Freescale MPIC).
72*c66ec88fSEmmanuel Vadot
73*c66ec88fSEmmanuel Vadot  - last-interrupt-source
74*c66ec88fSEmmanuel Vadot      Usage: optional
75*c66ec88fSEmmanuel Vadot      Value type: <u32>
76*c66ec88fSEmmanuel Vadot          Some MPICs do not correctly report the number of hardware sources
77*c66ec88fSEmmanuel Vadot          in the global feature registers.  If specified, this field will
78*c66ec88fSEmmanuel Vadot          override the value read from MPIC_GREG_FEATURE_LAST_SRC.
79*c66ec88fSEmmanuel Vadot
80*c66ec88fSEmmanuel VadotINTERRUPT SPECIFIER DEFINITION
81*c66ec88fSEmmanuel Vadot
82*c66ec88fSEmmanuel Vadot  Interrupt specifiers consists of 4 cells encoded as
83*c66ec88fSEmmanuel Vadot  follows:
84*c66ec88fSEmmanuel Vadot
85*c66ec88fSEmmanuel Vadot   <1st-cell>   interrupt-number
86*c66ec88fSEmmanuel Vadot
87*c66ec88fSEmmanuel Vadot                Identifies the interrupt source.  The meaning
88*c66ec88fSEmmanuel Vadot                depends on the type of interrupt.
89*c66ec88fSEmmanuel Vadot
90*c66ec88fSEmmanuel Vadot                Note: If the interrupt-type cell is undefined
91*c66ec88fSEmmanuel Vadot                (i.e. #interrupt-cells = 2), this cell
92*c66ec88fSEmmanuel Vadot                should be interpreted the same as for
93*c66ec88fSEmmanuel Vadot                interrupt-type 0-- i.e. an external or
94*c66ec88fSEmmanuel Vadot                normal SoC device interrupt.
95*c66ec88fSEmmanuel Vadot
96*c66ec88fSEmmanuel Vadot   <2nd-cell>   level-sense information, encoded as follows:
97*c66ec88fSEmmanuel Vadot                    0 = low-to-high edge triggered
98*c66ec88fSEmmanuel Vadot                    1 = active low level-sensitive
99*c66ec88fSEmmanuel Vadot                    2 = active high level-sensitive
100*c66ec88fSEmmanuel Vadot                    3 = high-to-low edge triggered
101*c66ec88fSEmmanuel Vadot
102*c66ec88fSEmmanuel Vadot   <3rd-cell>   interrupt-type
103*c66ec88fSEmmanuel Vadot
104*c66ec88fSEmmanuel Vadot                The following types are supported:
105*c66ec88fSEmmanuel Vadot
106*c66ec88fSEmmanuel Vadot                  0 = external or normal SoC device interrupt
107*c66ec88fSEmmanuel Vadot
108*c66ec88fSEmmanuel Vadot                      The interrupt-number cell contains
109*c66ec88fSEmmanuel Vadot                      the SoC device interrupt number.  The
110*c66ec88fSEmmanuel Vadot                      type-specific cell is undefined.  The
111*c66ec88fSEmmanuel Vadot                      interrupt-number is derived from the
112*c66ec88fSEmmanuel Vadot                      MPIC a block of registers referred to as
113*c66ec88fSEmmanuel Vadot                      the "Interrupt Source Configuration Registers".
114*c66ec88fSEmmanuel Vadot                      Each source has 32-bytes of registers
115*c66ec88fSEmmanuel Vadot                      (vector/priority and destination) in this
116*c66ec88fSEmmanuel Vadot                      region.   So interrupt 0 is at offset 0x0,
117*c66ec88fSEmmanuel Vadot                      interrupt 1 is at offset 0x20, and so on.
118*c66ec88fSEmmanuel Vadot
119*c66ec88fSEmmanuel Vadot                  1 = error interrupt
120*c66ec88fSEmmanuel Vadot
121*c66ec88fSEmmanuel Vadot                      The interrupt-number cell contains
122*c66ec88fSEmmanuel Vadot                      the SoC device interrupt number for
123*c66ec88fSEmmanuel Vadot                      the error interrupt.  The type-specific
124*c66ec88fSEmmanuel Vadot                      cell identifies the specific error
125*c66ec88fSEmmanuel Vadot                      interrupt number.
126*c66ec88fSEmmanuel Vadot
127*c66ec88fSEmmanuel Vadot                  2 = MPIC inter-processor interrupt (IPI)
128*c66ec88fSEmmanuel Vadot
129*c66ec88fSEmmanuel Vadot                      The interrupt-number cell identifies
130*c66ec88fSEmmanuel Vadot                      the MPIC IPI number.  The type-specific
131*c66ec88fSEmmanuel Vadot                      cell is undefined.
132*c66ec88fSEmmanuel Vadot
133*c66ec88fSEmmanuel Vadot                  3 = MPIC timer interrupt
134*c66ec88fSEmmanuel Vadot
135*c66ec88fSEmmanuel Vadot                      The interrupt-number cell identifies
136*c66ec88fSEmmanuel Vadot                      the MPIC timer number.  The type-specific
137*c66ec88fSEmmanuel Vadot                      cell is undefined.
138*c66ec88fSEmmanuel Vadot
139*c66ec88fSEmmanuel Vadot   <4th-cell>   type-specific information
140*c66ec88fSEmmanuel Vadot
141*c66ec88fSEmmanuel Vadot                The type-specific cell is encoded as follows:
142*c66ec88fSEmmanuel Vadot
143*c66ec88fSEmmanuel Vadot                 - For interrupt-type 1 (error interrupt),
144*c66ec88fSEmmanuel Vadot                   the type-specific cell contains the
145*c66ec88fSEmmanuel Vadot                   bit number of the error interrupt in the
146*c66ec88fSEmmanuel Vadot                   Error Interrupt Summary Register.
147*c66ec88fSEmmanuel Vadot
148*c66ec88fSEmmanuel VadotEXAMPLE 1
149*c66ec88fSEmmanuel Vadot	/*
150*c66ec88fSEmmanuel Vadot	 * mpic interrupt controller with 4 cells per specifier
151*c66ec88fSEmmanuel Vadot	 */
152*c66ec88fSEmmanuel Vadot	mpic: pic@40000 {
153*c66ec88fSEmmanuel Vadot		compatible = "fsl,mpic";
154*c66ec88fSEmmanuel Vadot		interrupt-controller;
155*c66ec88fSEmmanuel Vadot		#interrupt-cells = <4>;
156*c66ec88fSEmmanuel Vadot		#address-cells = <0>;
157*c66ec88fSEmmanuel Vadot		reg = <0x40000 0x40000>;
158*c66ec88fSEmmanuel Vadot	};
159*c66ec88fSEmmanuel Vadot
160*c66ec88fSEmmanuel VadotEXAMPLE 2
161*c66ec88fSEmmanuel Vadot	/*
162*c66ec88fSEmmanuel Vadot	 * The MPC8544 I2C controller node has an internal
163*c66ec88fSEmmanuel Vadot	 * interrupt number of 27.  As per the reference manual
164*c66ec88fSEmmanuel Vadot	 * this corresponds to interrupt source configuration
165*c66ec88fSEmmanuel Vadot	 * registers at 0x5_0560.
166*c66ec88fSEmmanuel Vadot	 *
167*c66ec88fSEmmanuel Vadot	 * The interrupt source configuration registers begin
168*c66ec88fSEmmanuel Vadot	 * at 0x5_0000.
169*c66ec88fSEmmanuel Vadot	 *
170*c66ec88fSEmmanuel Vadot	 * To compute the interrupt specifier interrupt number
171*c66ec88fSEmmanuel Vadot         *
172*c66ec88fSEmmanuel Vadot	 *       0x560 >> 5 = 43
173*c66ec88fSEmmanuel Vadot	 *
174*c66ec88fSEmmanuel Vadot	 * The interrupt source configuration registers begin
175*c66ec88fSEmmanuel Vadot	 * at 0x5_0000, and so the i2c vector/priority registers
176*c66ec88fSEmmanuel Vadot	 * are at 0x5_0560.
177*c66ec88fSEmmanuel Vadot	 */
178*c66ec88fSEmmanuel Vadot	i2c@3000 {
179*c66ec88fSEmmanuel Vadot		#address-cells = <1>;
180*c66ec88fSEmmanuel Vadot		#size-cells = <0>;
181*c66ec88fSEmmanuel Vadot		cell-index = <0>;
182*c66ec88fSEmmanuel Vadot		compatible = "fsl-i2c";
183*c66ec88fSEmmanuel Vadot		reg = <0x3000 0x100>;
184*c66ec88fSEmmanuel Vadot		interrupts = <43 2>;
185*c66ec88fSEmmanuel Vadot		interrupt-parent = <&mpic>;
186*c66ec88fSEmmanuel Vadot		dfsrr;
187*c66ec88fSEmmanuel Vadot	};
188*c66ec88fSEmmanuel Vadot
189*c66ec88fSEmmanuel Vadot
190*c66ec88fSEmmanuel VadotEXAMPLE 3
191*c66ec88fSEmmanuel Vadot	/*
192*c66ec88fSEmmanuel Vadot	 *  Definition of a node defining the 4
193*c66ec88fSEmmanuel Vadot	 *  MPIC IPI interrupts.  Note the interrupt
194*c66ec88fSEmmanuel Vadot	 *  type of 2.
195*c66ec88fSEmmanuel Vadot	 */
196*c66ec88fSEmmanuel Vadot	ipi@410a0 {
197*c66ec88fSEmmanuel Vadot		compatible = "fsl,mpic-ipi";
198*c66ec88fSEmmanuel Vadot		reg = <0x40040 0x10>;
199*c66ec88fSEmmanuel Vadot		interrupts = <0 0 2 0
200*c66ec88fSEmmanuel Vadot		              1 0 2 0
201*c66ec88fSEmmanuel Vadot		              2 0 2 0
202*c66ec88fSEmmanuel Vadot		              3 0 2 0>;
203*c66ec88fSEmmanuel Vadot	};
204*c66ec88fSEmmanuel Vadot
205*c66ec88fSEmmanuel VadotEXAMPLE 4
206*c66ec88fSEmmanuel Vadot	/*
207*c66ec88fSEmmanuel Vadot	 *  Definition of a node defining the MPIC
208*c66ec88fSEmmanuel Vadot	 *  global timers.  Note the interrupt
209*c66ec88fSEmmanuel Vadot	 *  type of 3.
210*c66ec88fSEmmanuel Vadot	 */
211*c66ec88fSEmmanuel Vadot	timer0: timer@41100 {
212*c66ec88fSEmmanuel Vadot		compatible = "fsl,mpic-global-timer";
213*c66ec88fSEmmanuel Vadot		reg = <0x41100 0x100 0x41300 4>;
214*c66ec88fSEmmanuel Vadot		interrupts = <0 0 3 0
215*c66ec88fSEmmanuel Vadot		              1 0 3 0
216*c66ec88fSEmmanuel Vadot		              2 0 3 0
217*c66ec88fSEmmanuel Vadot		              3 0 3 0>;
218*c66ec88fSEmmanuel Vadot	};
219*c66ec88fSEmmanuel Vadot
220*c66ec88fSEmmanuel VadotEXAMPLE 5
221*c66ec88fSEmmanuel Vadot	/*
222*c66ec88fSEmmanuel Vadot	 * Definition of an error interrupt (interrupt type 1).
223*c66ec88fSEmmanuel Vadot	 * SoC interrupt number is 16 and the specific error
224*c66ec88fSEmmanuel Vadot         * interrupt bit in the error interrupt summary register
225*c66ec88fSEmmanuel Vadot	 * is 23.
226*c66ec88fSEmmanuel Vadot	 */
227*c66ec88fSEmmanuel Vadot	memory-controller@8000 {
228*c66ec88fSEmmanuel Vadot		compatible = "fsl,p4080-memory-controller";
229*c66ec88fSEmmanuel Vadot		reg = <0x8000 0x1000>;
230*c66ec88fSEmmanuel Vadot		interrupts = <16 2 1 23>;
231*c66ec88fSEmmanuel Vadot	};
232