xref: /linux/Documentation/devicetree/bindings/powerpc/fsl/mpic.txt (revision 98cca250aecaf3f1b2fec003e1c0ce0bfaa4be36)
152052875SStuart Yoder=====================================================================
252052875SStuart YoderFreescale MPIC Interrupt Controller Node
352052875SStuart YoderCopyright (C) 2010,2011 Freescale Semiconductor Inc.
452052875SStuart Yoder=====================================================================
5d524dac9SGrant Likely
652052875SStuart YoderThe Freescale MPIC interrupt controller is found on all PowerQUICC
752052875SStuart Yoderand QorIQ processors and is compatible with the Open PIC.  The
852052875SStuart Yodernotable difference from Open PIC binding is the addition of 2
952052875SStuart Yoderadditional cells in the interrupt specifier defining interrupt type
1052052875SStuart Yoderinformation.
11d524dac9SGrant Likely
1252052875SStuart YoderPROPERTIES
13d524dac9SGrant Likely
1452052875SStuart Yoder  - compatible
1552052875SStuart Yoder      Usage: required
1652052875SStuart Yoder      Value type: <string>
1752052875SStuart Yoder      Definition: Shall include "fsl,mpic".  Freescale MPIC
1852052875SStuart Yoder          controllers compatible with this binding have Block
1952052875SStuart Yoder          Revision Registers BRR1 and BRR2 at offset 0x0 and
2052052875SStuart Yoder          0x10 in the MPIC.
21d524dac9SGrant Likely
2252052875SStuart Yoder  - reg
2352052875SStuart Yoder      Usage: required
2452052875SStuart Yoder      Value type: <prop-encoded-array>
2552052875SStuart Yoder      Definition: A standard property.  Specifies the physical
2652052875SStuart Yoder          offset and length of the device's registers within the
2752052875SStuart Yoder          CCSR address space.
28d524dac9SGrant Likely
2952052875SStuart Yoder  - interrupt-controller
3052052875SStuart Yoder      Usage: required
3152052875SStuart Yoder      Value type: <empty>
3252052875SStuart Yoder      Definition: Specifies that this node is an interrupt
3352052875SStuart Yoder          controller
34d524dac9SGrant Likely
3552052875SStuart Yoder  - #interrupt-cells
3652052875SStuart Yoder      Usage: required
3752052875SStuart Yoder      Value type: <u32>
3852052875SStuart Yoder      Definition: Shall be 2 or 4.  A value of 2 means that interrupt
3952052875SStuart Yoder          specifiers do not contain the interrupt-type or type-specific
4052052875SStuart Yoder          information cells.
4152052875SStuart Yoder
4252052875SStuart Yoder  - #address-cells
4352052875SStuart Yoder      Usage: required
4452052875SStuart Yoder      Value type: <u32>
4552052875SStuart Yoder      Definition: Shall be 0.
4652052875SStuart Yoder
4752052875SStuart Yoder  - pic-no-reset
4852052875SStuart Yoder      Usage: optional
4952052875SStuart Yoder      Value type: <empty>
5052052875SStuart Yoder      Definition: The presence of this property specifies that the
5152052875SStuart Yoder          MPIC must not be reset by the client program, and that
5252052875SStuart Yoder          the boot program has initialized all interrupt source
5352052875SStuart Yoder          configuration registers to a sane state-- masked or
5452052875SStuart Yoder          directed at other cores.  This ensures that the client
5552052875SStuart Yoder          program will not receive interrupts for sources not belonging
5652052875SStuart Yoder          to the client.  The presence of this property also mandates
5752052875SStuart Yoder          that any initialization related to interrupt sources shall
5852052875SStuart Yoder          be limited to sources explicitly referenced in the device tree.
5952052875SStuart Yoder
60*98cca250SKyle Moffett  - big-endian
61*98cca250SKyle Moffett      Usage: optional
62*98cca250SKyle Moffett      Value type: <empty>
63*98cca250SKyle Moffett          If present the MPIC will be assumed to be big-endian.  Some
64*98cca250SKyle Moffett          device-trees omit this property on MPIC nodes even when the MPIC is
65*98cca250SKyle Moffett          in fact big-endian, so certain boards override this property.
66*98cca250SKyle Moffett
6752052875SStuart YoderINTERRUPT SPECIFIER DEFINITION
6852052875SStuart Yoder
6952052875SStuart Yoder  Interrupt specifiers consists of 4 cells encoded as
7052052875SStuart Yoder  follows:
7152052875SStuart Yoder
7252052875SStuart Yoder   <1st-cell>   interrupt-number
7352052875SStuart Yoder
7452052875SStuart Yoder                Identifies the interrupt source.  The meaning
7552052875SStuart Yoder                depends on the type of interrupt.
7652052875SStuart Yoder
7752052875SStuart Yoder                Note: If the interrupt-type cell is undefined
7852052875SStuart Yoder                (i.e. #interrupt-cells = 2), this cell
7952052875SStuart Yoder                should be interpreted the same as for
8052052875SStuart Yoder                interrupt-type 0-- i.e. an external or
8152052875SStuart Yoder                normal SoC device interrupt.
8252052875SStuart Yoder
8352052875SStuart Yoder   <2nd-cell>   level-sense information, encoded as follows:
8452052875SStuart Yoder                    0 = low-to-high edge triggered
8552052875SStuart Yoder                    1 = active low level-sensitive
8652052875SStuart Yoder                    2 = active high level-sensitive
8752052875SStuart Yoder                    3 = high-to-low edge triggered
8852052875SStuart Yoder
8952052875SStuart Yoder   <3rd-cell>   interrupt-type
9052052875SStuart Yoder
9152052875SStuart Yoder                The following types are supported:
9252052875SStuart Yoder
9352052875SStuart Yoder                  0 = external or normal SoC device interrupt
9452052875SStuart Yoder
9552052875SStuart Yoder                      The interrupt-number cell contains
9652052875SStuart Yoder                      the SoC device interrupt number.  The
9752052875SStuart Yoder                      type-specific cell is undefined.  The
9852052875SStuart Yoder                      interrupt-number is derived from the
9952052875SStuart Yoder                      MPIC a block of registers referred to as
10052052875SStuart Yoder                      the "Interrupt Source Configuration Registers".
10152052875SStuart Yoder                      Each source has 32-bytes of registers
10252052875SStuart Yoder                      (vector/priority and destination) in this
10352052875SStuart Yoder                      region.   So interrupt 0 is at offset 0x0,
10452052875SStuart Yoder                      interrupt 1 is at offset 0x20, and so on.
10552052875SStuart Yoder
10652052875SStuart Yoder                  1 = error interrupt
10752052875SStuart Yoder
10852052875SStuart Yoder                      The interrupt-number cell contains
10952052875SStuart Yoder                      the SoC device interrupt number for
11052052875SStuart Yoder                      the error interrupt.  The type-specific
11152052875SStuart Yoder                      cell identifies the specific error
11252052875SStuart Yoder                      interrupt number.
11352052875SStuart Yoder
11452052875SStuart Yoder                  2 = MPIC inter-processor interrupt (IPI)
11552052875SStuart Yoder
11652052875SStuart Yoder                      The interrupt-number cell identifies
11752052875SStuart Yoder                      the MPIC IPI number.  The type-specific
11852052875SStuart Yoder                      cell is undefined.
11952052875SStuart Yoder
12052052875SStuart Yoder                  3 = MPIC timer interrupt
12152052875SStuart Yoder
12252052875SStuart Yoder                      The interrupt-number cell identifies
12352052875SStuart Yoder                      the MPIC timer number.  The type-specific
12452052875SStuart Yoder                      cell is undefined.
12552052875SStuart Yoder
12652052875SStuart Yoder   <4th-cell>   type-specific information
12752052875SStuart Yoder
12852052875SStuart Yoder                The type-specific cell is encoded as follows:
12952052875SStuart Yoder
13052052875SStuart Yoder                 - For interrupt-type 1 (error interrupt),
13152052875SStuart Yoder                   the type-specific cell contains the
13252052875SStuart Yoder                   bit number of the error interrupt in the
13352052875SStuart Yoder                   Error Interrupt Summary Register.
13452052875SStuart Yoder
13552052875SStuart YoderEXAMPLE 1
13652052875SStuart Yoder	/*
13752052875SStuart Yoder	 * mpic interrupt controller with 4 cells per specifier
13852052875SStuart Yoder	 */
13952052875SStuart Yoder	mpic: pic@40000 {
14052052875SStuart Yoder		compatible = "fsl,mpic";
14152052875SStuart Yoder		interrupt-controller;
14252052875SStuart Yoder		#interrupt-cells = <4>;
14352052875SStuart Yoder		#address-cells = <0>;
14452052875SStuart Yoder		reg = <0x40000 0x40000>;
14552052875SStuart Yoder	};
14652052875SStuart Yoder
14752052875SStuart YoderEXAMPLE 2
14852052875SStuart Yoder	/*
14952052875SStuart Yoder	 * The MPC8544 I2C controller node has an internal
15052052875SStuart Yoder	 * interrupt number of 27.  As per the reference manual
15152052875SStuart Yoder	 * this corresponds to interrupt source configuration
15252052875SStuart Yoder	 * registers at 0x5_0560.
15352052875SStuart Yoder	 *
15452052875SStuart Yoder	 * The interrupt source configuration registers begin
15552052875SStuart Yoder	 * at 0x5_0000.
15652052875SStuart Yoder	 *
15752052875SStuart Yoder	 * To compute the interrupt specifier interrupt number
15852052875SStuart Yoder         *
15952052875SStuart Yoder	 *       0x560 >> 5 = 43
16052052875SStuart Yoder	 *
16152052875SStuart Yoder	 * The interrupt source configuration registers begin
16252052875SStuart Yoder	 * at 0x5_0000, and so the i2c vector/priority registers
16352052875SStuart Yoder	 * are at 0x5_0560.
16452052875SStuart Yoder	 */
16552052875SStuart Yoder	i2c@3000 {
16652052875SStuart Yoder		#address-cells = <1>;
16752052875SStuart Yoder		#size-cells = <0>;
16852052875SStuart Yoder		cell-index = <0>;
16952052875SStuart Yoder		compatible = "fsl-i2c";
17052052875SStuart Yoder		reg = <0x3000 0x100>;
17152052875SStuart Yoder		interrupts = <43 2>;
17252052875SStuart Yoder		interrupt-parent = <&mpic>;
17352052875SStuart Yoder		dfsrr;
17452052875SStuart Yoder	};
17552052875SStuart Yoder
17652052875SStuart Yoder
17752052875SStuart YoderEXAMPLE 3
17852052875SStuart Yoder	/*
17952052875SStuart Yoder	 *  Definition of a node defining the 4
18052052875SStuart Yoder	 *  MPIC IPI interrupts.  Note the interrupt
18152052875SStuart Yoder	 *  type of 2.
18252052875SStuart Yoder	 */
18352052875SStuart Yoder	ipi@410a0 {
18452052875SStuart Yoder		compatible = "fsl,mpic-ipi";
18552052875SStuart Yoder		reg = <0x40040 0x10>;
18652052875SStuart Yoder		interrupts = <0 0 2 0
18752052875SStuart Yoder		              1 0 2 0
18852052875SStuart Yoder		              2 0 2 0
18952052875SStuart Yoder		              3 0 2 0>;
19052052875SStuart Yoder	};
19152052875SStuart Yoder
19252052875SStuart YoderEXAMPLE 4
19352052875SStuart Yoder	/*
19452052875SStuart Yoder	 *  Definition of a node defining the MPIC
19552052875SStuart Yoder	 *  global timers.  Note the interrupt
19652052875SStuart Yoder	 *  type of 3.
19752052875SStuart Yoder	 */
19852052875SStuart Yoder	timer0: timer@41100 {
19952052875SStuart Yoder		compatible = "fsl,mpic-global-timer";
200180076cbSScott Wood		reg = <0x41100 0x100 0x41300 4>;
20152052875SStuart Yoder		interrupts = <0 0 3 0
20252052875SStuart Yoder		              1 0 3 0
20352052875SStuart Yoder		              2 0 3 0
20452052875SStuart Yoder		              3 0 3 0>;
20552052875SStuart Yoder	};
20652052875SStuart Yoder
20752052875SStuart YoderEXAMPLE 5
20852052875SStuart Yoder	/*
20925985edcSLucas De Marchi	 * Definition of an error interrupt (interrupt type 1).
21052052875SStuart Yoder	 * SoC interrupt number is 16 and the specific error
21152052875SStuart Yoder         * interrupt bit in the error interrupt summary register
21252052875SStuart Yoder	 * is 23.
21352052875SStuart Yoder	 */
21452052875SStuart Yoder	memory-controller@8000 {
21552052875SStuart Yoder		compatible = "fsl,p4080-memory-controller";
21652052875SStuart Yoder		reg = <0x8000 0x1000>;
21752052875SStuart Yoder		interrupts = <16 2 1 23>;
21852052875SStuart Yoder	};
219