1*c66ec88fSEmmanuel VadotMIPS CPU interrupt controller 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotOn MIPS the mips_cpu_irq_of_init() helper can be used to initialize the 8 CPU 4*c66ec88fSEmmanuel VadotIRQs from a devicetree file and create a irq_domain for IRQ controller. 5*c66ec88fSEmmanuel Vadot 6*c66ec88fSEmmanuel VadotWith the irq_domain in place we can describe how the 8 IRQs are wired to the 7*c66ec88fSEmmanuel Vadotplatforms internal interrupt controller cascade. 8*c66ec88fSEmmanuel Vadot 9*c66ec88fSEmmanuel VadotBelow is an example of a platform describing the cascade inside the devicetree 10*c66ec88fSEmmanuel Vadotand the code used to load it inside arch_init_irq(). 11*c66ec88fSEmmanuel Vadot 12*c66ec88fSEmmanuel VadotRequired properties: 13*c66ec88fSEmmanuel Vadot- compatible : Should be "mti,cpu-interrupt-controller" 14*c66ec88fSEmmanuel Vadot 15*c66ec88fSEmmanuel VadotExample devicetree: 16*c66ec88fSEmmanuel Vadot cpu-irq: cpu-irq { 17*c66ec88fSEmmanuel Vadot #address-cells = <0>; 18*c66ec88fSEmmanuel Vadot 19*c66ec88fSEmmanuel Vadot interrupt-controller; 20*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 21*c66ec88fSEmmanuel Vadot 22*c66ec88fSEmmanuel Vadot compatible = "mti,cpu-interrupt-controller"; 23*c66ec88fSEmmanuel Vadot }; 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel Vadot intc: intc@200 { 26*c66ec88fSEmmanuel Vadot compatible = "ralink,rt2880-intc"; 27*c66ec88fSEmmanuel Vadot reg = <0x200 0x100>; 28*c66ec88fSEmmanuel Vadot 29*c66ec88fSEmmanuel Vadot interrupt-controller; 30*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 31*c66ec88fSEmmanuel Vadot 32*c66ec88fSEmmanuel Vadot interrupt-parent = <&cpu-irq>; 33*c66ec88fSEmmanuel Vadot interrupts = <2>; 34*c66ec88fSEmmanuel Vadot }; 35*c66ec88fSEmmanuel Vadot 36*c66ec88fSEmmanuel Vadot 37*c66ec88fSEmmanuel VadotExample platform irq.c: 38*c66ec88fSEmmanuel Vadotstatic struct of_device_id __initdata of_irq_ids[] = { 39*c66ec88fSEmmanuel Vadot { .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_irq_of_init }, 40*c66ec88fSEmmanuel Vadot { .compatible = "ralink,rt2880-intc", .data = intc_of_init }, 41*c66ec88fSEmmanuel Vadot {}, 42*c66ec88fSEmmanuel Vadot}; 43*c66ec88fSEmmanuel Vadot 44*c66ec88fSEmmanuel Vadotvoid __init arch_init_irq(void) 45*c66ec88fSEmmanuel Vadot{ 46*c66ec88fSEmmanuel Vadot of_irq_init(of_irq_ids); 47*c66ec88fSEmmanuel Vadot} 48