cpu_irq.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. MIPS CPU interrupt controller
  2. On MIPS the mips_cpu_irq_of_init() helper can be used to initialize the 8 CPU
  3. IRQs from a devicetree file and create a irq_domain for IRQ controller.
  4. With the irq_domain in place we can describe how the 8 IRQs are wired to the
  5. platforms internal interrupt controller cascade.
  6. Below is an example of a platform describing the cascade inside the devicetree
  7. and the code used to load it inside arch_init_irq().
  8. Required properties:
  9. - compatible : Should be "mti,cpu-interrupt-controller"
  10. Example devicetree:
  11. cpu-irq: cpu-irq {
  12. #address-cells = <0>;
  13. interrupt-controller;
  14. #interrupt-cells = <1>;
  15. compatible = "mti,cpu-interrupt-controller";
  16. };
  17. intc: intc@200 {
  18. compatible = "ralink,rt2880-intc";
  19. reg = <0x200 0x100>;
  20. interrupt-controller;
  21. #interrupt-cells = <1>;
  22. interrupt-parent = <&cpu-irq>;
  23. interrupts = <2>;
  24. };
  25. Example platform irq.c:
  26. static struct of_device_id __initdata of_irq_ids[] = {
  27. { .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_irq_of_init },
  28. { .compatible = "ralink,rt2880-intc", .data = intc_of_init },
  29. {},
  30. };
  31. void __init arch_init_irq(void)
  32. {
  33. of_irq_init(of_irq_ids);
  34. }