856733ad3b12e1af27aa23769308183465b10726
[openwrt/openwrt.git] / target / linux / lantiq / patches-3.14 / 0037-MIPS-lantiq-move-eiu-init-after-irq_domain-register.patch
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
6 Signed-off-by: John Crispin <blogic@openwrt.org>
7 ---
8 arch/mips/lantiq/irq.c | 48 ++++++++++++++++++++++++------------------------
9 1 file changed, 24 insertions(+), 24 deletions(-)
10
11 diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c
12 index 6b94cc7..3bbedf6 100644
13 --- a/arch/mips/lantiq/irq.c
14 +++ b/arch/mips/lantiq/irq.c
15 @@ -380,30 +380,6 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
16 panic("Failed to remap icu memory");
17 }
18
19 - /* the external interrupts are optional and xway only */
20 - eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway");
21 - if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
22 - /* find out how many external irq sources we have */
23 - exin_avail = of_irq_count(eiu_node);
24 -
25 - if (exin_avail > MAX_EIU)
26 - exin_avail = MAX_EIU;
27 -
28 - ret = of_irq_to_resource_table(eiu_node,
29 - ltq_eiu_irq, exin_avail);
30 - if (ret != exin_avail)
31 - panic("failed to load external irq resources");
32 -
33 - if (request_mem_region(res.start, resource_size(&res),
34 - res.name) < 0)
35 - pr_err("Failed to request eiu memory");
36 -
37 - ltq_eiu_membase = ioremap_nocache(res.start,
38 - resource_size(&res));
39 - if (!ltq_eiu_membase)
40 - panic("Failed to remap eiu memory");
41 - }
42 -
43 /* turn off all irqs by default */
44 for (i = 0; i < MAX_IM; i++) {
45 /* make sure all irqs are turned off by default */
46 @@ -460,6 +436,30 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
47 if (MIPS_CPU_TIMER_IRQ != 7)
48 irq_create_mapping(ltq_domain, MIPS_CPU_TIMER_IRQ);
49
50 + /* the external interrupts are optional and xway only */
51 + eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway");
52 + if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
53 + /* find out how many external irq sources we have */
54 + exin_avail = of_irq_count(eiu_node);
55 +
56 + if (exin_avail > MAX_EIU)
57 + exin_avail = MAX_EIU;
58 +
59 + ret = of_irq_to_resource_table(eiu_node,
60 + ltq_eiu_irq, exin_avail);
61 + if (ret != exin_avail)
62 + panic("failed to load external irq resources");
63 +
64 + if (request_mem_region(res.start, resource_size(&res),
65 + res.name) < 0)
66 + pr_err("Failed to request eiu memory");
67 +
68 + ltq_eiu_membase = ioremap_nocache(res.start,
69 + resource_size(&res));
70 + if (!ltq_eiu_membase)
71 + panic("Failed to remap eiu memory");
72 + }
73 +
74 return 0;
75 }
76
77 --
78 1.7.10.4
79