diff options
author | Mark Rutland <mark.rutland@arm.com> | 2012-11-12 09:33:44 -0500 |
---|---|---|
committer | Mark Rutland <mark.rutland@arm.com> | 2013-01-31 10:51:49 -0500 |
commit | 8a4da6e36c582ff746191eca85b6c1c068dbfbd6 (patch) | |
tree | 9c4be7e6853d33f35580e6f7c64c3d410dfe4aaf /arch/arm/include/asm/arch_timer.h | |
parent | b2deabe3ba664a1ec47400c0ca285e951874e0cc (diff) |
arm: arch_timer: move core to drivers/clocksource
The core functionality of the arch_timer driver is not directly tied to
anything under arch/arm, and can be split out.
This patch factors out the core of the arch_timer driver, so it can be
shared with other architectures. A couple of functions are added so
that architecture-specific code can interact with the driver without
needing to touch its internals.
The ARM_ARCH_TIMER config variable is moved out to
drivers/clocksource/Kconfig, existing uses in arch/arm are replaced with
HAVE_ARM_ARCH_TIMER, which selects it.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/include/asm/arch_timer.h')
-rw-r--r-- | arch/arm/include/asm/arch_timer.h | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h index 729f6d98df86..7ade91d8cc6f 100644 --- a/arch/arm/include/asm/arch_timer.h +++ b/arch/arm/include/asm/arch_timer.h | |||
@@ -4,22 +4,14 @@ | |||
4 | #include <asm/barrier.h> | 4 | #include <asm/barrier.h> |
5 | #include <asm/errno.h> | 5 | #include <asm/errno.h> |
6 | #include <linux/clocksource.h> | 6 | #include <linux/clocksource.h> |
7 | #include <linux/init.h> | ||
7 | #include <linux/types.h> | 8 | #include <linux/types.h> |
8 | 9 | ||
10 | #include <clocksource/arm_arch_timer.h> | ||
11 | |||
9 | #ifdef CONFIG_ARM_ARCH_TIMER | 12 | #ifdef CONFIG_ARM_ARCH_TIMER |
10 | int arch_timer_of_register(void); | 13 | int arch_timer_of_register(void); |
11 | int arch_timer_sched_clock_init(void); | 14 | int arch_timer_sched_clock_init(void); |
12 | struct timecounter *arch_timer_get_timecounter(void); | ||
13 | |||
14 | #define ARCH_TIMER_CTRL_ENABLE (1 << 0) | ||
15 | #define ARCH_TIMER_CTRL_IT_MASK (1 << 1) | ||
16 | #define ARCH_TIMER_CTRL_IT_STAT (1 << 2) | ||
17 | |||
18 | #define ARCH_TIMER_REG_CTRL 0 | ||
19 | #define ARCH_TIMER_REG_TVAL 1 | ||
20 | |||
21 | #define ARCH_TIMER_PHYS_ACCESS 0 | ||
22 | #define ARCH_TIMER_VIRT_ACCESS 1 | ||
23 | 15 | ||
24 | /* | 16 | /* |
25 | * These register accessors are marked inline so the compiler can | 17 | * These register accessors are marked inline so the compiler can |
@@ -128,11 +120,6 @@ static inline int arch_timer_sched_clock_init(void) | |||
128 | { | 120 | { |
129 | return -ENXIO; | 121 | return -ENXIO; |
130 | } | 122 | } |
131 | |||
132 | static inline struct timecounter *arch_timer_get_timecounter(void) | ||
133 | { | ||
134 | return NULL; | ||
135 | } | ||
136 | #endif | 123 | #endif |
137 | 124 | ||
138 | #endif | 125 | #endif |