18c2ecf20Sopenharmony_ciBroadcom BCM7120-style Level 2 interrupt controller
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThis interrupt controller hardware is a second level interrupt controller that
48c2ecf20Sopenharmony_ciis hooked to a parent interrupt controller: e.g: ARM GIC for ARM-based
58c2ecf20Sopenharmony_ciplatforms. It can be found on BCM7xxx products starting with BCM7120.
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciSuch an interrupt controller has the following hardware design:
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci- outputs multiple interrupts signals towards its interrupt controller parent
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci- controls how some of the interrupts will be flowing, whether they will
128c2ecf20Sopenharmony_ci  directly output an interrupt signal towards the interrupt controller parent,
138c2ecf20Sopenharmony_ci  or if they will output an interrupt signal at this 2nd level interrupt
148c2ecf20Sopenharmony_ci  controller, in particular for UARTs
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci- has one 32-bit enable word and one 32-bit status word
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci- no atomic set/clear operations
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci- not all bits within the interrupt controller actually map to an interrupt
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciThe typical hardware layout for this controller is represented below:
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci2nd level interrupt line		Outputs for the parent controller (e.g: ARM GIC)
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci0 -----[ MUX ] ------------|==========> GIC interrupt 75
278c2ecf20Sopenharmony_ci          \-----------\
288c2ecf20Sopenharmony_ci                       |
298c2ecf20Sopenharmony_ci1 -----[ MUX ] --------)---|==========> GIC interrupt 76
308c2ecf20Sopenharmony_ci          \------------|
318c2ecf20Sopenharmony_ci                       |
328c2ecf20Sopenharmony_ci2 -----[ MUX ] --------)---|==========> GIC interrupt 77
338c2ecf20Sopenharmony_ci          \------------|
348c2ecf20Sopenharmony_ci                       |
358c2ecf20Sopenharmony_ci3 ---------------------|
368c2ecf20Sopenharmony_ci4 ---------------------|
378c2ecf20Sopenharmony_ci5 ---------------------|
388c2ecf20Sopenharmony_ci7 ---------------------|---|===========> GIC interrupt 66
398c2ecf20Sopenharmony_ci9 ---------------------|
408c2ecf20Sopenharmony_ci10 --------------------|
418c2ecf20Sopenharmony_ci11 --------------------/
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci6 ------------------------\
448c2ecf20Sopenharmony_ci                           |===========> GIC interrupt 64
458c2ecf20Sopenharmony_ci8 ------------------------/
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci12 ........................ X
488c2ecf20Sopenharmony_ci13 ........................ X 		(not connected)
498c2ecf20Sopenharmony_ci..
508c2ecf20Sopenharmony_ci31 ........................ X
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciRequired properties:
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci- compatible: should be "brcm,bcm7120-l2-intc"
558c2ecf20Sopenharmony_ci- reg: specifies the base physical address and size of the registers
568c2ecf20Sopenharmony_ci- interrupt-controller: identifies the node as an interrupt controller
578c2ecf20Sopenharmony_ci- #interrupt-cells: specifies the number of cells needed to encode an interrupt
588c2ecf20Sopenharmony_ci  source, should be 1.
598c2ecf20Sopenharmony_ci- interrupts: specifies the interrupt line(s) in the interrupt-parent controller
608c2ecf20Sopenharmony_ci  node, valid values depend on the type of parent interrupt controller
618c2ecf20Sopenharmony_ci- brcm,int-map-mask: 32-bits bit mask describing how many and which interrupts
628c2ecf20Sopenharmony_ci  are wired to this 2nd level interrupt controller, and how they match their
638c2ecf20Sopenharmony_ci  respective interrupt parents. Should match exactly the number of interrupts
648c2ecf20Sopenharmony_ci  specified in the 'interrupts' property.
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ciOptional properties:
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci- brcm,irq-can-wake: if present, this means the L2 controller can be used as a
698c2ecf20Sopenharmony_ci  wakeup source for system suspend/resume.
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci- brcm,int-fwd-mask: if present, a bit mask to configure the interrupts which
728c2ecf20Sopenharmony_ci  have a mux gate, typically UARTs. Setting these bits will make their
738c2ecf20Sopenharmony_ci  respective interrupt outputs bypass this 2nd level interrupt controller
748c2ecf20Sopenharmony_ci  completely; it is completely transparent for the interrupt controller
758c2ecf20Sopenharmony_ci  parent. This should have one 32-bit word per enable/status pair.
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ciExample:
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ciirq0_intc: interrupt-controller@f0406800 {
808c2ecf20Sopenharmony_ci	compatible = "brcm,bcm7120-l2-intc";
818c2ecf20Sopenharmony_ci	interrupt-parent = <&intc>;
828c2ecf20Sopenharmony_ci	#interrupt-cells = <1>;
838c2ecf20Sopenharmony_ci	reg = <0xf0406800 0x8>;
848c2ecf20Sopenharmony_ci	interrupt-controller;
858c2ecf20Sopenharmony_ci	interrupts = <0x0 0x42 0x0>, <0x0 0x40 0x0>;
868c2ecf20Sopenharmony_ci	brcm,int-map-mask = <0xeb8>, <0x140>;
878c2ecf20Sopenharmony_ci	brcm,int-fwd-mask = <0x7>;
888c2ecf20Sopenharmony_ci};
89