18c2ecf20Sopenharmony_ci* Open PIC Binding
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThis binding specifies what properties must be available in the device tree
48c2ecf20Sopenharmony_cirepresentation of an Open PIC compliant interrupt controller.  This binding is
58c2ecf20Sopenharmony_cibased on the binding defined for Open PIC in [1] and is a superset of that
68c2ecf20Sopenharmony_cibinding.
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciRequired properties:
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci  NOTE: Many of these descriptions were paraphrased here from [1] to aid
118c2ecf20Sopenharmony_ci        readability.
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci    - compatible: Specifies the compatibility list for the PIC.  The type
148c2ecf20Sopenharmony_ci      shall be <string> and the value shall include "open-pic".
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci    - reg: Specifies the base physical address(s) and size(s) of this
178c2ecf20Sopenharmony_ci      PIC's addressable register space.  The type shall be <prop-encoded-array>.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci    - interrupt-controller: The presence of this property identifies the node
208c2ecf20Sopenharmony_ci      as an Open PIC.  No property value shall be defined.
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci    - #interrupt-cells: Specifies the number of cells needed to encode an
238c2ecf20Sopenharmony_ci      interrupt source.  The type shall be a <u32> and the value shall be 2.
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci    - #address-cells: Specifies the number of cells needed to encode an
268c2ecf20Sopenharmony_ci      address.  The type shall be <u32> and the value shall be 0.  As such,
278c2ecf20Sopenharmony_ci      'interrupt-map' nodes do not have to specify a parent unit address.
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciOptional properties:
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci    - pic-no-reset: The presence of this property indicates that the PIC
328c2ecf20Sopenharmony_ci      shall not be reset during runtime initialization.  No property value shall
338c2ecf20Sopenharmony_ci      be defined.  The presence of this property also mandates that any
348c2ecf20Sopenharmony_ci      initialization related to interrupt sources shall be limited to sources
358c2ecf20Sopenharmony_ci      explicitly referenced in the device tree.
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci* Interrupt Specifier Definition
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci  Interrupt specifiers consists of 2 cells encoded as
408c2ecf20Sopenharmony_ci  follows:
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci    - <1st-cell>: The interrupt-number that identifies the interrupt source.
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci    - <2nd-cell>: The level-sense information, encoded as follows:
458c2ecf20Sopenharmony_ci                    0 = low-to-high edge triggered
468c2ecf20Sopenharmony_ci                    1 = active low level-sensitive
478c2ecf20Sopenharmony_ci                    2 = active high level-sensitive
488c2ecf20Sopenharmony_ci                    3 = high-to-low edge triggered
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci* Examples
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciExample 1:
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci	/*
558c2ecf20Sopenharmony_ci	 * An Open PIC interrupt controller
568c2ecf20Sopenharmony_ci	 */
578c2ecf20Sopenharmony_ci	mpic: pic@40000 {
588c2ecf20Sopenharmony_ci		// This is an interrupt controller node.
598c2ecf20Sopenharmony_ci		interrupt-controller;
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci		// No address cells so that 'interrupt-map' nodes which reference
628c2ecf20Sopenharmony_ci		// this Open PIC node do not need a parent address specifier.
638c2ecf20Sopenharmony_ci		#address-cells = <0>;
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci		// Two cells to encode interrupt sources.
668c2ecf20Sopenharmony_ci		#interrupt-cells = <2>;
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci		// Offset address of 0x40000 and size of 0x40000.
698c2ecf20Sopenharmony_ci		reg = <0x40000 0x40000>;
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci		// Compatible with Open PIC.
728c2ecf20Sopenharmony_ci		compatible = "open-pic";
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci		// The PIC shall not be reset.
758c2ecf20Sopenharmony_ci		pic-no-reset;
768c2ecf20Sopenharmony_ci	};
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ciExample 2:
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci	/*
818c2ecf20Sopenharmony_ci	 * An interrupt generating device that is wired to an Open PIC.
828c2ecf20Sopenharmony_ci	 */
838c2ecf20Sopenharmony_ci	serial0: serial@4500 {
848c2ecf20Sopenharmony_ci		// Interrupt source '42' that is active high level-sensitive.
858c2ecf20Sopenharmony_ci		// Note that there are only two cells as specified in the interrupt
868c2ecf20Sopenharmony_ci		// parent's '#interrupt-cells' property.
878c2ecf20Sopenharmony_ci		interrupts = <42 2>;
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci		// The interrupt controller that this device is wired to.
908c2ecf20Sopenharmony_ci		interrupt-parent = <&mpic>;
918c2ecf20Sopenharmony_ci	};
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci* References
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci[1] Devicetree Specification
968c2ecf20Sopenharmony_ci    (https://www.devicetree.org/specifications/)
978c2ecf20Sopenharmony_ci
98