Skip to content

Commit

Permalink
arm: arch_timer: move core to drivers/clocksource
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Rutland committed Jan 31, 2013
1 parent b2deabe commit 8a4da6e
Show file tree
Hide file tree
Showing 8 changed files with 476 additions and 386 deletions.
3 changes: 2 additions & 1 deletion arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1572,9 +1572,10 @@ config HAVE_ARM_SCU
help
This option enables support for the ARM system coherency unit

config ARM_ARCH_TIMER
config HAVE_ARM_ARCH_TIMER
bool "Architected timer support"
depends on CPU_V7
select ARM_ARCH_TIMER
help
This option enables support for the ARM architected timer

Expand Down
19 changes: 3 additions & 16 deletions arch/arm/include/asm/arch_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@
#include <asm/barrier.h>
#include <asm/errno.h>
#include <linux/clocksource.h>
#include <linux/init.h>
#include <linux/types.h>

#include <clocksource/arm_arch_timer.h>

#ifdef CONFIG_ARM_ARCH_TIMER
int arch_timer_of_register(void);
int arch_timer_sched_clock_init(void);
struct timecounter *arch_timer_get_timecounter(void);

#define ARCH_TIMER_CTRL_ENABLE (1 << 0)
#define ARCH_TIMER_CTRL_IT_MASK (1 << 1)
#define ARCH_TIMER_CTRL_IT_STAT (1 << 2)

#define ARCH_TIMER_REG_CTRL 0
#define ARCH_TIMER_REG_TVAL 1

#define ARCH_TIMER_PHYS_ACCESS 0
#define ARCH_TIMER_VIRT_ACCESS 1

/*
* These register accessors are marked inline so the compiler can
Expand Down Expand Up @@ -128,11 +120,6 @@ static inline int arch_timer_sched_clock_init(void)
{
return -ENXIO;
}

static inline struct timecounter *arch_timer_get_timecounter(void)
{
return NULL;
}
#endif

#endif
Loading

0 comments on commit 8a4da6e

Please sign in to comment.