brcm47xx: add vectored interrupts
[openwrt.git] / target / linux / brcm47xx / patches-3.10 / 110-MIPS-BCM47XX-add-vint-irq.patch
1 From d9e8fd334d85fc8e4a2867655309a60c8de80883 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Wed, 20 Nov 2013 23:03:35 +0100
4 Subject: [PATCH 18/18] bcm47xx: add cpu_has_vint
5
6 ---
7  arch/mips/bcm47xx/Kconfig |    1 +
8  arch/mips/bcm47xx/irq.c   |   24 ++++++++++++++++++++++++
9  2 files changed, 25 insertions(+)
10
11 --- a/arch/mips/bcm47xx/Kconfig
12 +++ b/arch/mips/bcm47xx/Kconfig
13 @@ -21,6 +21,7 @@ config BCM47XX_SSB
14  config BCM47XX_BCMA
15         bool "BCMA Support for Broadcom BCM47XX"
16         select SYS_HAS_CPU_MIPS32_R2
17 +       select CPU_MIPSR2_IRQ_VI
18         select BCMA
19         select BCMA_HOST_SOC
20         select BCMA_DRIVER_MIPS
21 --- a/arch/mips/bcm47xx/irq.c
22 +++ b/arch/mips/bcm47xx/irq.c
23 @@ -25,6 +25,7 @@
24  #include <linux/types.h>
25  #include <linux/interrupt.h>
26  #include <linux/irq.h>
27 +#include <asm/setup.h>
28  #include <asm/irq_cpu.h>
29  #include <bcm47xx.h>
30  
31 @@ -50,6 +51,18 @@ void plat_irq_dispatch(void)
32                 do_IRQ(6);
33  }
34  
35 +#define DEFINE_HWx_IRQDISPATCH(x)                                      \
36 +       static void bcm47xx_hw ## x ## _irqdispatch(void)               \
37 +       {                                                               \
38 +               do_IRQ(x);                                              \
39 +       }
40 +DEFINE_HWx_IRQDISPATCH(2)
41 +DEFINE_HWx_IRQDISPATCH(3)
42 +DEFINE_HWx_IRQDISPATCH(4)
43 +DEFINE_HWx_IRQDISPATCH(5)
44 +DEFINE_HWx_IRQDISPATCH(6)
45 +DEFINE_HWx_IRQDISPATCH(7)
46 +
47  void __init arch_init_irq(void)
48  {
49  #ifdef CONFIG_BCM47XX_BCMA
50 @@ -63,5 +76,16 @@ void __init arch_init_irq(void)
51                 cp0_compare_irq = 7;
52         }
53  #endif
54 +
55         mips_cpu_irq_init();
56 +
57 +       if (cpu_has_vint) {
58 +               pr_info("Setting up vectored interrupts\n");
59 +               set_vi_handler(2, bcm47xx_hw2_irqdispatch);
60 +               set_vi_handler(3, bcm47xx_hw3_irqdispatch);
61 +               set_vi_handler(4, bcm47xx_hw4_irqdispatch);
62 +               set_vi_handler(5, bcm47xx_hw5_irqdispatch);
63 +               set_vi_handler(6, bcm47xx_hw6_irqdispatch);
64 +               set_vi_handler(7, bcm47xx_hw7_irqdispatch);
65 +       }
66  }