cns3xxx: fix adding twd local timers
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 18 Jan 2016 22:38:03 +0000 (22:38 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 18 Jan 2016 22:38:03 +0000 (22:38 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48331 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/cns3xxx/patches-3.18/025-smp_support.patch
target/linux/cns3xxx/patches-3.18/040-fiq_support.patch
target/linux/cns3xxx/patches-3.18/045-twd_base.patch
target/linux/cns3xxx/patches-3.18/090-timers.patch
target/linux/cns3xxx/patches-3.18/095-gpio_support.patch
target/linux/cns3xxx/patches-3.18/097-l2x0_cmdline_disable.patch

index 418c065..2a9d997 100644 (file)
@@ -13,7 +13,7 @@
        select ARM_GIC
        select PCI_DOMAINS if PCI
 +      select HAVE_ARM_SCU if SMP
-+      select HAVE_ARM_TWD if LOCAL_TIMERS
++      select HAVE_ARM_TWD
 +      select HAVE_SMP
        help
          Support for Cavium Networks CNS3XXX platform.
index 4f09a36..16774a6 100644 (file)
@@ -2,7 +2,7 @@
 +++ b/arch/arm/mach-cns3xxx/Kconfig
 @@ -5,6 +5,7 @@ menuconfig ARCH_CNS3XXX
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD
        select HAVE_SMP
 +      select FIQ
        help
index f61b8ed..a265f9c 100644 (file)
  static struct map_desc cns3xxx_io_desc[] __initdata = {
        {
                .virtual        = CNS3XXX_TC11MP_SCU_BASE_VIRT,
-@@ -191,6 +194,17 @@ static struct irqaction cns3xxx_timer_ir
+@@ -191,6 +194,15 @@ static struct irqaction cns3xxx_timer_ir
        .handler        = cns3xxx_timer_interrupt,
  };
  
 +static void __init cns3xxx_init_twd(void)
 +{
-+#ifdef CONFIG_LOCAL_TIMERS
 +      static DEFINE_TWD_LOCAL_TIMER(cns3xx_twd_local_timer,
 +              CNS3XXX_TC11MP_TWD_BASE,
 +              IRQ_LOCALTIMER);
 +
 +      twd_local_timer_register(&cns3xx_twd_local_timer);
-+#endif
 +}
 +
  /*
   * Set up the clock source and clock events devices
   */
-@@ -244,6 +258,7 @@ static void __init __cns3xxx_timer_init(
+@@ -244,6 +256,7 @@ static void __init __cns3xxx_timer_init(
        setup_irq(timer_irq, &cns3xxx_timer_irq);
  
        cns3xxx_clockevents_init(timer_irq);
index a884021..0bf686d 100644 (file)
@@ -24,8 +24,8 @@
        .cpumask        = cpu_all_mask,
  };
  
-@@ -215,6 +216,35 @@ static void __init cns3xxx_init_twd(void
- #endif
+@@ -213,6 +214,35 @@ static void __init cns3xxx_init_twd(void
+       twd_local_timer_register(&cns3xx_twd_local_timer);
  }
  
 +static cycle_t cns3xxx_get_cycles(struct clocksource *cs)
@@ -60,7 +60,7 @@
  /*
   * Set up the clock source and clock events devices
   */
-@@ -232,13 +262,12 @@ static void __init __cns3xxx_timer_init(
+@@ -230,13 +260,12 @@ static void __init __cns3xxx_timer_init(
        /* stop free running timer3 */
        writel(0, cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET);
  
@@ -77,7 +77,7 @@
        /* mask irq, non-mask timer1 overflow */
        irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET);
        irq_mask &= ~(1 << 2);
-@@ -250,23 +279,9 @@ static void __init __cns3xxx_timer_init(
+@@ -248,23 +277,9 @@ static void __init __cns3xxx_timer_init(
        val |= (1 << 9);
        writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET);
  
index a6ce177..79a937a 100644 (file)
@@ -21,7 +21,7 @@
 +      select GENERIC_IRQ_CHIP
        select PCI_DOMAINS if PCI
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD
 --- a/arch/arm/mach-cns3xxx/Makefile
 +++ b/arch/arm/mach-cns3xxx/Makefile
 @@ -1,7 +1,7 @@
index f575348..da49e20 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/arm/mach-cns3xxx/core.c
 +++ b/arch/arm/mach-cns3xxx/core.c
-@@ -305,13 +305,26 @@ void __init cns3xxx_timer_init(void)
+@@ -303,13 +303,26 @@ void __init cns3xxx_timer_init(void)
  
  #ifdef CONFIG_CACHE_L2X0
  
@@ -30,7 +30,7 @@
  
        /*
         * Tag RAM Control register
-@@ -341,7 +354,10 @@ void __init cns3xxx_l2x0_init(void)
+@@ -339,7 +352,10 @@ void __init cns3xxx_l2x0_init(void)
  
        /* 32 KiB, 8-way, parity disable */
        l2x0_init(base, 0x00500000, 0xfe0f0fff);