au1000: drop 3.14 support
[openwrt/openwrt.git] / target / linux / cns3xxx / patches-3.14 / 045-twd_base.patch
1 --- a/arch/arm/mach-cns3xxx/core.c
2 +++ b/arch/arm/mach-cns3xxx/core.c
3 @@ -17,6 +17,7 @@
4 #include <linux/platform_device.h>
5 #include <linux/usb/ehci_pdriver.h>
6 #include <linux/usb/ohci_pdriver.h>
7 +#include <asm/smp_twd.h>
8 #include <asm/mach/arch.h>
9 #include <asm/mach/map.h>
10 #include <asm/mach/time.h>
11 @@ -26,6 +27,8 @@
12 #include "core.h"
13 #include "pm.h"
14
15 +#define IRQ_LOCALTIMER 29
16 +
17 static struct map_desc cns3xxx_io_desc[] __initdata = {
18 {
19 .virtual = CNS3XXX_TC11MP_SCU_BASE_VIRT,
20 @@ -159,6 +162,17 @@ static struct irqaction cns3xxx_timer_ir
21 .handler = cns3xxx_timer_interrupt,
22 };
23
24 +static void __init cns3xxx_init_twd(void)
25 +{
26 +#ifdef CONFIG_LOCAL_TIMERS
27 + static DEFINE_TWD_LOCAL_TIMER(cns3xx_twd_local_timer,
28 + CNS3XXX_TC11MP_TWD_BASE,
29 + IRQ_LOCALTIMER);
30 +
31 + twd_local_timer_register(&cns3xx_twd_local_timer);
32 +#endif
33 +}
34 +
35 /*
36 * Set up the clock source and clock events devices
37 */
38 @@ -212,6 +226,7 @@ static void __init __cns3xxx_timer_init(
39 setup_irq(timer_irq, &cns3xxx_timer_irq);
40
41 cns3xxx_clockevents_init(timer_irq);
42 + cns3xxx_init_twd();
43 }
44
45 void __init cns3xxx_timer_init(void)