cns3xxx: add linux 3.8 support and use it by default
[openwrt/svn-archive/archive.git] / target / linux / cns3xxx / patches-3.8 / 045-twd_base.patch
1 --- a/arch/arm/mach-cns3xxx/core.c
2 +++ b/arch/arm/mach-cns3xxx/core.c
3 @@ -19,6 +19,7 @@
4 #include <asm/mach/time.h>
5 #include <asm/mach/irq.h>
6 #include <asm/hardware/gic.h>
7 +#include <asm/smp_twd.h>
8 #include <asm/hardware/cache-l2x0.h>
9 #include <mach/cns3xxx.h>
10 #include "core.h"
11 @@ -187,6 +188,17 @@ static struct irqaction cns3xxx_timer_ir
12 .handler = cns3xxx_timer_interrupt,
13 };
14
15 +static void __init cns3xxx_init_twd(void)
16 +{
17 +#ifdef CONFIG_LOCAL_TIMERS
18 + static DEFINE_TWD_LOCAL_TIMER(cns3xx_twd_local_timer,
19 + CNS3XXX_TC11MP_TWD_BASE,
20 + IRQ_LOCALTIMER);
21 +
22 + twd_local_timer_register(&cns3xx_twd_local_timer);
23 +#endif
24 +}
25 +
26 /*
27 * Set up the clock source and clock events devices
28 */
29 @@ -240,6 +252,7 @@ static void __init __cns3xxx_timer_init(
30 setup_irq(timer_irq, &cns3xxx_timer_irq);
31
32 cns3xxx_clockevents_init(timer_irq);
33 + cns3xxx_init_twd();
34 }
35
36 static void __init cns3xxx_timer_init(void)