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