xref: /freebsd-src/sys/contrib/device-tree/Bindings/interrupt-controller/open-pic.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Open PIC Binding
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotThis binding specifies what properties must be available in the device tree
4*c66ec88fSEmmanuel Vadotrepresentation of an Open PIC compliant interrupt controller.  This binding is
5*c66ec88fSEmmanuel Vadotbased on the binding defined for Open PIC in [1] and is a superset of that
6*c66ec88fSEmmanuel Vadotbinding.
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel VadotRequired properties:
9*c66ec88fSEmmanuel Vadot
10*c66ec88fSEmmanuel Vadot  NOTE: Many of these descriptions were paraphrased here from [1] to aid
11*c66ec88fSEmmanuel Vadot        readability.
12*c66ec88fSEmmanuel Vadot
13*c66ec88fSEmmanuel Vadot    - compatible: Specifies the compatibility list for the PIC.  The type
14*c66ec88fSEmmanuel Vadot      shall be <string> and the value shall include "open-pic".
15*c66ec88fSEmmanuel Vadot
16*c66ec88fSEmmanuel Vadot    - reg: Specifies the base physical address(s) and size(s) of this
17*c66ec88fSEmmanuel Vadot      PIC's addressable register space.  The type shall be <prop-encoded-array>.
18*c66ec88fSEmmanuel Vadot
19*c66ec88fSEmmanuel Vadot    - interrupt-controller: The presence of this property identifies the node
20*c66ec88fSEmmanuel Vadot      as an Open PIC.  No property value shall be defined.
21*c66ec88fSEmmanuel Vadot
22*c66ec88fSEmmanuel Vadot    - #interrupt-cells: Specifies the number of cells needed to encode an
23*c66ec88fSEmmanuel Vadot      interrupt source.  The type shall be a <u32> and the value shall be 2.
24*c66ec88fSEmmanuel Vadot
25*c66ec88fSEmmanuel Vadot    - #address-cells: Specifies the number of cells needed to encode an
26*c66ec88fSEmmanuel Vadot      address.  The type shall be <u32> and the value shall be 0.  As such,
27*c66ec88fSEmmanuel Vadot      'interrupt-map' nodes do not have to specify a parent unit address.
28*c66ec88fSEmmanuel Vadot
29*c66ec88fSEmmanuel VadotOptional properties:
30*c66ec88fSEmmanuel Vadot
31*c66ec88fSEmmanuel Vadot    - pic-no-reset: The presence of this property indicates that the PIC
32*c66ec88fSEmmanuel Vadot      shall not be reset during runtime initialization.  No property value shall
33*c66ec88fSEmmanuel Vadot      be defined.  The presence of this property also mandates that any
34*c66ec88fSEmmanuel Vadot      initialization related to interrupt sources shall be limited to sources
35*c66ec88fSEmmanuel Vadot      explicitly referenced in the device tree.
36*c66ec88fSEmmanuel Vadot
37*c66ec88fSEmmanuel Vadot* Interrupt Specifier Definition
38*c66ec88fSEmmanuel Vadot
39*c66ec88fSEmmanuel Vadot  Interrupt specifiers consists of 2 cells encoded as
40*c66ec88fSEmmanuel Vadot  follows:
41*c66ec88fSEmmanuel Vadot
42*c66ec88fSEmmanuel Vadot    - <1st-cell>: The interrupt-number that identifies the interrupt source.
43*c66ec88fSEmmanuel Vadot
44*c66ec88fSEmmanuel Vadot    - <2nd-cell>: The level-sense information, encoded as follows:
45*c66ec88fSEmmanuel Vadot                    0 = low-to-high edge triggered
46*c66ec88fSEmmanuel Vadot                    1 = active low level-sensitive
47*c66ec88fSEmmanuel Vadot                    2 = active high level-sensitive
48*c66ec88fSEmmanuel Vadot                    3 = high-to-low edge triggered
49*c66ec88fSEmmanuel Vadot
50*c66ec88fSEmmanuel Vadot* Examples
51*c66ec88fSEmmanuel Vadot
52*c66ec88fSEmmanuel VadotExample 1:
53*c66ec88fSEmmanuel Vadot
54*c66ec88fSEmmanuel Vadot	/*
55*c66ec88fSEmmanuel Vadot	 * An Open PIC interrupt controller
56*c66ec88fSEmmanuel Vadot	 */
57*c66ec88fSEmmanuel Vadot	mpic: pic@40000 {
58*c66ec88fSEmmanuel Vadot		// This is an interrupt controller node.
59*c66ec88fSEmmanuel Vadot		interrupt-controller;
60*c66ec88fSEmmanuel Vadot
61*c66ec88fSEmmanuel Vadot		// No address cells so that 'interrupt-map' nodes which reference
62*c66ec88fSEmmanuel Vadot		// this Open PIC node do not need a parent address specifier.
63*c66ec88fSEmmanuel Vadot		#address-cells = <0>;
64*c66ec88fSEmmanuel Vadot
65*c66ec88fSEmmanuel Vadot		// Two cells to encode interrupt sources.
66*c66ec88fSEmmanuel Vadot		#interrupt-cells = <2>;
67*c66ec88fSEmmanuel Vadot
68*c66ec88fSEmmanuel Vadot		// Offset address of 0x40000 and size of 0x40000.
69*c66ec88fSEmmanuel Vadot		reg = <0x40000 0x40000>;
70*c66ec88fSEmmanuel Vadot
71*c66ec88fSEmmanuel Vadot		// Compatible with Open PIC.
72*c66ec88fSEmmanuel Vadot		compatible = "open-pic";
73*c66ec88fSEmmanuel Vadot
74*c66ec88fSEmmanuel Vadot		// The PIC shall not be reset.
75*c66ec88fSEmmanuel Vadot		pic-no-reset;
76*c66ec88fSEmmanuel Vadot	};
77*c66ec88fSEmmanuel Vadot
78*c66ec88fSEmmanuel VadotExample 2:
79*c66ec88fSEmmanuel Vadot
80*c66ec88fSEmmanuel Vadot	/*
81*c66ec88fSEmmanuel Vadot	 * An interrupt generating device that is wired to an Open PIC.
82*c66ec88fSEmmanuel Vadot	 */
83*c66ec88fSEmmanuel Vadot	serial0: serial@4500 {
84*c66ec88fSEmmanuel Vadot		// Interrupt source '42' that is active high level-sensitive.
85*c66ec88fSEmmanuel Vadot		// Note that there are only two cells as specified in the interrupt
86*c66ec88fSEmmanuel Vadot		// parent's '#interrupt-cells' property.
87*c66ec88fSEmmanuel Vadot		interrupts = <42 2>;
88*c66ec88fSEmmanuel Vadot
89*c66ec88fSEmmanuel Vadot		// The interrupt controller that this device is wired to.
90*c66ec88fSEmmanuel Vadot		interrupt-parent = <&mpic>;
91*c66ec88fSEmmanuel Vadot	};
92*c66ec88fSEmmanuel Vadot
93*c66ec88fSEmmanuel Vadot* References
94*c66ec88fSEmmanuel Vadot
95*c66ec88fSEmmanuel Vadot[1] Devicetree Specification
96*c66ec88fSEmmanuel Vadot    (https://www.devicetree.org/specifications/)
97*c66ec88fSEmmanuel Vadot
98