brcm63xx: fix a few issues in irq chip drivers
[15.05/openwrt.git] / target / linux / brcm63xx / patches-3.14 / 373-MIPS-BCM63XX-register-interrupt-controllers-through-.patch
1 From 40c0e6e4f68ce0c759eb216b44cdfbe18de328b0 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Mon, 1 Dec 2014 00:20:07 +0100
4 Subject: [PATCH 5/5] MIPS: BCM63XX: register interrupt controllers through DT
5
6 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
7 ---
8  arch/mips/bcm63xx/irq.c |   12 +++++++++++-
9  1 file changed, 11 insertions(+), 1 deletion(-)
10
11 --- a/arch/mips/bcm63xx/irq.c
12 +++ b/arch/mips/bcm63xx/irq.c
13 @@ -15,6 +15,8 @@
14  #include <linux/irqchip.h>
15  #include <linux/irqchip/irq-bcm6345-ext.h>
16  #include <linux/irqchip/irq-bcm6345-periph.h>
17 +#include <linux/of.h>
18 +#include <linux/of_fdt.h>
19  #include <asm/irq_cpu.h>
20  #include <asm/mipsregs.h>
21  #include <bcm63xx_cpu.h>
22 @@ -189,7 +191,17 @@ static void bcm63xx_init_irq(void)
23                                       ext_shift);
24  }
25  
26 +static const struct of_device_id irqchip_of_match_mips_cpu_intc __used __section(__irqchip_of_table) = {
27 +       .compatible = "mti,cpu-interrupt-controller",
28 +       .data = mips_cpu_irq_of_init,
29 +};
30 +
31  void __init arch_init_irq(void)
32  {
33 -       bcm63xx_init_irq();
34 +#ifdef CONFIG_OF
35 +       if (initial_boot_params)
36 +               irqchip_init();
37 +       else
38 +#endif
39 +               bcm63xx_init_irq();
40  }