0037-MIPS-lantiq-move-eiu-init-after-irq_domain-register.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From baea71233ed1796651cab6ead484a18666a765aa Mon Sep 17 00:00:00 2001
  2. From: John Crispin <blogic@openwrt.org>
  3. Date: Thu, 11 Sep 2014 19:25:25 +0200
  4. Subject: [PATCH] MIPS: lantiq: move eiu init after irq_domain register
  5. Signed-off-by: John Crispin <blogic@openwrt.org>
  6. ---
  7. arch/mips/lantiq/irq.c | 48 ++++++++++++++++++++++++------------------------
  8. 1 file changed, 24 insertions(+), 24 deletions(-)
  9. --- a/arch/mips/lantiq/irq.c
  10. +++ b/arch/mips/lantiq/irq.c
  11. @@ -380,30 +380,6 @@ int __init icu_of_init(struct device_nod
  12. panic("Failed to remap icu memory");
  13. }
  14. - /* the external interrupts are optional and xway only */
  15. - eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway");
  16. - if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
  17. - /* find out how many external irq sources we have */
  18. - exin_avail = of_irq_count(eiu_node);
  19. -
  20. - if (exin_avail > MAX_EIU)
  21. - exin_avail = MAX_EIU;
  22. -
  23. - ret = of_irq_to_resource_table(eiu_node,
  24. - ltq_eiu_irq, exin_avail);
  25. - if (ret != exin_avail)
  26. - panic("failed to load external irq resources");
  27. -
  28. - if (request_mem_region(res.start, resource_size(&res),
  29. - res.name) < 0)
  30. - pr_err("Failed to request eiu memory");
  31. -
  32. - ltq_eiu_membase = ioremap_nocache(res.start,
  33. - resource_size(&res));
  34. - if (!ltq_eiu_membase)
  35. - panic("Failed to remap eiu memory");
  36. - }
  37. -
  38. /* turn off all irqs by default */
  39. for (i = 0; i < MAX_IM; i++) {
  40. /* make sure all irqs are turned off by default */
  41. @@ -460,6 +436,30 @@ int __init icu_of_init(struct device_nod
  42. if (MIPS_CPU_TIMER_IRQ != 7)
  43. irq_create_mapping(ltq_domain, MIPS_CPU_TIMER_IRQ);
  44. + /* the external interrupts are optional and xway only */
  45. + eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway");
  46. + if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
  47. + /* find out how many external irq sources we have */
  48. + exin_avail = of_irq_count(eiu_node);
  49. +
  50. + if (exin_avail > MAX_EIU)
  51. + exin_avail = MAX_EIU;
  52. +
  53. + ret = of_irq_to_resource_table(eiu_node,
  54. + ltq_eiu_irq, exin_avail);
  55. + if (ret != exin_avail)
  56. + panic("failed to load external irq resources");
  57. +
  58. + if (request_mem_region(res.start, resource_size(&res),
  59. + res.name) < 0)
  60. + pr_err("Failed to request eiu memory");
  61. +
  62. + ltq_eiu_membase = ioremap_nocache(res.start,
  63. + resource_size(&res));
  64. + if (!ltq_eiu_membase)
  65. + panic("Failed to remap eiu memory");
  66. + }
  67. +
  68. return 0;
  69. }