cns3xxx: update to linux 4.4
[openwrt/openwrt.git] / target / linux / cns3xxx / patches-4.4 / 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 @@ -198,6 +201,15 @@ static struct irqaction cns3xxx_timer_ir
21 .handler = cns3xxx_timer_interrupt,
22 };
23
24 +static void __init cns3xxx_init_twd(void)
25 +{
26 + static DEFINE_TWD_LOCAL_TIMER(cns3xx_twd_local_timer,
27 + CNS3XXX_TC11MP_TWD_BASE,
28 + IRQ_LOCALTIMER);
29 +
30 + twd_local_timer_register(&cns3xx_twd_local_timer);
31 +}
32 +
33 /*
34 * Set up the clock source and clock events devices
35 */
36 @@ -251,6 +263,7 @@ static void __init __cns3xxx_timer_init(
37 setup_irq(timer_irq, &cns3xxx_timer_irq);
38
39 cns3xxx_clockevents_init(timer_irq);
40 + cns3xxx_init_twd();
41 }
42
43 void __init cns3xxx_timer_init(void)