18c2ecf20Sopenharmony_ci=====================================================================
28c2ecf20Sopenharmony_ciFreescale MPIC Interrupt Controller Node
38c2ecf20Sopenharmony_ciCopyright (C) 2010,2011 Freescale Semiconductor Inc.
48c2ecf20Sopenharmony_ci=====================================================================
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciThe Freescale MPIC interrupt controller is found on all PowerQUICC
78c2ecf20Sopenharmony_ciand QorIQ processors and is compatible with the Open PIC.  The
88c2ecf20Sopenharmony_cinotable difference from Open PIC binding is the addition of 2
98c2ecf20Sopenharmony_ciadditional cells in the interrupt specifier defining interrupt type
108c2ecf20Sopenharmony_ciinformation.
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciPROPERTIES
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci  - compatible
158c2ecf20Sopenharmony_ci      Usage: required
168c2ecf20Sopenharmony_ci      Value type: <string>
178c2ecf20Sopenharmony_ci      Definition: Shall include "fsl,mpic".  Freescale MPIC
188c2ecf20Sopenharmony_ci          controllers compatible with this binding have Block
198c2ecf20Sopenharmony_ci          Revision Registers BRR1 and BRR2 at offset 0x0 and
208c2ecf20Sopenharmony_ci          0x10 in the MPIC.
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci  - reg
238c2ecf20Sopenharmony_ci      Usage: required
248c2ecf20Sopenharmony_ci      Value type: <prop-encoded-array>
258c2ecf20Sopenharmony_ci      Definition: A standard property.  Specifies the physical
268c2ecf20Sopenharmony_ci          offset and length of the device's registers within the
278c2ecf20Sopenharmony_ci          CCSR address space.
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci  - interrupt-controller
308c2ecf20Sopenharmony_ci      Usage: required
318c2ecf20Sopenharmony_ci      Value type: <empty>
328c2ecf20Sopenharmony_ci      Definition: Specifies that this node is an interrupt
338c2ecf20Sopenharmony_ci          controller
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci  - #interrupt-cells
368c2ecf20Sopenharmony_ci      Usage: required
378c2ecf20Sopenharmony_ci      Value type: <u32>
388c2ecf20Sopenharmony_ci      Definition: Shall be 2 or 4.  A value of 2 means that interrupt
398c2ecf20Sopenharmony_ci          specifiers do not contain the interrupt-type or type-specific
408c2ecf20Sopenharmony_ci          information cells.
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci  - #address-cells
438c2ecf20Sopenharmony_ci      Usage: required
448c2ecf20Sopenharmony_ci      Value type: <u32>
458c2ecf20Sopenharmony_ci      Definition: Shall be 0.
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci  - pic-no-reset
488c2ecf20Sopenharmony_ci      Usage: optional
498c2ecf20Sopenharmony_ci      Value type: <empty>
508c2ecf20Sopenharmony_ci      Definition: The presence of this property specifies that the
518c2ecf20Sopenharmony_ci          MPIC must not be reset by the client program, and that
528c2ecf20Sopenharmony_ci          the boot program has initialized all interrupt source
538c2ecf20Sopenharmony_ci          configuration registers to a sane state-- masked or
548c2ecf20Sopenharmony_ci          directed at other cores.  This ensures that the client
558c2ecf20Sopenharmony_ci          program will not receive interrupts for sources not belonging
568c2ecf20Sopenharmony_ci          to the client.  The presence of this property also mandates
578c2ecf20Sopenharmony_ci          that any initialization related to interrupt sources shall
588c2ecf20Sopenharmony_ci          be limited to sources explicitly referenced in the device tree.
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci  - big-endian
618c2ecf20Sopenharmony_ci      Usage: optional
628c2ecf20Sopenharmony_ci      Value type: <empty>
638c2ecf20Sopenharmony_ci          If present the MPIC will be assumed to be big-endian.  Some
648c2ecf20Sopenharmony_ci          device-trees omit this property on MPIC nodes even when the MPIC is
658c2ecf20Sopenharmony_ci          in fact big-endian, so certain boards override this property.
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci  - single-cpu-affinity
688c2ecf20Sopenharmony_ci      Usage: optional
698c2ecf20Sopenharmony_ci      Value type: <empty>
708c2ecf20Sopenharmony_ci          If present the MPIC will be assumed to only be able to route
718c2ecf20Sopenharmony_ci          non-IPI interrupts to a single CPU at a time (EG: Freescale MPIC).
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci  - last-interrupt-source
748c2ecf20Sopenharmony_ci      Usage: optional
758c2ecf20Sopenharmony_ci      Value type: <u32>
768c2ecf20Sopenharmony_ci          Some MPICs do not correctly report the number of hardware sources
778c2ecf20Sopenharmony_ci          in the global feature registers.  If specified, this field will
788c2ecf20Sopenharmony_ci          override the value read from MPIC_GREG_FEATURE_LAST_SRC.
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ciINTERRUPT SPECIFIER DEFINITION
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci  Interrupt specifiers consists of 4 cells encoded as
838c2ecf20Sopenharmony_ci  follows:
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci   <1st-cell>   interrupt-number
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci                Identifies the interrupt source.  The meaning
888c2ecf20Sopenharmony_ci                depends on the type of interrupt.
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci                Note: If the interrupt-type cell is undefined
918c2ecf20Sopenharmony_ci                (i.e. #interrupt-cells = 2), this cell
928c2ecf20Sopenharmony_ci                should be interpreted the same as for
938c2ecf20Sopenharmony_ci                interrupt-type 0-- i.e. an external or
948c2ecf20Sopenharmony_ci                normal SoC device interrupt.
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci   <2nd-cell>   level-sense information, encoded as follows:
978c2ecf20Sopenharmony_ci                    0 = low-to-high edge triggered
988c2ecf20Sopenharmony_ci                    1 = active low level-sensitive
998c2ecf20Sopenharmony_ci                    2 = active high level-sensitive
1008c2ecf20Sopenharmony_ci                    3 = high-to-low edge triggered
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci   <3rd-cell>   interrupt-type
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci                The following types are supported:
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci                  0 = external or normal SoC device interrupt
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci                      The interrupt-number cell contains
1098c2ecf20Sopenharmony_ci                      the SoC device interrupt number.  The
1108c2ecf20Sopenharmony_ci                      type-specific cell is undefined.  The
1118c2ecf20Sopenharmony_ci                      interrupt-number is derived from the
1128c2ecf20Sopenharmony_ci                      MPIC a block of registers referred to as
1138c2ecf20Sopenharmony_ci                      the "Interrupt Source Configuration Registers".
1148c2ecf20Sopenharmony_ci                      Each source has 32-bytes of registers
1158c2ecf20Sopenharmony_ci                      (vector/priority and destination) in this
1168c2ecf20Sopenharmony_ci                      region.   So interrupt 0 is at offset 0x0,
1178c2ecf20Sopenharmony_ci                      interrupt 1 is at offset 0x20, and so on.
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci                  1 = error interrupt
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci                      The interrupt-number cell contains
1228c2ecf20Sopenharmony_ci                      the SoC device interrupt number for
1238c2ecf20Sopenharmony_ci                      the error interrupt.  The type-specific
1248c2ecf20Sopenharmony_ci                      cell identifies the specific error
1258c2ecf20Sopenharmony_ci                      interrupt number.
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci                  2 = MPIC inter-processor interrupt (IPI)
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci                      The interrupt-number cell identifies
1308c2ecf20Sopenharmony_ci                      the MPIC IPI number.  The type-specific
1318c2ecf20Sopenharmony_ci                      cell is undefined.
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci                  3 = MPIC timer interrupt
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci                      The interrupt-number cell identifies
1368c2ecf20Sopenharmony_ci                      the MPIC timer number.  The type-specific
1378c2ecf20Sopenharmony_ci                      cell is undefined.
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci   <4th-cell>   type-specific information
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci                The type-specific cell is encoded as follows:
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci                 - For interrupt-type 1 (error interrupt),
1448c2ecf20Sopenharmony_ci                   the type-specific cell contains the
1458c2ecf20Sopenharmony_ci                   bit number of the error interrupt in the
1468c2ecf20Sopenharmony_ci                   Error Interrupt Summary Register.
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ciEXAMPLE 1
1498c2ecf20Sopenharmony_ci	/*
1508c2ecf20Sopenharmony_ci	 * mpic interrupt controller with 4 cells per specifier
1518c2ecf20Sopenharmony_ci	 */
1528c2ecf20Sopenharmony_ci	mpic: pic@40000 {
1538c2ecf20Sopenharmony_ci		compatible = "fsl,mpic";
1548c2ecf20Sopenharmony_ci		interrupt-controller;
1558c2ecf20Sopenharmony_ci		#interrupt-cells = <4>;
1568c2ecf20Sopenharmony_ci		#address-cells = <0>;
1578c2ecf20Sopenharmony_ci		reg = <0x40000 0x40000>;
1588c2ecf20Sopenharmony_ci	};
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ciEXAMPLE 2
1618c2ecf20Sopenharmony_ci	/*
1628c2ecf20Sopenharmony_ci	 * The MPC8544 I2C controller node has an internal
1638c2ecf20Sopenharmony_ci	 * interrupt number of 27.  As per the reference manual
1648c2ecf20Sopenharmony_ci	 * this corresponds to interrupt source configuration
1658c2ecf20Sopenharmony_ci	 * registers at 0x5_0560.
1668c2ecf20Sopenharmony_ci	 *
1678c2ecf20Sopenharmony_ci	 * The interrupt source configuration registers begin
1688c2ecf20Sopenharmony_ci	 * at 0x5_0000.
1698c2ecf20Sopenharmony_ci	 *
1708c2ecf20Sopenharmony_ci	 * To compute the interrupt specifier interrupt number
1718c2ecf20Sopenharmony_ci         *
1728c2ecf20Sopenharmony_ci	 *       0x560 >> 5 = 43
1738c2ecf20Sopenharmony_ci	 *
1748c2ecf20Sopenharmony_ci	 * The interrupt source configuration registers begin
1758c2ecf20Sopenharmony_ci	 * at 0x5_0000, and so the i2c vector/priority registers
1768c2ecf20Sopenharmony_ci	 * are at 0x5_0560.
1778c2ecf20Sopenharmony_ci	 */
1788c2ecf20Sopenharmony_ci	i2c@3000 {
1798c2ecf20Sopenharmony_ci		#address-cells = <1>;
1808c2ecf20Sopenharmony_ci		#size-cells = <0>;
1818c2ecf20Sopenharmony_ci		cell-index = <0>;
1828c2ecf20Sopenharmony_ci		compatible = "fsl-i2c";
1838c2ecf20Sopenharmony_ci		reg = <0x3000 0x100>;
1848c2ecf20Sopenharmony_ci		interrupts = <43 2>;
1858c2ecf20Sopenharmony_ci		interrupt-parent = <&mpic>;
1868c2ecf20Sopenharmony_ci		dfsrr;
1878c2ecf20Sopenharmony_ci	};
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ciEXAMPLE 3
1918c2ecf20Sopenharmony_ci	/*
1928c2ecf20Sopenharmony_ci	 *  Definition of a node defining the 4
1938c2ecf20Sopenharmony_ci	 *  MPIC IPI interrupts.  Note the interrupt
1948c2ecf20Sopenharmony_ci	 *  type of 2.
1958c2ecf20Sopenharmony_ci	 */
1968c2ecf20Sopenharmony_ci	ipi@410a0 {
1978c2ecf20Sopenharmony_ci		compatible = "fsl,mpic-ipi";
1988c2ecf20Sopenharmony_ci		reg = <0x40040 0x10>;
1998c2ecf20Sopenharmony_ci		interrupts = <0 0 2 0
2008c2ecf20Sopenharmony_ci		              1 0 2 0
2018c2ecf20Sopenharmony_ci		              2 0 2 0
2028c2ecf20Sopenharmony_ci		              3 0 2 0>;
2038c2ecf20Sopenharmony_ci	};
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ciEXAMPLE 4
2068c2ecf20Sopenharmony_ci	/*
2078c2ecf20Sopenharmony_ci	 *  Definition of a node defining the MPIC
2088c2ecf20Sopenharmony_ci	 *  global timers.  Note the interrupt
2098c2ecf20Sopenharmony_ci	 *  type of 3.
2108c2ecf20Sopenharmony_ci	 */
2118c2ecf20Sopenharmony_ci	timer0: timer@41100 {
2128c2ecf20Sopenharmony_ci		compatible = "fsl,mpic-global-timer";
2138c2ecf20Sopenharmony_ci		reg = <0x41100 0x100 0x41300 4>;
2148c2ecf20Sopenharmony_ci		interrupts = <0 0 3 0
2158c2ecf20Sopenharmony_ci		              1 0 3 0
2168c2ecf20Sopenharmony_ci		              2 0 3 0
2178c2ecf20Sopenharmony_ci		              3 0 3 0>;
2188c2ecf20Sopenharmony_ci	};
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ciEXAMPLE 5
2218c2ecf20Sopenharmony_ci	/*
2228c2ecf20Sopenharmony_ci	 * Definition of an error interrupt (interrupt type 1).
2238c2ecf20Sopenharmony_ci	 * SoC interrupt number is 16 and the specific error
2248c2ecf20Sopenharmony_ci         * interrupt bit in the error interrupt summary register
2258c2ecf20Sopenharmony_ci	 * is 23.
2268c2ecf20Sopenharmony_ci	 */
2278c2ecf20Sopenharmony_ci	memory-controller@8000 {
2288c2ecf20Sopenharmony_ci		compatible = "fsl,p4080-memory-controller";
2298c2ecf20Sopenharmony_ci		reg = <0x8000 0x1000>;
2308c2ecf20Sopenharmony_ci		interrupts = <16 2 1 23>;
2318c2ecf20Sopenharmony_ci	};
232