162306a36Sopenharmony_ci=====================================================================
262306a36Sopenharmony_ciFreescale MPIC Interrupt Controller Node
362306a36Sopenharmony_ciCopyright (C) 2010,2011 Freescale Semiconductor Inc.
462306a36Sopenharmony_ci=====================================================================
562306a36Sopenharmony_ci
662306a36Sopenharmony_ciThe Freescale MPIC interrupt controller is found on all PowerQUICC
762306a36Sopenharmony_ciand QorIQ processors and is compatible with the Open PIC.  The
862306a36Sopenharmony_cinotable difference from Open PIC binding is the addition of 2
962306a36Sopenharmony_ciadditional cells in the interrupt specifier defining interrupt type
1062306a36Sopenharmony_ciinformation.
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciPROPERTIES
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci  - compatible
1562306a36Sopenharmony_ci      Usage: required
1662306a36Sopenharmony_ci      Value type: <string>
1762306a36Sopenharmony_ci      Definition: Shall include "fsl,mpic".  Freescale MPIC
1862306a36Sopenharmony_ci          controllers compatible with this binding have Block
1962306a36Sopenharmony_ci          Revision Registers BRR1 and BRR2 at offset 0x0 and
2062306a36Sopenharmony_ci          0x10 in the MPIC.
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci  - reg
2362306a36Sopenharmony_ci      Usage: required
2462306a36Sopenharmony_ci      Value type: <prop-encoded-array>
2562306a36Sopenharmony_ci      Definition: A standard property.  Specifies the physical
2662306a36Sopenharmony_ci          offset and length of the device's registers within the
2762306a36Sopenharmony_ci          CCSR address space.
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci  - interrupt-controller
3062306a36Sopenharmony_ci      Usage: required
3162306a36Sopenharmony_ci      Value type: <empty>
3262306a36Sopenharmony_ci      Definition: Specifies that this node is an interrupt
3362306a36Sopenharmony_ci          controller
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci  - #interrupt-cells
3662306a36Sopenharmony_ci      Usage: required
3762306a36Sopenharmony_ci      Value type: <u32>
3862306a36Sopenharmony_ci      Definition: Shall be 2 or 4.  A value of 2 means that interrupt
3962306a36Sopenharmony_ci          specifiers do not contain the interrupt-type or type-specific
4062306a36Sopenharmony_ci          information cells.
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci  - #address-cells
4362306a36Sopenharmony_ci      Usage: required
4462306a36Sopenharmony_ci      Value type: <u32>
4562306a36Sopenharmony_ci      Definition: Shall be 0.
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci  - pic-no-reset
4862306a36Sopenharmony_ci      Usage: optional
4962306a36Sopenharmony_ci      Value type: <empty>
5062306a36Sopenharmony_ci      Definition: The presence of this property specifies that the
5162306a36Sopenharmony_ci          MPIC must not be reset by the client program, and that
5262306a36Sopenharmony_ci          the boot program has initialized all interrupt source
5362306a36Sopenharmony_ci          configuration registers to a sane state-- masked or
5462306a36Sopenharmony_ci          directed at other cores.  This ensures that the client
5562306a36Sopenharmony_ci          program will not receive interrupts for sources not belonging
5662306a36Sopenharmony_ci          to the client.  The presence of this property also mandates
5762306a36Sopenharmony_ci          that any initialization related to interrupt sources shall
5862306a36Sopenharmony_ci          be limited to sources explicitly referenced in the device tree.
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci  - big-endian
6162306a36Sopenharmony_ci      Usage: optional
6262306a36Sopenharmony_ci      Value type: <empty>
6362306a36Sopenharmony_ci          If present the MPIC will be assumed to be big-endian.  Some
6462306a36Sopenharmony_ci          device-trees omit this property on MPIC nodes even when the MPIC is
6562306a36Sopenharmony_ci          in fact big-endian, so certain boards override this property.
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci  - single-cpu-affinity
6862306a36Sopenharmony_ci      Usage: optional
6962306a36Sopenharmony_ci      Value type: <empty>
7062306a36Sopenharmony_ci          If present the MPIC will be assumed to only be able to route
7162306a36Sopenharmony_ci          non-IPI interrupts to a single CPU at a time (EG: Freescale MPIC).
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci  - last-interrupt-source
7462306a36Sopenharmony_ci      Usage: optional
7562306a36Sopenharmony_ci      Value type: <u32>
7662306a36Sopenharmony_ci          Some MPICs do not correctly report the number of hardware sources
7762306a36Sopenharmony_ci          in the global feature registers.  If specified, this field will
7862306a36Sopenharmony_ci          override the value read from MPIC_GREG_FEATURE_LAST_SRC.
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ciINTERRUPT SPECIFIER DEFINITION
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci  Interrupt specifiers consists of 4 cells encoded as
8362306a36Sopenharmony_ci  follows:
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci   <1st-cell>   interrupt-number
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci                Identifies the interrupt source.  The meaning
8862306a36Sopenharmony_ci                depends on the type of interrupt.
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci                Note: If the interrupt-type cell is undefined
9162306a36Sopenharmony_ci                (i.e. #interrupt-cells = 2), this cell
9262306a36Sopenharmony_ci                should be interpreted the same as for
9362306a36Sopenharmony_ci                interrupt-type 0-- i.e. an external or
9462306a36Sopenharmony_ci                normal SoC device interrupt.
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci   <2nd-cell>   level-sense information, encoded as follows:
9762306a36Sopenharmony_ci                    0 = low-to-high edge triggered
9862306a36Sopenharmony_ci                    1 = active low level-sensitive
9962306a36Sopenharmony_ci                    2 = active high level-sensitive
10062306a36Sopenharmony_ci                    3 = high-to-low edge triggered
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci   <3rd-cell>   interrupt-type
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci                The following types are supported:
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci                  0 = external or normal SoC device interrupt
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci                      The interrupt-number cell contains
10962306a36Sopenharmony_ci                      the SoC device interrupt number.  The
11062306a36Sopenharmony_ci                      type-specific cell is undefined.  The
11162306a36Sopenharmony_ci                      interrupt-number is derived from the
11262306a36Sopenharmony_ci                      MPIC a block of registers referred to as
11362306a36Sopenharmony_ci                      the "Interrupt Source Configuration Registers".
11462306a36Sopenharmony_ci                      Each source has 32-bytes of registers
11562306a36Sopenharmony_ci                      (vector/priority and destination) in this
11662306a36Sopenharmony_ci                      region.   So interrupt 0 is at offset 0x0,
11762306a36Sopenharmony_ci                      interrupt 1 is at offset 0x20, and so on.
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci                  1 = error interrupt
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci                      The interrupt-number cell contains
12262306a36Sopenharmony_ci                      the SoC device interrupt number for
12362306a36Sopenharmony_ci                      the error interrupt.  The type-specific
12462306a36Sopenharmony_ci                      cell identifies the specific error
12562306a36Sopenharmony_ci                      interrupt number.
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ci                  2 = MPIC inter-processor interrupt (IPI)
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci                      The interrupt-number cell identifies
13062306a36Sopenharmony_ci                      the MPIC IPI number.  The type-specific
13162306a36Sopenharmony_ci                      cell is undefined.
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci                  3 = MPIC timer interrupt
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci                      The interrupt-number cell identifies
13662306a36Sopenharmony_ci                      the MPIC timer number.  The type-specific
13762306a36Sopenharmony_ci                      cell is undefined.
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ci   <4th-cell>   type-specific information
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci                The type-specific cell is encoded as follows:
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci                 - For interrupt-type 1 (error interrupt),
14462306a36Sopenharmony_ci                   the type-specific cell contains the
14562306a36Sopenharmony_ci                   bit number of the error interrupt in the
14662306a36Sopenharmony_ci                   Error Interrupt Summary Register.
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_ciEXAMPLE 1
14962306a36Sopenharmony_ci	/*
15062306a36Sopenharmony_ci	 * mpic interrupt controller with 4 cells per specifier
15162306a36Sopenharmony_ci	 */
15262306a36Sopenharmony_ci	mpic: pic@40000 {
15362306a36Sopenharmony_ci		compatible = "fsl,mpic";
15462306a36Sopenharmony_ci		interrupt-controller;
15562306a36Sopenharmony_ci		#interrupt-cells = <4>;
15662306a36Sopenharmony_ci		#address-cells = <0>;
15762306a36Sopenharmony_ci		reg = <0x40000 0x40000>;
15862306a36Sopenharmony_ci	};
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ciEXAMPLE 2
16162306a36Sopenharmony_ci	/*
16262306a36Sopenharmony_ci	 * The MPC8544 I2C controller node has an internal
16362306a36Sopenharmony_ci	 * interrupt number of 27.  As per the reference manual
16462306a36Sopenharmony_ci	 * this corresponds to interrupt source configuration
16562306a36Sopenharmony_ci	 * registers at 0x5_0560.
16662306a36Sopenharmony_ci	 *
16762306a36Sopenharmony_ci	 * The interrupt source configuration registers begin
16862306a36Sopenharmony_ci	 * at 0x5_0000.
16962306a36Sopenharmony_ci	 *
17062306a36Sopenharmony_ci	 * To compute the interrupt specifier interrupt number
17162306a36Sopenharmony_ci         *
17262306a36Sopenharmony_ci	 *       0x560 >> 5 = 43
17362306a36Sopenharmony_ci	 *
17462306a36Sopenharmony_ci	 * The interrupt source configuration registers begin
17562306a36Sopenharmony_ci	 * at 0x5_0000, and so the i2c vector/priority registers
17662306a36Sopenharmony_ci	 * are at 0x5_0560.
17762306a36Sopenharmony_ci	 */
17862306a36Sopenharmony_ci	i2c@3000 {
17962306a36Sopenharmony_ci		#address-cells = <1>;
18062306a36Sopenharmony_ci		#size-cells = <0>;
18162306a36Sopenharmony_ci		cell-index = <0>;
18262306a36Sopenharmony_ci		compatible = "fsl-i2c";
18362306a36Sopenharmony_ci		reg = <0x3000 0x100>;
18462306a36Sopenharmony_ci		interrupts = <43 2>;
18562306a36Sopenharmony_ci		interrupt-parent = <&mpic>;
18662306a36Sopenharmony_ci		dfsrr;
18762306a36Sopenharmony_ci	};
18862306a36Sopenharmony_ci
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ciEXAMPLE 3
19162306a36Sopenharmony_ci	/*
19262306a36Sopenharmony_ci	 *  Definition of a node defining the 4
19362306a36Sopenharmony_ci	 *  MPIC IPI interrupts.  Note the interrupt
19462306a36Sopenharmony_ci	 *  type of 2.
19562306a36Sopenharmony_ci	 */
19662306a36Sopenharmony_ci	ipi@410a0 {
19762306a36Sopenharmony_ci		compatible = "fsl,mpic-ipi";
19862306a36Sopenharmony_ci		reg = <0x40040 0x10>;
19962306a36Sopenharmony_ci		interrupts = <0 0 2 0
20062306a36Sopenharmony_ci		              1 0 2 0
20162306a36Sopenharmony_ci		              2 0 2 0
20262306a36Sopenharmony_ci		              3 0 2 0>;
20362306a36Sopenharmony_ci	};
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ciEXAMPLE 4
20662306a36Sopenharmony_ci	/*
20762306a36Sopenharmony_ci	 *  Definition of a node defining the MPIC
20862306a36Sopenharmony_ci	 *  global timers.  Note the interrupt
20962306a36Sopenharmony_ci	 *  type of 3.
21062306a36Sopenharmony_ci	 */
21162306a36Sopenharmony_ci	timer0: timer@41100 {
21262306a36Sopenharmony_ci		compatible = "fsl,mpic-global-timer";
21362306a36Sopenharmony_ci		reg = <0x41100 0x100 0x41300 4>;
21462306a36Sopenharmony_ci		interrupts = <0 0 3 0
21562306a36Sopenharmony_ci		              1 0 3 0
21662306a36Sopenharmony_ci		              2 0 3 0
21762306a36Sopenharmony_ci		              3 0 3 0>;
21862306a36Sopenharmony_ci	};
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_ciEXAMPLE 5
22162306a36Sopenharmony_ci	/*
22262306a36Sopenharmony_ci	 * Definition of an error interrupt (interrupt type 1).
22362306a36Sopenharmony_ci	 * SoC interrupt number is 16 and the specific error
22462306a36Sopenharmony_ci         * interrupt bit in the error interrupt summary register
22562306a36Sopenharmony_ci	 * is 23.
22662306a36Sopenharmony_ci	 */
22762306a36Sopenharmony_ci	memory-controller@8000 {
22862306a36Sopenharmony_ci		compatible = "fsl,p4080-memory-controller";
22962306a36Sopenharmony_ci		reg = <0x8000 0x1000>;
23062306a36Sopenharmony_ci		interrupts = <16 2 1 23>;
23162306a36Sopenharmony_ci	};
232