projects/linux·commit 48d55441

Merge tag 'timer' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

48d55441 · Linus Torvalds <[email protected]> · 2012-03-27 16:06:17 -07:00

Pull "ARM: timer cleanup work" from Arnd Bergmann:
 "These are split out from the generic soc and driver updates because
  there was a lot of conflicting work by multiple people.  Marc Zyngier
  worked on simplifying the "localtimer" interfaces, and some of the
  platforms are touching the same code as they move to device tree based
  booting.

  Signed-off-by: Arnd Bergmann <[email protected]>"

* tag 'timer' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (61 commits)
  ARM: tegra: select USB_ULPI if USB is selected
  arm/tegra: pcie: fix return value of function
  ARM: ux500: fix compilation after local timer rework
  ARM: shmobile: remove additional __io() macro use
  ARM: local timers: make the runtime registration interface mandatory
  ARM: local timers: convert MSM to runtime registration interface
  ARM: local timers: convert exynos to runtime registration interface
  ARM: smp_twd: remove old local timer interface
  ARM: imx6q: convert to twd_local_timer_register() interface
  ARM: highbank: convert to twd_local_timer_register() interface
  ARM: ux500: convert to twd_local_timer_register() interface
  ARM: shmobile: convert to twd_local_timer_register() interface
  ARM: tegra: convert to twd_local_timer_register() interface
  ARM: plat-versatile: convert to twd_local_timer_register() interface
  ARM: OMAP4: convert to twd_local_timer_register() interface
  ARM: smp_twd: add device tree support
  ARM: smp_twd: add runtime registration support
  ARM: local timers: introduce a new registration interface
  ARM: smp_twd: make local_timer_stop a symbol instead of a #define
  ARM: mach-shmobile: default to no earlytimer
  ...
Commit
48d554418d3bfbba5e9dc1ebdf352f1b1f3ff4ee
Parents
d61b7a57 · 2cbe23e3

Merge commit. Changes below are compared with the first parent: d61b7a57.

Changes

103 files changed · +964 −999

FileStatusAddDelContent
Documentation/devicetree/bindings/arm/twd.txtadded+48−0View file
arch/arm/boot/dts/highbank.dtsmodified+4−4View file
arch/arm/boot/dts/imx6q.dtsimodified+3−3View file
arch/arm/include/asm/hardware/arm_timer.hmodified+5−0View file
arch/arm/include/asm/localtimer.hmodified+7−30View file
arch/arm/include/asm/smp_twd.hmodified+21−4View file
arch/arm/kernel/smp.cmodified+19−3View file
arch/arm/kernel/smp_twd.cmodified+100−23View file
arch/arm/mach-exynos/mct.cmodified+10−8View file
arch/arm/mach-highbank/Makefilemodified+0−1View file
arch/arm/mach-highbank/highbank.cmodified+3−0View file
arch/arm/mach-highbank/localtimer.cdeleted+0−40View before deletion
arch/arm/mach-imx/Makefilemodified+0−1View file
arch/arm/mach-imx/localtimer.cdeleted+0−35View before deletion
arch/arm/mach-imx/mach-imx6q.cmodified+2−0View file
arch/arm/mach-msm/timer.cmodified+44−35View file
arch/arm/mach-nomadik/board-nhk8815.cmodified+2−5View file
arch/arm/mach-nomadik/include/mach/setup.hdeleted+0−19View before deletion
arch/arm/mach-omap2/Makefilemodified+0−1View file
arch/arm/mach-omap2/timer-mpu.cdeleted+0−39View before deletion
arch/arm/mach-omap2/timer.cmodified+17−5View file
arch/arm/mach-realview/realview_eb.cmodified+21−6View file
arch/arm/mach-realview/realview_pb11mp.cmodified+17−4View file
arch/arm/mach-realview/realview_pbx.cmodified+16−4View file
arch/arm/mach-shmobile/Makefilemodified+0−1View file
arch/arm/mach-shmobile/board-ag5evm.cmodified+3−36View file
arch/arm/mach-shmobile/board-ap4evb.cmodified+6−38View file
arch/arm/mach-shmobile/board-bonito.cmodified+12−32View file
arch/arm/mach-shmobile/board-g3evm.cmodified+3−35View file
arch/arm/mach-shmobile/board-g4evm.cmodified+3−35View file
arch/arm/mach-shmobile/board-kota2.cmodified+3−35View file
arch/arm/mach-shmobile/board-mackerel.cmodified+6−33View file
arch/arm/mach-shmobile/board-marzen.cmodified+3−59View file
arch/arm/mach-shmobile/clock-r8a7740.cmodified+4−4View file
arch/arm/mach-shmobile/clock-r8a7779.cmodified+2−2View file
arch/arm/mach-shmobile/clock-sh7367.cmodified+4−4View file
arch/arm/mach-shmobile/clock-sh7372.cmodified+5−5View file
arch/arm/mach-shmobile/clock-sh7377.cmodified+4−4View file
arch/arm/mach-shmobile/clock-sh73a0.cmodified+7−7View file
arch/arm/mach-shmobile/clock.cmodified+1−1View file
arch/arm/mach-shmobile/include/mach/common.hmodified+10−1View file
arch/arm/mach-shmobile/localtimer.cdeleted+0−26View before deletion
arch/arm/mach-shmobile/platsmp.cmodified+0−1View file
arch/arm/mach-shmobile/setup-r8a7740.cmodified+45−0View file
arch/arm/mach-shmobile/setup-r8a7779.cmodified+54−0View file
arch/arm/mach-shmobile/setup-sh7367.cmodified+32−0View file
arch/arm/mach-shmobile/setup-sh7372.cmodified+32−0View file
arch/arm/mach-shmobile/setup-sh7377.cmodified+32−0View file
arch/arm/mach-shmobile/setup-sh73a0.cmodified+32−0View file
arch/arm/mach-shmobile/smp-r8a7779.cmodified+3−5View file
arch/arm/mach-shmobile/smp-sh73a0.cmodified+3−5View file
arch/arm/mach-shmobile/timer.cmodified+15−1View file
arch/arm/mach-tegra/Kconfigmodified+2−2View file
arch/arm/mach-tegra/Makefilemodified+0−1View file
arch/arm/mach-tegra/board-harmony-pinmux.cmodified+3−3View file
arch/arm/mach-tegra/localtimer.cdeleted+0−26View before deletion
arch/arm/mach-tegra/pcie.cmodified+12−4View file
arch/arm/mach-tegra/timer.cmodified+17−5View file
arch/arm/mach-ux500/Makefilemodified+0−1View file
arch/arm/mach-ux500/cpu.cmodified+0−1View file
arch/arm/mach-ux500/include/mach/setup.hmodified+0−3View file
arch/arm/mach-ux500/localtimer.cdeleted+0−29View before deletion
arch/arm/mach-ux500/timer.cmodified+29−10View file
arch/arm/mach-vexpress/core.hmodified+5−2View file
arch/arm/mach-vexpress/ct-ca9x4.cmodified+29−38View file
arch/arm/mach-vexpress/include/mach/ct-ca9x4.hmodified+0−3View file
arch/arm/mach-vexpress/include/mach/motherboard.hmodified+25−27View file
arch/arm/mach-vexpress/platsmp.cmodified+1−4View file
arch/arm/mach-vexpress/v2m.cmodified+46−22View file
arch/arm/plat-nomadik/include/plat/mtu.hmodified+1−3View file
arch/arm/plat-nomadik/timer.cmodified+8−25View file
arch/arm/plat-versatile/Makefilemodified+0−1View file
arch/arm/plat-versatile/localtimer.cdeleted+0−27View before deletion
arch/sh/boards/mach-highlander/setup.cmodified+1−1View file
arch/sh/boards/mach-sdk7786/setup.cmodified+1−1View file
arch/sh/include/asm/clock.hmodified+1−1View file
arch/sh/kernel/cpu/sh2/clock-sh7619.cmodified+6−6View file
arch/sh/kernel/cpu/sh2a/clock-sh7201.cmodified+6−6View file
arch/sh/kernel/cpu/sh2a/clock-sh7203.cmodified+6−6View file
arch/sh/kernel/cpu/sh2a/clock-sh7206.cmodified+6−6View file
arch/sh/kernel/cpu/sh3/clock-sh3.cmodified+6−6View file
arch/sh/kernel/cpu/sh3/clock-sh7705.cmodified+6−6View file
arch/sh/kernel/cpu/sh3/clock-sh7706.cmodified+6−6View file
arch/sh/kernel/cpu/sh3/clock-sh7709.cmodified+6−6View file
arch/sh/kernel/cpu/sh3/clock-sh7710.cmodified+6−6View file
arch/sh/kernel/cpu/sh3/clock-sh7712.cmodified+5−5View file
arch/sh/kernel/cpu/sh4/clock-sh4-202.cmodified+3−3View file
arch/sh/kernel/cpu/sh4/clock-sh4.cmodified+6−6View file
arch/sh/kernel/cpu/sh4a/clock-sh7343.cmodified+2−2View file
arch/sh/kernel/cpu/sh4a/clock-sh7366.cmodified+2−2View file
arch/sh/kernel/cpu/sh4a/clock-sh7722.cmodified+2−2View file
arch/sh/kernel/cpu/sh4a/clock-sh7723.cmodified+2−2View file
arch/sh/kernel/cpu/sh4a/clock-sh7724.cmodified+3−3View file
arch/sh/kernel/cpu/sh4a/clock-sh7757.cmodified+1−1View file
arch/sh/kernel/cpu/sh4a/clock-sh7763.cmodified+7−7View file
arch/sh/kernel/cpu/sh4a/clock-sh7770.cmodified+6−6View file
arch/sh/kernel/cpu/sh4a/clock-sh7780.cmodified+7−7View file
arch/sh/kernel/cpu/sh4a/clock-sh7785.cmodified+1−1View file
arch/sh/kernel/cpu/sh4a/clock-sh7786.cmodified+1−1View file
arch/sh/kernel/cpu/sh4a/clock-shx3.cmodified+1−1View file
arch/sh/kernel/cpu/sh5/clock-sh5.cmodified+6−6View file
drivers/sh/clk/cpg.cmodified+8−8View file
include/linux/sh_clk.hmodified+3−2View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/devicetree/bindings/arm/twd.txt

View file
diff --git a/Documentation/devicetree/bindings/arm/twd.txt b/Documentation/devicetree/bindings/arm/twd.txt
new file mode 100644
index 0000000..75b8610
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/twd.txt
@@ -0,0 +1,48 @@
+* ARM Timer Watchdog
+
+ARM 11MP, Cortex-A5 and Cortex-A9 are often associated with a per-core
+Timer-Watchdog (aka TWD), which provides both a per-cpu local timer
+and watchdog.
+
+The TWD is usually attached to a GIC to deliver its two per-processor
+interrupts.
+
+** Timer node required properties:
+
+- compatible : Should be one of:
+ "arm,cortex-a9-twd-timer"
+ "arm,cortex-a5-twd-timer"
+ "arm,arm11mp-twd-timer"
+
+- interrupts : One interrupt to each core
+
+- reg : Specify the base address and the size of the TWD timer
+ register window.
+
+Example:
+
+ twd-timer@2c000600 {
+ compatible = "arm,arm11mp-twd-timer"";
+ reg = <0x2c000600 0x20>;
+ interrupts = <1 13 0xf01>;
+ };
+
+** Watchdog node properties:
+
+- compatible : Should be one of:
+ "arm,cortex-a9-twd-wdt"
+ "arm,cortex-a5-twd-wdt"
+ "arm,arm11mp-twd-wdt"
+
+- interrupts : One interrupt to each core
+
+- reg : Specify the base address and the size of the TWD watchdog
+ register window.
+
+Example:
+
+ twd-watchdog@2c000620 {
+ compatible = "arm,arm11mp-twd-wdt";
+ reg = <0x2c000620 0x20>;
+ interrupts = <1 14 0xf01>;
+ };

arch/arm/boot/dts/highbank.dts

View file
diff --git a/arch/arm/boot/dts/highbank.dts b/arch/arm/boot/dts/highbank.dts
index 305635b..37c0ff9 100644
--- a/arch/arm/boot/dts/highbank.dts
+++ b/arch/arm/boot/dts/highbank.dts
@@ -72,15 +72,15 @@
ranges;
timer@fff10600 {
- compatible = "arm,smp-twd";
+ compatible = "arm,cortex-a9-twd-timer";
reg = <0xfff10600 0x20>;
- interrupts = <1 13 0xf04>;
+ interrupts = <1 13 0xf01>;
};
watchdog@fff10620 {
- compatible = "arm,cortex-a9-wdt";
+ compatible = "arm,cortex-a9-twd-wdt";
reg = <0xfff10620 0x20>;
- interrupts = <1 14 0xf04>;
+ interrupts = <1 14 0xf01>;
};
intc: interrupt-controller@fff11000 {

arch/arm/boot/dts/imx6q.dtsi

View file
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index 263e8f3..4905f51 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -88,9 +88,9 @@
ranges;
timer@00a00600 {
- compatible = "arm,smp-twd";
- reg = <0x00a00600 0x100>;
- interrupts = <1 13 0xf4>;
+ compatible = "arm,cortex-a9-twd-timer";
+ reg = <0x00a00600 0x20>;
+ interrupts = <1 13 0xf01>;
};
L2: l2-cache@00a02000 {

arch/arm/include/asm/hardware/arm_timer.h

View file
diff --git a/arch/arm/include/asm/hardware/arm_timer.h b/arch/arm/include/asm/hardware/arm_timer.h
index c0f4e7b..d6030ff 100644
--- a/arch/arm/include/asm/hardware/arm_timer.h
+++ b/arch/arm/include/asm/hardware/arm_timer.h
@@ -9,7 +9,12 @@
*
* Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
* can have 16-bit or 32-bit selectable via a bit in the control register.
+ *
+ * Every SP804 contains two identical timers.
*/
+#define TIMER_1_BASE 0x00
+#define TIMER_2_BASE 0x20
+
#define TIMER_LOAD 0x00 /* ACVR rw */
#define TIMER_VALUE 0x04 /* ACVR ro */
#define TIMER_CTRL 0x08 /* ACVR rw */

arch/arm/include/asm/localtimer.h

View file
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index c6a1842..f77ffc1 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -11,47 +11,24 @@
#define __ASM_ARM_LOCALTIMER_H
#include <linux/errno.h>
-#include <linux/interrupt.h>
struct clock_event_device;
-/*
- * Setup a per-cpu timer, whether it be a local timer or dummy broadcast
- */
-void percpu_timer_setup(void);
+struct local_timer_ops {
+ int (*setup)(struct clock_event_device *);
+ void (*stop)(struct clock_event_device *);
+};
#ifdef CONFIG_LOCAL_TIMERS
-
-#ifdef CONFIG_HAVE_ARM_TWD
-
-#include "smp_twd.h"
-
-#define local_timer_stop(c) twd_timer_stop((c))
-
-#else
-
-/*
- * Stop the local timer
- */
-void local_timer_stop(struct clock_event_device *);
-
-#endif
-
/*
- * Setup a local timer interrupt for a CPU.
+ * Register a local timer driver
*/
-int local_timer_setup(struct clock_event_device *);
-
+int local_timer_register(struct local_timer_ops *);
#else
-
-static inline int local_timer_setup(struct clock_event_device *evt)
+static inline int local_timer_register(struct local_timer_ops *ops)
{
return -ENXIO;
}
-
-static inline void local_timer_stop(struct clock_event_device *evt)
-{
-}
#endif
#endif

arch/arm/include/asm/smp_twd.h

View file
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index ef9ffba..0f01f46 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -18,11 +18,28 @@
#define TWD_TIMER_CONTROL_PERIODIC (1 << 1)
#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2)
-struct clock_event_device;
+#include <linux/ioport.h>
-extern void __iomem *twd_base;
+struct twd_local_timer {
+ struct resource res[2];
+};
-void twd_timer_setup(struct clock_event_device *);
-void twd_timer_stop(struct clock_event_device *);
+#define DEFINE_TWD_LOCAL_TIMER(name,base,irq) \
+struct twd_local_timer name __initdata = { \
+ .res = { \
+ DEFINE_RES_MEM(base, 0x10), \
+ DEFINE_RES_IRQ(irq), \
+ }, \
+};
+
+int twd_local_timer_register(struct twd_local_timer *);
+
+#ifdef CONFIG_HAVE_ARM_TWD
+void twd_local_timer_of_register(void);
+#else
+static inline void twd_local_timer_of_register(void)
+{
+}
+#endif
#endif

arch/arm/kernel/smp.c

View file
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index d616ed5..8f8cce2 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -246,6 +246,8 @@ static void __cpuinit smp_store_cpu_info(unsigned int cpuid)
store_cpu_topology(cpuid);
}
+static void percpu_timer_setup(void);
+
/*
* This is the secondary CPU boot entry. We're using this CPUs
* idle thread stack, but a set of temporary page tables.
@@ -452,7 +454,20 @@ static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)
clockevents_register_device(evt);
}
-void __cpuinit percpu_timer_setup(void)
+static struct local_timer_ops *lt_ops;
+
+#ifdef CONFIG_LOCAL_TIMERS
+int local_timer_register(struct local_timer_ops *ops)
+{
+ if (lt_ops)
+ return -EBUSY;
+
+ lt_ops = ops;
+ return 0;
+}
+#endif
+
+static void __cpuinit percpu_timer_setup(void)
{
unsigned int cpu = smp_processor_id();
struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
@@ -460,7 +475,7 @@ void __cpuinit percpu_timer_setup(void)
evt->cpumask = cpumask_of(cpu);
evt->broadcast = smp_timer_broadcast;
- if (local_timer_setup(evt))
+ if (!lt_ops || lt_ops->setup(evt))
broadcast_timer_setup(evt);
}
@@ -475,7 +490,8 @@ static void percpu_timer_stop(void)
unsigned int cpu = smp_processor_id();
struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
- local_timer_stop(evt);
+ if (lt_ops)
+ lt_ops->stop(evt);
}
#endif

arch/arm/kernel/smp_twd.c

View file
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 7a79b24..fef42b2 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -18,20 +18,23 @@
#include <linux/smp.h>
#include <linux/jiffies.h>
#include <linux/clockchips.h>
-#include <linux/irq.h>
+#include <linux/interrupt.h>
#include <linux/io.h>
+#include <linux/of_irq.h>
+#include <linux/of_address.h>
#include <asm/smp_twd.h>
#include <asm/localtimer.h>
#include <asm/hardware/gic.h>
/* set up by the platform code */
-void __iomem *twd_base;
+static void __iomem *twd_base;
static struct clk *twd_clk;
static unsigned long twd_timer_rate;
static struct clock_event_device __percpu **twd_evt;
+static int twd_ppi;
static void twd_set_mode(enum clock_event_mode mode,
struct clock_event_device *clk)
@@ -77,7 +80,7 @@ static int twd_set_next_event(unsigned long evt,
* If a local timer interrupt has occurred, acknowledge and return 1.
* Otherwise, return 0.
*/
-int twd_timer_ack(void)
+static int twd_timer_ack(void)
{
if (__raw_readl(twd_base + TWD_TIMER_INTSTAT)) {
__raw_writel(1, twd_base + TWD_TIMER_INTSTAT);
@@ -87,7 +90,7 @@ int twd_timer_ack(void)
return 0;
}
-void twd_timer_stop(struct clock_event_device *clk)
+static void twd_timer_stop(struct clock_event_device *clk)
{
twd_set_mode(CLOCK_EVT_MODE_UNUSED, clk);
disable_percpu_irq(clk->irq);
@@ -222,28 +225,10 @@ static struct clk *twd_get_clock(void)
/*
* Setup the local clock events for a CPU.
*/
-void __cpuinit twd_timer_setup(struct clock_event_device *clk)
+static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
{
struct clock_event_device **this_cpu_clk;
- if (!twd_evt) {
- int err;
-
- twd_evt = alloc_percpu(struct clock_event_device *);
- if (!twd_evt) {
- pr_err("twd: can't allocate memory\n");
- return;
- }
-
- err = request_percpu_irq(clk->irq, twd_handler,
- "twd", twd_evt);
- if (err) {
- pr_err("twd: can't register interrupt %d (%d)\n",
- clk->irq, err);
- return;
- }
- }
-
if (!twd_clk)
twd_clk = twd_get_clock();
@@ -260,6 +245,7 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
clk->rating = 350;
clk->set_mode = twd_set_mode;
clk->set_next_event = twd_set_next_event;
+ clk->irq = twd_ppi;
this_cpu_clk = __this_cpu_ptr(twd_evt);
*this_cpu_clk = clk;
@@ -267,4 +253,95 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
clockevents_config_and_register(clk, twd_timer_rate,
0xf, 0xffffffff);
enable_percpu_irq(clk->irq, 0);
+
+ return 0;
+}
+
+static struct local_timer_ops twd_lt_ops __cpuinitdata = {
+ .setup = twd_timer_setup,
+ .stop = twd_timer_stop,
+};
+
+static int __init twd_local_timer_common_register(void)
+{
+ int err;
+
+ twd_evt = alloc_percpu(struct clock_event_device *);
+ if (!twd_evt) {
+ err = -ENOMEM;
+ goto out_free;
+ }
+
+ err = request_percpu_irq(twd_ppi, twd_handler, "twd", twd_evt);
+ if (err) {
+ pr_err("twd: can't register interrupt %d (%d)\n", twd_ppi, err);
+ goto out_free;
+ }
+
+ err = local_timer_register(&twd_lt_ops);
+ if (err)
+ goto out_irq;
+
+ return 0;
+
+out_irq:
+ free_percpu_irq(twd_ppi, twd_evt);
+out_free:
+ iounmap(twd_base);
+ twd_base = NULL;
+ free_percpu(twd_evt);
+
+ return err;
}
+
+int __init twd_local_timer_register(struct twd_local_timer *tlt)
+{
+ if (twd_base || twd_evt)
+ return -EBUSY;
+
+ twd_ppi = tlt->res[1].start;
+
+ twd_base = ioremap(tlt->res[0].start, resource_size(&tlt->res[0]));
+ if (!twd_base)
+ return -ENOMEM;
+
+ return twd_local_timer_common_register();
+}
+
+#ifdef CONFIG_OF
+const static struct of_device_id twd_of_match[] __initconst = {
+ { .compatible = "arm,cortex-a9-twd-timer", },
+ { .compatible = "arm,cortex-a5-twd-timer", },
+ { .compatible = "arm,arm11mp-twd-timer", },
+ { },
+};
+
+void __init twd_local_timer_of_register(void)
+{
+ struct device_node *np;
+ int err;
+
+ np = of_find_matching_node(NULL, twd_of_match);
+ if (!np) {
+ err = -ENODEV;
+ goto out;
+ }
+
+ twd_ppi = irq_of_parse_and_map(np, 0);
+ if (!twd_ppi) {
+ err = -EINVAL;
+ goto out;
+ }
+
+ twd_base = of_iomap(np, 0);
+ if (!twd_base) {
+ err = -ENOMEM;
+ goto out;
+ }
+
+ err = twd_local_timer_common_register();
+
+out:
+ WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
+}
+#endif

arch/arm/mach-exynos/mct.c

View file
diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c
index 85b5527..edc4b94 100644
--- a/arch/arm/mach-exynos/mct.c
+++ b/arch/arm/mach-exynos/mct.c
@@ -21,6 +21,7 @@
#include <linux/percpu.h>
#include <asm/hardware/gic.h>
+#include <asm/localtimer.h>
#include <plat/cpu.h>
@@ -375,7 +376,7 @@ static struct irqaction mct_tick1_event_irq = {
.handler = exynos4_mct_tick_isr,
};
-static void exynos4_mct_tick_init(struct clock_event_device *evt)
+static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt)
{
struct mct_clock_event_device *mevt;
unsigned int cpu = smp_processor_id();
@@ -417,17 +418,11 @@ static void exynos4_mct_tick_init(struct clock_event_device *evt)
} else {
enable_percpu_irq(IRQ_MCT_LOCALTIMER, 0);
}
-}
-
-/* Setup the local clock events for a CPU */
-int __cpuinit local_timer_setup(struct clock_event_device *evt)
-{
- exynos4_mct_tick_init(evt);
return 0;
}
-void local_timer_stop(struct clock_event_device *evt)
+static void exynos4_local_timer_stop(struct clock_event_device *evt)
{
unsigned int cpu = smp_processor_id();
evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
@@ -439,6 +434,11 @@ void local_timer_stop(struct clock_event_device *evt)
else
disable_percpu_irq(IRQ_MCT_LOCALTIMER);
}
+
+static struct local_timer_ops exynos4_mct_tick_ops __cpuinitdata = {
+ .setup = exynos4_local_timer_setup,
+ .stop = exynos4_local_timer_stop,
+};
#endif /* CONFIG_LOCAL_TIMERS */
static void __init exynos4_timer_resources(void)
@@ -458,6 +458,8 @@ static void __init exynos4_timer_resources(void)
WARN(err, "MCT: can't request IRQ %d (%d)\n",
IRQ_MCT_LOCALTIMER, err);
}
+
+ local_timer_register(&exynos4_mct_tick_ops);
#endif /* CONFIG_LOCAL_TIMERS */
}

arch/arm/mach-highbank/Makefile

View file
diff --git a/arch/arm/mach-highbank/Makefile b/arch/arm/mach-highbank/Makefile
index 986958a..f8437dd 100644
--- a/arch/arm/mach-highbank/Makefile
+++ b/arch/arm/mach-highbank/Makefile
@@ -1,6 +1,5 @@
obj-y := clock.o highbank.o system.o
obj-$(CONFIG_DEBUG_HIGHBANK_UART) += lluart.o
obj-$(CONFIG_SMP) += platsmp.o
-obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_PM_SLEEP) += pm.o

arch/arm/mach-highbank/highbank.c

View file
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index 8394d51..bb1684f 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -27,6 +27,7 @@
#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
#include <asm/smp_scu.h>
+#include <asm/smp_twd.h>
#include <asm/hardware/arm_timer.h>
#include <asm/hardware/timer-sp.h>
#include <asm/hardware/gic.h>
@@ -111,6 +112,8 @@ static void __init highbank_timer_init(void)
sp804_clocksource_init(timer_base + 0x20, "timer1");
sp804_clockevents_init(timer_base, irq, "timer0");
+
+ twd_local_timer_of_register();
}
static struct sys_timer highbank_timer = {

arch/arm/mach-highbank/localtimer.c

View before deletion
diff --git a/arch/arm/mach-highbank/localtimer.c b/arch/arm/mach-highbank/localtimer.c
deleted file mode 100644
index 5a00e79..0000000
--- a/arch/arm/mach-highbank/localtimer.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2010-2011 Calxeda, Inc.
- * Based on localtimer.c, Copyright (C) 2002 ARM Ltd.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#include <linux/init.h>
-#include <linux/clockchips.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-
-#include <asm/smp_twd.h>
-
-/*
- * Setup the local clock events for a CPU.
- */
-int __cpuinit local_timer_setup(struct clock_event_device *evt)
-{
- struct device_node *np;
-
- np = of_find_compatible_node(NULL, NULL, "arm,smp-twd");
- if (!twd_base) {
- twd_base = of_iomap(np, 0);
- WARN_ON(!twd_base);
- }
- evt->irq = irq_of_parse_and_map(np, 0);
- twd_timer_setup(evt);
- return 0;
-}

arch/arm/mach-imx/Makefile

View file
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 55db9c4..190d570 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -71,7 +71,6 @@ obj-$(CONFIG_CPU_V7) += head-v7.o
AFLAGS_head-v7.o :=-Wa,-march=armv7-a
obj-$(CONFIG_SMP) += platsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
-obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o
ifeq ($(CONFIG_PM),y)

arch/arm/mach-imx/localtimer.c

View before deletion
diff --git a/arch/arm/mach-imx/localtimer.c b/arch/arm/mach-imx/localtimer.c
deleted file mode 100644
index 3a16351..0000000
--- a/arch/arm/mach-imx/localtimer.c
+++ /dev/null

This diff is incomplete. Download the complete patch.

arch/arm/mach-imx/mach-imx6q.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-msm/timer.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-nomadik/board-nhk8815.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-nomadik/include/mach/setup.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/arm/mach-omap2/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-omap2/timer-mpu.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/arm/mach-omap2/timer.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-realview/realview_eb.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-realview/realview_pb11mp.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-realview/realview_pbx.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/board-ag5evm.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/board-ap4evb.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/board-bonito.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/board-g3evm.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/board-g4evm.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/board-kota2.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/board-mackerel.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/board-marzen.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/clock-r8a7740.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/clock-r8a7779.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/clock-sh7367.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/clock-sh7372.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/clock-sh7377.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/clock-sh73a0.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/clock.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/include/mach/common.h

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/localtimer.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/platsmp.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/setup-r8a7740.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/setup-r8a7779.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/setup-sh7367.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/setup-sh7372.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/setup-sh7377.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/setup-sh73a0.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/smp-r8a7779.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/smp-sh73a0.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/timer.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-tegra/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-tegra/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-tegra/board-harmony-pinmux.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-tegra/localtimer.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/arm/mach-tegra/pcie.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-tegra/timer.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-ux500/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-ux500/cpu.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-ux500/include/mach/setup.h

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-ux500/localtimer.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/arm/mach-ux500/timer.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-vexpress/core.h

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-vexpress/ct-ca9x4.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-vexpress/include/mach/ct-ca9x4.h

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-vexpress/include/mach/motherboard.h

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-vexpress/platsmp.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/mach-vexpress/v2m.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/plat-nomadik/include/plat/mtu.h

View file

This diff is incomplete. Download the complete patch.

arch/arm/plat-nomadik/timer.c

View file

This diff is incomplete. Download the complete patch.

arch/arm/plat-versatile/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm/plat-versatile/localtimer.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/sh/boards/mach-highlander/setup.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/boards/mach-sdk7786/setup.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/include/asm/clock.h

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh2/clock-sh7619.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh2a/clock-sh7201.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh2a/clock-sh7203.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh2a/clock-sh7206.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh3/clock-sh3.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh3/clock-sh7705.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh3/clock-sh7706.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh3/clock-sh7709.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh3/clock-sh7710.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh3/clock-sh7712.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4/clock-sh4-202.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4/clock-sh4.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7343.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7366.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7722.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7723.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7724.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7757.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7763.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7770.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7780.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7785.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-sh7786.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh4a/clock-shx3.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/sh5/clock-sh5.c

View file

This diff is incomplete. Download the complete patch.

drivers/sh/clk/cpg.c

View file

This diff is incomplete. Download the complete patch.

include/linux/sh_clk.h

View file

This diff is incomplete. Download the complete patch.