aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:06:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-27 19:06:17 -0400
commit48d554418d3bfbba5e9dc1ebdf352f1b1f3ff4ee (patch)
tree696bdc0c1087e82c6493c852bca514bb0fcd7881 /arch/arm/include
parentd61b7a572b292e2be409e13b4b3adf475f18fb29 (diff)
parent2cbe23e3a432e3d09a849adb197c8fcc09e7391d (diff)
Merge tag 'timer' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
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 <arnd@arndb.de>" * 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 ...
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/hardware/arm_timer.h5
-rw-r--r--arch/arm/include/asm/localtimer.h37
-rw-r--r--arch/arm/include/asm/smp_twd.h25
3 files changed, 33 insertions, 34 deletions
diff --git a/arch/arm/include/asm/hardware/arm_timer.h b/arch/arm/include/asm/hardware/arm_timer.h
index c0f4e7bf22de..d6030ff599db 100644
--- a/arch/arm/include/asm/hardware/arm_timer.h
+++ b/arch/arm/include/asm/hardware/arm_timer.h
@@ -9,7 +9,12 @@
9 * 9 *
10 * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview 10 * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
11 * can have 16-bit or 32-bit selectable via a bit in the control register. 11 * can have 16-bit or 32-bit selectable via a bit in the control register.
12 *
13 * Every SP804 contains two identical timers.
12 */ 14 */
15#define TIMER_1_BASE 0x00
16#define TIMER_2_BASE 0x20
17
13#define TIMER_LOAD 0x00 /* ACVR rw */ 18#define TIMER_LOAD 0x00 /* ACVR rw */
14#define TIMER_VALUE 0x04 /* ACVR ro */ 19#define TIMER_VALUE 0x04 /* ACVR ro */
15#define TIMER_CTRL 0x08 /* ACVR rw */ 20#define TIMER_CTRL 0x08 /* ACVR rw */
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index c6a18424888e..f77ffc1eb0c2 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -11,47 +11,24 @@
11#define __ASM_ARM_LOCALTIMER_H 11#define __ASM_ARM_LOCALTIMER_H
12 12
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/interrupt.h>
15 14
16struct clock_event_device; 15struct clock_event_device;
17 16
18/* 17struct local_timer_ops {
19 * Setup a per-cpu timer, whether it be a local timer or dummy broadcast 18 int (*setup)(struct clock_event_device *);
20 */ 19 void (*stop)(struct clock_event_device *);
21void percpu_timer_setup(void); 20};
22 21
23#ifdef CONFIG_LOCAL_TIMERS 22#ifdef CONFIG_LOCAL_TIMERS
24
25#ifdef CONFIG_HAVE_ARM_TWD
26
27#include "smp_twd.h"
28
29#define local_timer_stop(c) twd_timer_stop((c))
30
31#else
32
33/*
34 * Stop the local timer
35 */
36void local_timer_stop(struct clock_event_device *);
37
38#endif
39
40/* 23/*
41 * Setup a local timer interrupt for a CPU. 24 * Register a local timer driver
42 */ 25 */
43int local_timer_setup(struct clock_event_device *); 26int local_timer_register(struct local_timer_ops *);
44
45#else 27#else
46 28static inline int local_timer_register(struct local_timer_ops *ops)
47static inline int local_timer_setup(struct clock_event_device *evt)
48{ 29{
49 return -ENXIO; 30 return -ENXIO;
50} 31}
51
52static inline void local_timer_stop(struct clock_event_device *evt)
53{
54}
55#endif 32#endif
56 33
57#endif 34#endif
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index ef9ffba97ad8..0f01f4677bd2 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -18,11 +18,28 @@
18#define TWD_TIMER_CONTROL_PERIODIC (1 << 1) 18#define TWD_TIMER_CONTROL_PERIODIC (1 << 1)
19#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2) 19#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2)
20 20
21struct clock_event_device; 21#include <linux/ioport.h>
22 22
23extern void __iomem *twd_base; 23struct twd_local_timer {
24 struct resource res[2];
25};
24 26
25void twd_timer_setup(struct clock_event_device *); 27#define DEFINE_TWD_LOCAL_TIMER(name,base,irq) \
26void twd_timer_stop(struct clock_event_device *); 28struct twd_local_timer name __initdata = { \
29 .res = { \
30 DEFINE_RES_MEM(base, 0x10), \
31 DEFINE_RES_IRQ(irq), \
32 }, \
33};
34
35int twd_local_timer_register(struct twd_local_timer *);
36
37#ifdef CONFIG_HAVE_ARM_TWD
38void twd_local_timer_of_register(void);
39#else
40static inline void twd_local_timer_of_register(void)
41{
42}
43#endif
27 44
28#endif 45#endif