18c2ecf20Sopenharmony_ci* SPEAr Shared IRQ layer (shirq)
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciSPEAr3xx architecture includes shared/multiplexed irqs for certain set
48c2ecf20Sopenharmony_ciof devices. The multiplexor provides a single interrupt to parent
58c2ecf20Sopenharmony_ciinterrupt controller (VIC) on behalf of a group of devices.
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciThere can be multiple groups available on SPEAr3xx variants but not
88c2ecf20Sopenharmony_ciexceeding 4. The number of devices in a group can differ, further they
98c2ecf20Sopenharmony_cimay share same set of status/mask registers spanning across different
108c2ecf20Sopenharmony_cibit masks. Also in some cases the group may not have enable or other
118c2ecf20Sopenharmony_ciregisters. This makes software little complex.
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciA single node in the device tree is used to describe the shared
148c2ecf20Sopenharmony_ciinterrupt multiplexor (one node for all groups). A group in the
158c2ecf20Sopenharmony_ciinterrupt controller shares config/control registers with other groups.
168c2ecf20Sopenharmony_ciFor example, a 32-bit interrupt enable/disable config register can
178c2ecf20Sopenharmony_ciaccommodate up to 4 interrupt groups.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciRequired properties:
208c2ecf20Sopenharmony_ci  - compatible: should be, either of
218c2ecf20Sopenharmony_ci     - "st,spear300-shirq"
228c2ecf20Sopenharmony_ci     - "st,spear310-shirq"
238c2ecf20Sopenharmony_ci     - "st,spear320-shirq"
248c2ecf20Sopenharmony_ci  - interrupt-controller: Identifies the node as an interrupt controller.
258c2ecf20Sopenharmony_ci  - #interrupt-cells: should be <1> which basically contains the offset
268c2ecf20Sopenharmony_ci    (starting from 0) of interrupts for all the groups.
278c2ecf20Sopenharmony_ci  - reg: Base address and size of shirq registers.
288c2ecf20Sopenharmony_ci  - interrupts: The list of interrupts generated by the groups which are
298c2ecf20Sopenharmony_ci    then connected to a parent interrupt controller. Each group is
308c2ecf20Sopenharmony_ci    associated with one of the interrupts, hence number of interrupts (to
318c2ecf20Sopenharmony_ci    parent) is equal to number of groups. The format of the interrupt
328c2ecf20Sopenharmony_ci    specifier depends in the interrupt parent controller.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciExample:
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciThe following is an example from the SPEAr320 SoC dtsi file.
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_cishirq: interrupt-controller@b3000000 {
398c2ecf20Sopenharmony_ci	compatible = "st,spear320-shirq";
408c2ecf20Sopenharmony_ci	reg = <0xb3000000 0x1000>;
418c2ecf20Sopenharmony_ci	interrupts = <28 29 30 1>;
428c2ecf20Sopenharmony_ci	#interrupt-cells = <1>;
438c2ecf20Sopenharmony_ci	interrupt-controller;
448c2ecf20Sopenharmony_ci};
45