@@ -1177,11 +1177,6 @@ config PLAT_PXA
config PLAT_VERSATILE
bool
-config ARM_TIMER_SP804
- bool
- select CLKSRC_MMIO
- select HAVE_SCHED_CLOCK
-
source arch/arm/mm/Kconfig
config ARM_NR_BANKS
@@ -12,4 +12,3 @@ obj-$(CONFIG_SHARP_LOCOMO) += locomo.o
obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
obj-$(CONFIG_SHARP_SCOOP) += scoop.o
obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
-obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
@@ -27,14 +27,14 @@
#include <linux/smp.h>
#include <linux/amba/bus.h>
#include <linux/clk-provider.h>
+#include <clocksource/arm_timer.h>
+#include <clocksource/timer-sp.h>
#include <asm/arch_timer.h>
#include <asm/cacheflush.h>
#include <asm/cputype.h>
#include <asm/smp_plat.h>
#include <asm/smp_twd.h>
-#include <asm/hardware/arm_timer.h>
-#include <asm/hardware/timer-sp.h>
#include <asm/hardware/cache-l2x0.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
@@ -41,11 +41,11 @@
#include <linux/stat.h>
#include <linux/sys_soc.h>
#include <linux/termios.h>
+#include <clocksource/arm_timer.h>
#include <video/vga.h>
#include <mach/hardware.h>
#include <mach/platform.h>
-#include <asm/hardware/arm_timer.h>
#include <asm/setup.h>
#include <asm/param.h> /* HZ */
#include <asm/mach-types.h>
@@ -28,12 +28,13 @@
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/sys_soc.h>
+#include <clocksource/arm_timer.h>
+#include <clocksource/timer-sp.h>
#include <mach/hardware.h>
#include <mach/platform.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
-#include <asm/hardware/arm_timer.h>
#include <asm/hardware/icst.h>
#include <mach/cm.h>
@@ -45,7 +46,6 @@
#include <asm/mach/map.h>
#include <asm/mach/time.h>
-#include <asm/hardware/timer-sp.h>
#include <plat/clcd.h>
#include <plat/sched_clock.h>
@@ -31,11 +31,12 @@
#include <linux/amba/mmci.h>
#include <linux/gfp.h>
#include <linux/mtd/physmap.h>
+#include <clocksource/arm_timer.h>
+#include <clocksource/timer-sp.h>
#include <mach/hardware.h>
#include <asm/irq.h>
#include <asm/mach-types.h>
-#include <asm/hardware/arm_timer.h>
#include <asm/hardware/icst.h>
#include <asm/mach/arch.h>
@@ -45,7 +46,6 @@
#include <mach/platform.h>
#include <mach/irqs.h>
-#include <asm/hardware/timer-sp.h>
#include <plat/clcd.h>
#include <plat/sched_clock.h>
@@ -38,9 +38,10 @@
#include <linux/clkdev.h>
#include <linux/mtd/physmap.h>
#include <linux/bitops.h>
+#include <clocksource/arm_timer.h>
+#include <clocksource/timer-sp.h>
#include <asm/irq.h>
-#include <asm/hardware/arm_timer.h>
#include <asm/hardware/icst.h>
#include <asm/mach-types.h>
@@ -50,7 +51,6 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
#include <mach/platform.h>
-#include <asm/hardware/timer-sp.h>
#include <plat/clcd.h>
#include <plat/sched_clock.h>
@@ -11,16 +11,15 @@
#include <linux/clkdev.h>
#include <linux/vexpress.h>
#include <linux/irqchip/arm-gic.h>
+#include <clocksource/arm_timer.h>
+#include <clocksource/timer-sp.h>
-#include <asm/hardware/arm_timer.h>
#include <asm/hardware/cache-l2x0.h>
#include <asm/smp_scu.h>
#include <asm/smp_twd.h>
#include <mach/ct-ca9x4.h>
-#include <asm/hardware/timer-sp.h>
-
#include <asm/mach/map.h>
#include <asm/mach/time.h>
@@ -21,6 +21,8 @@
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/vexpress.h>
+#include <clocksource/arm_timer.h>
+#include <clocksource/timer-sp.h>
#include <asm/arch_timer.h>
#include <asm/mach-types.h>
@@ -29,9 +31,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
-#include <asm/hardware/arm_timer.h>
#include <asm/hardware/cache-l2x0.h>
-#include <asm/hardware/timer-sp.h>
#include <mach/ct-ca9x4.h>
#include <mach/motherboard.h>
@@ -63,6 +63,11 @@ config CLKSRC_DBX500_PRCMU_SCHED_CLOCK
config ARM_ARCH_TIMER
bool
+config ARM_TIMER_SP804
+ bool
+ select CLKSRC_MMIO
+ select HAVE_SCHED_CLOCK
+
config CLKSRC_METAG_GENERIC
def_bool y if METAG
help
@@ -22,4 +22,5 @@ obj-$(CONFIG_VT8500_TIMER) += vt8500_timer.o
obj-$(CONFIG_CLKSRC_EXYNOS_MCT) += exynos_mct.o
obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o
+obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
obj-$(CONFIG_CLKSRC_METAG_GENERIC) += metag_generic.o
similarity index 99%
rename from arch/arm/common/timer-sp.c
rename to drivers/clocksource/timer-sp.c
@@ -25,9 +25,9 @@
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/io.h>
+#include <clocksource/arm_timer.h>
#include <asm/sched_clock.h>
-#include <asm/hardware/arm_timer.h>
static long __init sp804_get_clock_rate(const char *name)
{
similarity index 93%
rename from arch/arm/include/asm/hardware/arm_timer.h
rename to include/clocksource/arm_timer.h
@@ -1,5 +1,5 @@
-#ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H
-#define __ASM_ARM_HARDWARE_ARM_TIMER_H
+#ifndef __CLOCKSOURCE_ARM_TIMER_H
+#define __CLOCKSOURCE_ARM_TIMER_H
/*
* ARM timer implementation, found in Integrator, Versatile and Realview
similarity index 87%
rename from arch/arm/include/asm/hardware/timer-sp.h
rename to include/clocksource/timer-sp.h
@@ -1,3 +1,6 @@
+#ifndef __TIMER_SP_H
+#define __TIMER_SP_H
+
void __sp804_clocksource_and_sched_clock_init(void __iomem *,
const char *, int);
@@ -13,3 +16,4 @@ static inline void sp804_clocksource_and_sched_clock_init(void __iomem *base,
}
void sp804_clockevents_init(void __iomem *, unsigned int, const char *);
+#endif /* __TIMER_SP_H */
All clocksource drivers should be moved into drivers/clocksource directory, since it's necessary for integrating them into clocksource_of infrastructure. Move ARM SP804 timer driver from arch/arm directory into drivers/clocksource directory. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> --- arch/arm/Kconfig | 5 ----- arch/arm/common/Makefile | 1 - arch/arm/mach-highbank/highbank.c | 4 ++-- arch/arm/mach-integrator/integrator_ap.c | 2 +- arch/arm/mach-integrator/integrator_cp.c | 4 ++-- arch/arm/mach-realview/core.c | 4 ++-- arch/arm/mach-versatile/core.c | 4 ++-- arch/arm/mach-vexpress/ct-ca9x4.c | 5 ++--- arch/arm/mach-vexpress/v2m.c | 4 ++-- drivers/clocksource/Kconfig | 5 +++++ drivers/clocksource/Makefile | 1 + {arch/arm/common => drivers/clocksource}/timer-sp.c | 2 +- .../arm/include/asm/hardware => include/clocksource}/arm_timer.h | 4 ++-- {arch/arm/include/asm/hardware => include/clocksource}/timer-sp.h | 4 ++++ 14 files changed, 26 insertions(+), 23 deletions(-) rename {arch/arm/common => drivers/clocksource}/timer-sp.c (99%) rename {arch/arm/include/asm/hardware => include/clocksource}/arm_timer.h (93%) rename {arch/arm/include/asm/hardware => include/clocksource}/timer-sp.h (87%)