0012-Document-devicetree-add-OF-documents-for-MIPS-interr.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From dae867771332e7541783ebb6bacf33356ad449b3 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <[email protected]>
  3. Date: Thu, 31 Jan 2013 13:44:10 +0100
  4. Subject: [PATCH 12/79] Document: devicetree: add OF documents for MIPS
  5. interrupt controller
  6. Signed-off-by: John Crispin <[email protected]>
  7. Acked-by: David Daney <[email protected]>
  8. Patchwork: http://patchwork.linux-mips.org/patch/4901/
  9. ---
  10. Documentation/devicetree/bindings/mips/cpu_irq.txt | 47 ++++++++++++++++++++
  11. 1 file changed, 47 insertions(+)
  12. create mode 100644 Documentation/devicetree/bindings/mips/cpu_irq.txt
  13. diff --git a/Documentation/devicetree/bindings/mips/cpu_irq.txt b/Documentation/devicetree/bindings/mips/cpu_irq.txt
  14. new file mode 100644
  15. index 0000000..13aa4b6
  16. --- /dev/null
  17. +++ b/Documentation/devicetree/bindings/mips/cpu_irq.txt
  18. @@ -0,0 +1,47 @@
  19. +MIPS CPU interrupt controller
  20. +
  21. +On MIPS the mips_cpu_intc_init() helper can be used to initialize the 8 CPU
  22. +IRQs from a devicetree file and create a irq_domain for IRQ controller.
  23. +
  24. +With the irq_domain in place we can describe how the 8 IRQs are wired to the
  25. +platforms internal interrupt controller cascade.
  26. +
  27. +Below is an example of a platform describing the cascade inside the devicetree
  28. +and the code used to load it inside arch_init_irq().
  29. +
  30. +Required properties:
  31. +- compatible : Should be "mti,cpu-interrupt-controller"
  32. +
  33. +Example devicetree:
  34. + cpu-irq: cpu-irq@0 {
  35. + #address-cells = <0>;
  36. +
  37. + interrupt-controller;
  38. + #interrupt-cells = <1>;
  39. +
  40. + compatible = "mti,cpu-interrupt-controller";
  41. + };
  42. +
  43. + intc: intc@200 {
  44. + compatible = "ralink,rt2880-intc";
  45. + reg = <0x200 0x100>;
  46. +
  47. + interrupt-controller;
  48. + #interrupt-cells = <1>;
  49. +
  50. + interrupt-parent = <&cpu-irq>;
  51. + interrupts = <2>;
  52. + };
  53. +
  54. +
  55. +Example platform irq.c:
  56. +static struct of_device_id __initdata of_irq_ids[] = {
  57. + { .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_intc_init },
  58. + { .compatible = "ralink,rt2880-intc", .data = intc_of_init },
  59. + {},
  60. +};
  61. +
  62. +void __init arch_init_irq(void)
  63. +{
  64. + of_irq_init(of_irq_ids);
  65. +}
  66. --
  67. 1.7.10.4