From 547046f2f09f1837d39619afbc7a6e35673d7c98 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 8 Nov 2012 10:50:55 -0700 Subject: cris: move usec/nsec conversion to do_slow_gettimeoffset Move usec to nsec conversion from arch_gettimeoffset() to do_slow_gettimeoffset(); in a future patch, do_slow_gettimeoffset() will be used directly as the implementation of arch_gettimeoffset(), so needs to perform all required calculations. Cc: Mikael Starvik Cc: linux-cris-kernel@axis.com Acked-by: Jesper Nilsson Signed-off-by: Stephen Warren --- arch/cris/arch-v10/kernel/time.c | 4 ++-- arch/cris/kernel/time.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c index bcffcb6a9415..162892f24a20 100644 --- a/arch/cris/arch-v10/kernel/time.c +++ b/arch/cris/arch-v10/kernel/time.c @@ -65,8 +65,8 @@ unsigned long do_slow_gettimeoffset(void) */ count = *R_TIMER0_DATA; - /* Convert timer value to usec */ - return (TIMER0_DIV - count) * ((NSEC_PER_SEC/1000)/HZ)/TIMER0_DIV; + /* Convert timer value to nsec */ + return (TIMER0_DIV - count) * (NSEC_PER_SEC/HZ)/TIMER0_DIV; } /* Excerpt from the Etrax100 HSDD about the built-in watchdog: diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c index 277ffc459e4b..b063c9217b5c 100644 --- a/arch/cris/kernel/time.c +++ b/arch/cris/kernel/time.c @@ -46,7 +46,7 @@ static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset; u32 arch_gettimeoffset(void) { - return do_gettimeoffset() * 1000; + return do_gettimeoffset(); } #endif -- cgit v1.2.3 From 7b1f62076bba10786d2118006ae68ac120cd6c56 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 7 Nov 2012 17:58:54 -0700 Subject: time: convert arch_gettimeoffset to a pointer Currently, whenever CONFIG_ARCH_USES_GETTIMEOFFSET is enabled, each arch core provides a single implementation of arch_gettimeoffset(). In many cases, different sub-architectures, different machines, or different timer providers exist, and so the arch ends up implementing arch_gettimeoffset() as a call-through-pointer anyway. Examples are ARM, Cris, M68K, and it's arguable that the remaining architectures, M32R and Blackfin, should be doing this anyway. Modify arch_gettimeoffset so that it itself is a function pointer, which the arch initializes. This will allow later changes to move the initialization of this function into individual machine support or timer drivers. This is particularly useful for code in drivers/clocksource which should rely on an arch-independant mechanism to register their implementation of arch_gettimeoffset(). This patch also converts the Cris architecture to set arch_gettimeoffset directly to the final implementation in time_init(), because Cris already had separate time_init() functions per sub-architecture. M68K and ARM are converted to set arch_gettimeoffset to the final implementation in later patches, because they already have function pointers in place for this purpose. Cc: Russell King Cc: Mike Frysinger Cc: Mikael Starvik Cc: Hirokazu Takata Cc: Thomas Gleixner Acked-by: Geert Uytterhoeven Acked-by: Jesper Nilsson Acked-by: John Stultz Signed-off-by: Stephen Warren --- arch/arm/kernel/time.c | 6 +++++- arch/blackfin/kernel/time.c | 6 +++++- arch/cris/arch-v10/kernel/time.c | 6 ++++-- arch/cris/kernel/time.c | 11 ----------- arch/m32r/kernel/time.c | 4 +++- arch/m68k/kernel/time.c | 16 ++++++++++------ include/linux/time.h | 4 +--- kernel/time/timekeeping.c | 26 ++++++++++++++++++++------ 8 files changed, 48 insertions(+), 31 deletions(-) diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 09be0c3c9069..b0190b41cb33 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -70,7 +70,7 @@ EXPORT_SYMBOL(profile_pc); #endif #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET -u32 arch_gettimeoffset(void) +static u32 arm_gettimeoffset(void) { if (system_timer->offset != NULL) return system_timer->offset() * 1000; @@ -164,6 +164,10 @@ device_initcall(timer_init_syscore_ops); void __init time_init(void) { +#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET + arch_gettimeoffset = arm_gettimeoffset; +#endif + system_timer = machine_desc->timer; system_timer->init(); sched_clock_postinit(); diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c index 2310b249675f..3126b920a4a5 100644 --- a/arch/blackfin/kernel/time.c +++ b/arch/blackfin/kernel/time.c @@ -85,7 +85,7 @@ time_sched_init(irqreturn_t(*timer_routine) (int, void *)) /* * Should return useconds since last timer tick */ -u32 arch_gettimeoffset(void) +static u32 blackfin_gettimeoffset(void) { unsigned long offset; unsigned long clocks_per_jiffy; @@ -141,6 +141,10 @@ void read_persistent_clock(struct timespec *ts) void __init time_init(void) { +#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET + arch_gettimeoffset = blackfin_gettimeoffset; +#endif + #ifdef CONFIG_RTC_DRV_BFIN /* [#2663] hack to filter junk RTC values that would cause * userspace to have to deal with time values greater than diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c index 162892f24a20..fce7c541d70d 100644 --- a/arch/cris/arch-v10/kernel/time.c +++ b/arch/cris/arch-v10/kernel/time.c @@ -55,9 +55,9 @@ unsigned long get_ns_in_jiffie(void) return ns; } -unsigned long do_slow_gettimeoffset(void) +static u32 cris_v10_gettimeoffset(void) { - unsigned long count; + u32 count; /* The timer interrupt comes from Etrax timer 0. In order to get * better precision, we check the current value. It might have @@ -191,6 +191,8 @@ static struct irqaction irq2 = { void __init time_init(void) { + arch_gettimeoffset = cris_v10_gettimeoffset; + /* probe for the RTC and read it if it exists * Before the RTC can be probed the loops_per_usec variable needs * to be initialized to make usleep work. A better value for diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c index b063c9217b5c..fe6acdabbc8d 100644 --- a/arch/cris/kernel/time.c +++ b/arch/cris/kernel/time.c @@ -39,17 +39,6 @@ extern unsigned long loops_per_jiffy; /* init/main.c */ unsigned long loops_per_usec; - -#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET -extern unsigned long do_slow_gettimeoffset(void); -static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset; - -u32 arch_gettimeoffset(void) -{ - return do_gettimeoffset(); -} -#endif - int set_rtc_mmss(unsigned long nowtime) { D(printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime)); diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c index 84dd04048db9..1a15f81ea1bd 100644 --- a/arch/m32r/kernel/time.c +++ b/arch/m32r/kernel/time.c @@ -57,7 +57,7 @@ extern void smp_local_timer_interrupt(void); static unsigned long latch; -u32 arch_gettimeoffset(void) +static u32 m32r_gettimeoffset(void) { unsigned long elapsed_time = 0; /* [us] */ @@ -165,6 +165,8 @@ void read_persistent_clock(struct timespec *ts) void __init time_init(void) { + arch_gettimeoffset = m32r_gettimeoffset; + #if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \ || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \ || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index 5d0bcaad2e55..c2994c8c30d5 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c @@ -80,14 +80,9 @@ void read_persistent_clock(struct timespec *ts) } } -void __init time_init(void) -{ - mach_sched_init(timer_interrupt); -} - #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET -u32 arch_gettimeoffset(void) +static u32 m68k_gettimeoffset(void) { return mach_gettimeoffset() * 1000; } @@ -106,3 +101,12 @@ static int __init rtc_init(void) module_init(rtc_init); #endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */ + +void __init time_init(void) +{ +#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET + arch_gettimeoffset = m68k_gettimeoffset; +#endif + + mach_sched_init(timer_interrupt); +} diff --git a/include/linux/time.h b/include/linux/time.h index 4d358e9d10f1..05e32a72103c 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -142,9 +142,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta); * finer then tick granular time. */ #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET -extern u32 arch_gettimeoffset(void); -#else -static inline u32 arch_gettimeoffset(void) { return 0; } +extern u32 (*arch_gettimeoffset)(void); #endif extern void do_gettimeofday(struct timeval *tv); diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index cbc6acb0db3f..8ed934601587 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -135,6 +135,20 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) } /* Timekeeper helper functions. */ + +#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET +u32 (*arch_gettimeoffset)(void); + +u32 get_arch_timeoffset(void) +{ + if (likely(arch_gettimeoffset)) + return arch_gettimeoffset(); + return 0; +} +#else +static inline u32 get_arch_timeoffset(void) { return 0; } +#endif + static inline s64 timekeeping_get_ns(struct timekeeper *tk) { cycle_t cycle_now, cycle_delta; @@ -151,8 +165,8 @@ static inline s64 timekeeping_get_ns(struct timekeeper *tk) nsec = cycle_delta * tk->mult + tk->xtime_nsec; nsec >>= tk->shift; - /* If arch requires, add in gettimeoffset() */ - return nsec + arch_gettimeoffset(); + /* If arch requires, add in get_arch_timeoffset() */ + return nsec + get_arch_timeoffset(); } static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk) @@ -171,8 +185,8 @@ static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk) /* convert delta to nanoseconds. */ nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift); - /* If arch requires, add in gettimeoffset() */ - return nsec + arch_gettimeoffset(); + /* If arch requires, add in get_arch_timeoffset() */ + return nsec + get_arch_timeoffset(); } static RAW_NOTIFIER_HEAD(pvclock_gtod_chain); @@ -254,8 +268,8 @@ static void timekeeping_forward_now(struct timekeeper *tk) tk->xtime_nsec += cycle_delta * tk->mult; - /* If arch requires, add in gettimeoffset() */ - tk->xtime_nsec += (u64)arch_gettimeoffset() << tk->shift; + /* If arch requires, add in get_arch_timeoffset() */ + tk->xtime_nsec += (u64)get_arch_timeoffset() << tk->shift; tk_normalize_xtime(tk); -- cgit v1.2.3 From c8d5ba1891eda2aa63800f052cb5af128283d130 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 8 Nov 2012 11:34:55 -0700 Subject: m68k: set arch_gettimeoffset directly remove m68k's mach_gettimeoffset function pointer, and instead directly set the arch_gettimeoffset function pointer. This requires multiplying all function results by 1000, since the removed m68k_gettimeoffset() did this. Also, s/unsigned long/u32/ just to make the function prototypes exactly match that of arch_gettimeoffset. Cc: Joshua Thompson Cc: Sam Creasey Acked-by: Geert Uytterhoeven Acked-by: Phil Blundell Signed-off-by: Stephen Warren --- arch/m68k/amiga/config.c | 10 +++++----- arch/m68k/apollo/config.c | 9 ++++----- arch/m68k/atari/config.c | 4 ++-- arch/m68k/atari/time.c | 6 +++--- arch/m68k/bvme6000/config.c | 10 +++++----- arch/m68k/hp300/config.c | 2 +- arch/m68k/hp300/time.c | 4 ++-- arch/m68k/hp300/time.h | 2 +- arch/m68k/include/asm/machdep.h | 2 +- arch/m68k/kernel/setup_mm.c | 1 - arch/m68k/kernel/time.c | 9 --------- arch/m68k/mac/config.c | 4 ++-- arch/m68k/mac/via.c | 4 ++-- arch/m68k/mvme147/config.c | 8 ++++---- arch/m68k/mvme16x/config.c | 8 ++++---- arch/m68k/q40/config.c | 8 ++++---- arch/m68k/sun3/config.c | 4 ++-- arch/m68k/sun3/intersil.c | 4 ++-- arch/m68k/sun3x/config.c | 2 +- arch/m68k/sun3x/time.c | 2 +- arch/m68k/sun3x/time.h | 2 +- 21 files changed, 47 insertions(+), 58 deletions(-) diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index ee01b7a38e58..b819390e29cd 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -95,7 +95,7 @@ static void amiga_sched_init(irq_handler_t handler); static void amiga_get_model(char *model); static void amiga_get_hardware_list(struct seq_file *m); /* amiga specific timer functions */ -static unsigned long amiga_gettimeoffset(void); +static u32 amiga_gettimeoffset(void); extern void amiga_mksound(unsigned int count, unsigned int ticks); static void amiga_reset(void); extern void amiga_init_sound(void); @@ -377,7 +377,7 @@ void __init config_amiga(void) mach_init_IRQ = amiga_init_IRQ; mach_get_model = amiga_get_model; mach_get_hardware_list = amiga_get_hardware_list; - mach_gettimeoffset = amiga_gettimeoffset; + arch_gettimeoffset = amiga_gettimeoffset; /* * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI @@ -482,10 +482,10 @@ static void __init amiga_sched_init(irq_handler_t timer_routine) #define TICK_SIZE 10000 /* This is always executed with interrupts disabled. */ -static unsigned long amiga_gettimeoffset(void) +static u32 amiga_gettimeoffset(void) { unsigned short hi, lo, hi2; - unsigned long ticks, offset = 0; + u32 ticks, offset = 0; /* read CIA B timer A current value */ hi = ciab.tahi; @@ -507,7 +507,7 @@ static unsigned long amiga_gettimeoffset(void) ticks = jiffy_ticks - ticks; ticks = (10000 * ticks) / jiffy_ticks; - return ticks + offset; + return (ticks + offset) * 1000; } static void amiga_reset(void) __noreturn; diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index f5565d6eeb8e..3ea56b90e718 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -26,7 +26,7 @@ u_long apollo_model; extern void dn_sched_init(irq_handler_t handler); extern void dn_init_IRQ(void); -extern unsigned long dn_gettimeoffset(void); +extern u32 dn_gettimeoffset(void); extern int dn_dummy_hwclk(int, struct rtc_time *); extern int dn_dummy_set_clock_mmss(unsigned long); extern void dn_dummy_reset(void); @@ -151,7 +151,7 @@ void __init config_apollo(void) mach_sched_init=dn_sched_init; /* */ mach_init_IRQ=dn_init_IRQ; - mach_gettimeoffset = dn_gettimeoffset; + arch_gettimeoffset = dn_gettimeoffset; mach_max_dma_address = 0xffffffff; mach_hwclk = dn_dummy_hwclk; /* */ mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */ @@ -203,10 +203,9 @@ void dn_sched_init(irq_handler_t timer_routine) pr_err("Couldn't register timer interrupt\n"); } -unsigned long dn_gettimeoffset(void) { - +u32 dn_gettimeoffset(void) +{ return 0xdeadbeef; - } int dn_dummy_hwclk(int op, struct rtc_time *t) { diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index d8eb32747ac5..037c11c99331 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -74,7 +74,7 @@ static void atari_heartbeat(int on); /* atari specific timer functions (in time.c) */ extern void atari_sched_init(irq_handler_t); -extern unsigned long atari_gettimeoffset (void); +extern u32 atari_gettimeoffset(void); extern int atari_mste_hwclk (int, struct rtc_time *); extern int atari_tt_hwclk (int, struct rtc_time *); extern int atari_mste_set_clock_mmss (unsigned long); @@ -204,7 +204,7 @@ void __init config_atari(void) mach_init_IRQ = atari_init_IRQ; mach_get_model = atari_get_model; mach_get_hardware_list = atari_get_hardware_list; - mach_gettimeoffset = atari_gettimeoffset; + arch_gettimeoffset = atari_gettimeoffset; mach_reset = atari_reset; mach_max_dma_address = 0xffffff; #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c index c0cc68a2c829..da8f981c36d6 100644 --- a/arch/m68k/atari/time.c +++ b/arch/m68k/atari/time.c @@ -42,9 +42,9 @@ atari_sched_init(irq_handler_t timer_routine) #define TICK_SIZE 10000 /* This is always executed with interrupts disabled. */ -unsigned long atari_gettimeoffset (void) +u32 atari_gettimeoffset(void) { - unsigned long ticks, offset = 0; + u32 ticks, offset = 0; /* read MFP timer C current value */ ticks = st_mfp.tim_dt_c; @@ -57,7 +57,7 @@ unsigned long atari_gettimeoffset (void) ticks = INT_TICKS - ticks; ticks = ticks * 10000L / INT_TICKS; - return ticks + offset; + return (ticks + offset) * 1000; } diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c index 0bf850a20ea2..8943aa4c18e6 100644 --- a/arch/m68k/bvme6000/config.c +++ b/arch/m68k/bvme6000/config.c @@ -38,7 +38,7 @@ static void bvme6000_get_model(char *model); extern void bvme6000_sched_init(irq_handler_t handler); -extern unsigned long bvme6000_gettimeoffset (void); +extern u32 bvme6000_gettimeoffset(void); extern int bvme6000_hwclk (int, struct rtc_time *); extern int bvme6000_set_clock_mmss (unsigned long); extern void bvme6000_reset (void); @@ -110,7 +110,7 @@ void __init config_bvme6000(void) mach_max_dma_address = 0xffffffff; mach_sched_init = bvme6000_sched_init; mach_init_IRQ = bvme6000_init_IRQ; - mach_gettimeoffset = bvme6000_gettimeoffset; + arch_gettimeoffset = bvme6000_gettimeoffset; mach_hwclk = bvme6000_hwclk; mach_set_clock_mmss = bvme6000_set_clock_mmss; mach_reset = bvme6000_reset; @@ -216,13 +216,13 @@ void bvme6000_sched_init (irq_handler_t timer_routine) * results... */ -unsigned long bvme6000_gettimeoffset (void) +u32 bvme6000_gettimeoffset(void) { volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE; unsigned char msr = rtc->msr & 0xc0; unsigned char t1int, t1op; - unsigned long v = 800000, ov; + u32 v = 800000, ov; rtc->msr = 0; /* Ensure timer registers accessible */ @@ -246,7 +246,7 @@ unsigned long bvme6000_gettimeoffset (void) v += 10000; /* Int pending, + 10ms */ rtc->msr = msr; - return v; + return v * 1000; } /* diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c index bf16af1edacf..b7609f791522 100644 --- a/arch/m68k/hp300/config.c +++ b/arch/m68k/hp300/config.c @@ -251,7 +251,7 @@ void __init config_hp300(void) mach_sched_init = hp300_sched_init; mach_init_IRQ = hp300_init_IRQ; mach_get_model = hp300_get_model; - mach_gettimeoffset = hp300_gettimeoffset; + arch_gettimeoffset = hp300_gettimeoffset; mach_hwclk = hp300_hwclk; mach_get_ss = hp300_get_ss; mach_reset = hp300_reset; diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index 29a71be9fa5b..749543b425a4 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c @@ -46,7 +46,7 @@ static irqreturn_t hp300_tick(int irq, void *dev_id) return vector(irq, NULL); } -unsigned long hp300_gettimeoffset(void) +u32 hp300_gettimeoffset(void) { /* Read current timer 1 value */ unsigned char lsb, msb1, msb2; @@ -59,7 +59,7 @@ unsigned long hp300_gettimeoffset(void) /* A carry happened while we were reading. Read it again */ lsb = in_8(CLOCKBASE + 7); ticks = INTVAL - ((msb2 << 8) | lsb); - return (USECS_PER_JIFFY * ticks) / INTVAL; + return ((USECS_PER_JIFFY * ticks) / INTVAL) * 1000; } void __init hp300_sched_init(irq_handler_t vector) diff --git a/arch/m68k/hp300/time.h b/arch/m68k/hp300/time.h index 7b98242960de..f5583ec4033d 100644 --- a/arch/m68k/hp300/time.h +++ b/arch/m68k/hp300/time.h @@ -1,2 +1,2 @@ extern void hp300_sched_init(irq_handler_t vector); -extern unsigned long hp300_gettimeoffset(void); +extern u32 hp300_gettimeoffset(void); diff --git a/arch/m68k/include/asm/machdep.h b/arch/m68k/include/asm/machdep.h index 825c1c813196..953ca21da8ee 100644 --- a/arch/m68k/include/asm/machdep.h +++ b/arch/m68k/include/asm/machdep.h @@ -3,6 +3,7 @@ #include #include +#include struct pt_regs; struct mktime; @@ -16,7 +17,6 @@ extern void (*mach_init_IRQ) (void); extern void (*mach_get_model) (char *model); extern void (*mach_get_hardware_list) (struct seq_file *m); /* machine dependent timer functions */ -extern unsigned long (*mach_gettimeoffset)(void); extern int (*mach_hwclk)(int, struct rtc_time*); extern unsigned int (*mach_get_ss)(void); extern int (*mach_get_rtc_pll)(struct rtc_pll_info *); diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index d872ce4807c9..80cfbe56ea32 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c @@ -84,7 +84,6 @@ void (*mach_init_IRQ) (void) __initdata = NULL; void (*mach_get_model) (char *model); void (*mach_get_hardware_list) (struct seq_file *m); /* machine dependent timer functions */ -unsigned long (*mach_gettimeoffset) (void); int (*mach_hwclk) (int, struct rtc_time*); EXPORT_SYMBOL(mach_hwclk); int (*mach_set_clock_mmss) (unsigned long); diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index c2994c8c30d5..bea6bcf8f9b8 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c @@ -82,11 +82,6 @@ void read_persistent_clock(struct timespec *ts) #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET -static u32 m68k_gettimeoffset(void) -{ - return mach_gettimeoffset() * 1000; -} - static int __init rtc_init(void) { struct platform_device *pdev; @@ -104,9 +99,5 @@ module_init(rtc_init); void __init time_init(void) { -#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET - arch_gettimeoffset = m68k_gettimeoffset; -#endif - mach_sched_init(timer_interrupt); } diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index d9f62e0f46c0..afb95d5fb26b 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -52,7 +52,7 @@ struct mac_booter_data mac_bi_data; static unsigned long mac_orig_videoaddr; /* Mac specific timer functions */ -extern unsigned long mac_gettimeoffset(void); +extern u32 mac_gettimeoffset(void); extern int mac_hwclk(int, struct rtc_time *); extern int mac_set_clock_mmss(unsigned long); extern void iop_preinit(void); @@ -177,7 +177,7 @@ void __init config_mac(void) mach_sched_init = mac_sched_init; mach_init_IRQ = mac_init_IRQ; mach_get_model = mac_get_model; - mach_gettimeoffset = mac_gettimeoffset; + arch_gettimeoffset = mac_gettimeoffset; mach_hwclk = mac_hwclk; mach_set_clock_mmss = mac_set_clock_mmss; mach_reset = mac_reset; diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 2d85662715fb..5d1458bb871b 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -327,7 +327,7 @@ void via_debug_dump(void) * TBI: get time offset between scheduling timer ticks */ -unsigned long mac_gettimeoffset (void) +u32 mac_gettimeoffset(void) { unsigned long ticks, offset = 0; @@ -341,7 +341,7 @@ unsigned long mac_gettimeoffset (void) ticks = MAC_CLOCK_TICK - ticks; ticks = ticks * 10000L / MAC_CLOCK_TICK; - return ticks + offset; + return (ticks + offset) * 1000; } /* diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index a41c09149e23..1c6262803b94 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c @@ -37,7 +37,7 @@ static void mvme147_get_model(char *model); extern void mvme147_sched_init(irq_handler_t handler); -extern unsigned long mvme147_gettimeoffset (void); +extern u32 mvme147_gettimeoffset(void); extern int mvme147_hwclk (int, struct rtc_time *); extern int mvme147_set_clock_mmss (unsigned long); extern void mvme147_reset (void); @@ -88,7 +88,7 @@ void __init config_mvme147(void) mach_max_dma_address = 0x01000000; mach_sched_init = mvme147_sched_init; mach_init_IRQ = mvme147_init_IRQ; - mach_gettimeoffset = mvme147_gettimeoffset; + arch_gettimeoffset = mvme147_gettimeoffset; mach_hwclk = mvme147_hwclk; mach_set_clock_mmss = mvme147_set_clock_mmss; mach_reset = mvme147_reset; @@ -127,7 +127,7 @@ void mvme147_sched_init (irq_handler_t timer_routine) /* This is always executed with interrupts disabled. */ /* XXX There are race hazards in this code XXX */ -unsigned long mvme147_gettimeoffset (void) +u32 mvme147_gettimeoffset(void) { volatile unsigned short *cp = (volatile unsigned short *)0xfffe1012; unsigned short n; @@ -137,7 +137,7 @@ unsigned long mvme147_gettimeoffset (void) n = *cp; n -= PCC_TIMER_PRELOAD; - return (unsigned long)n * 25 / 4; + return ((unsigned long)n * 25 / 4) * 1000; } static int bcd2int (unsigned char b) diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index b6d7d8a7a3dd..080a342458a1 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c @@ -43,7 +43,7 @@ static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; static void mvme16x_get_model(char *model); extern void mvme16x_sched_init(irq_handler_t handler); -extern unsigned long mvme16x_gettimeoffset (void); +extern u32 mvme16x_gettimeoffset(void); extern int mvme16x_hwclk (int, struct rtc_time *); extern int mvme16x_set_clock_mmss (unsigned long); extern void mvme16x_reset (void); @@ -289,7 +289,7 @@ void __init config_mvme16x(void) mach_max_dma_address = 0xffffffff; mach_sched_init = mvme16x_sched_init; mach_init_IRQ = mvme16x_init_IRQ; - mach_gettimeoffset = mvme16x_gettimeoffset; + arch_gettimeoffset = mvme16x_gettimeoffset; mach_hwclk = mvme16x_hwclk; mach_set_clock_mmss = mvme16x_set_clock_mmss; mach_reset = mvme16x_reset; @@ -405,9 +405,9 @@ void mvme16x_sched_init (irq_handler_t timer_routine) /* This is always executed with interrupts disabled. */ -unsigned long mvme16x_gettimeoffset (void) +u32 mvme16x_gettimeoffset(void) { - return (*(volatile unsigned long *)0xfff42008); + return (*(volatile u32 *)0xfff42008) * 1000; } int bcd2int (unsigned char b) diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 1adb5b7b0d1a..658542b914fc 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -40,7 +40,7 @@ extern void q40_init_IRQ(void); static void q40_get_model(char *model); extern void q40_sched_init(irq_handler_t handler); -static unsigned long q40_gettimeoffset(void); +static u32 q40_gettimeoffset(void); static int q40_hwclk(int, struct rtc_time *); static unsigned int q40_get_ss(void); static int q40_set_clock_mmss(unsigned long); @@ -170,7 +170,7 @@ void __init config_q40(void) mach_sched_init = q40_sched_init; mach_init_IRQ = q40_init_IRQ; - mach_gettimeoffset = q40_gettimeoffset; + arch_gettimeoffset = q40_gettimeoffset; mach_hwclk = q40_hwclk; mach_get_ss = q40_get_ss; mach_get_rtc_pll = q40_get_rtc_pll; @@ -204,9 +204,9 @@ int q40_parse_bootinfo(const struct bi_record *rec) } -static unsigned long q40_gettimeoffset(void) +static u32 q40_gettimeoffset(void) { - return 5000 * (ql_ticks != 0); + return 5000 * (ql_ticks != 0) * 1000; } diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 2ca25bd01a96..f59ec58083f8 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -36,7 +36,7 @@ char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; -extern unsigned long sun3_gettimeoffset(void); +extern u32 sun3_gettimeoffset(void); static void sun3_sched_init(irq_handler_t handler); extern void sun3_get_model (char* model); extern int sun3_hwclk(int set, struct rtc_time *t); @@ -141,7 +141,7 @@ void __init config_sun3(void) mach_sched_init = sun3_sched_init; mach_init_IRQ = sun3_init_IRQ; mach_reset = sun3_reboot; - mach_gettimeoffset = sun3_gettimeoffset; + arch_gettimeoffset = sun3_gettimeoffset; mach_get_model = sun3_get_model; mach_hwclk = sun3_hwclk; mach_halt = sun3_halt; diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c index 94fe8016f1f0..889829e11f1d 100644 --- a/arch/m68k/sun3/intersil.c +++ b/arch/m68k/sun3/intersil.c @@ -23,9 +23,9 @@ #define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE) /* does this need to be implemented? */ -unsigned long sun3_gettimeoffset(void) +u32 sun3_gettimeoffset(void) { - return 1; + return 1000; } diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index dd306c84d36d..0532d64d191e 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c @@ -48,7 +48,7 @@ void __init config_sun3x(void) mach_sched_init = sun3x_sched_init; mach_init_IRQ = sun3_init_IRQ; - mach_gettimeoffset = sun3x_gettimeoffset; + arch_gettimeoffset = sun3x_gettimeoffset; mach_reset = sun3x_reboot; mach_hwclk = sun3x_hwclk; diff --git a/arch/m68k/sun3x/time.c b/arch/m68k/sun3x/time.c index 1d0a72480409..c8eb08add6b0 100644 --- a/arch/m68k/sun3x/time.c +++ b/arch/m68k/sun3x/time.c @@ -71,7 +71,7 @@ int sun3x_hwclk(int set, struct rtc_time *t) return 0; } /* Not much we can do here */ -unsigned long sun3x_gettimeoffset (void) +u32 sun3x_gettimeoffset(void) { return 0L; } diff --git a/arch/m68k/sun3x/time.h b/arch/m68k/sun3x/time.h index 6909e1297534..a4f9126be7e2 100644 --- a/arch/m68k/sun3x/time.h +++ b/arch/m68k/sun3x/time.h @@ -2,7 +2,7 @@ #define SUN3X_TIME_H extern int sun3x_hwclk(int set, struct rtc_time *t); -unsigned long sun3x_gettimeoffset (void); +u32 sun3x_gettimeoffset(void); void sun3x_sched_init(irq_handler_t vector); struct mostek_dt { -- cgit v1.2.3 From 23c197b77f9553c30f9c8a5ab41279a35f135f37 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 8 Nov 2012 11:51:58 -0700 Subject: ARM: set arch_gettimeoffset directly remove ARM's struct sys_timer .offset function pointer, and instead directly set the arch_gettimeoffset function pointer when the timer driver is initialized. This requires multiplying all function results by 1000, since the removed arm_gettimeoffset() did this. Also, s/unsigned long/u32/ just to make the function prototypes exactly match that of arch_gettimeoffset. Cc: Russell King Cc: Andrew Victor Cc: Nicolas Ferre Cc: Jean-Christophe Plagniol-Villard Cc: Hartley Sweeten Cc: Ryan Mallon Cc: Ben Dooks Cc: Kukjin Kim Signed-off-by: Stephen Warren --- arch/arm/include/asm/mach/time.h | 3 --- arch/arm/kernel/time.c | 14 -------------- arch/arm/mach-at91/at91x40_time.c | 8 +++++--- arch/arm/mach-ebsa110/core.c | 7 ++++--- arch/arm/mach-ep93xx/core.c | 29 ++++++++++++++++++----------- arch/arm/mach-h720x/common.c | 6 +++--- arch/arm/mach-h720x/common.h | 2 +- arch/arm/mach-h720x/cpu-h7201.c | 3 ++- arch/arm/mach-h720x/cpu-h7202.c | 3 ++- arch/arm/mach-rpc/time.c | 6 +++--- arch/arm/plat-samsung/time.c | 7 ++++--- 11 files changed, 42 insertions(+), 46 deletions(-) diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index 6ca945f534ab..cac8d9c7d5d9 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h @@ -35,9 +35,6 @@ struct sys_timer { void (*init)(void); void (*suspend)(void); void (*resume)(void); -#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET - unsigned long (*offset)(void); -#endif }; extern void timer_tick(void); diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index b0190b41cb33..ea36bfaeba91 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -69,16 +69,6 @@ unsigned long profile_pc(struct pt_regs *regs) EXPORT_SYMBOL(profile_pc); #endif -#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET -static u32 arm_gettimeoffset(void) -{ - if (system_timer->offset != NULL) - return system_timer->offset() * 1000; - - return 0; -} -#endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */ - #ifndef CONFIG_GENERIC_CLOCKEVENTS /* * Kernel system timer support. @@ -164,10 +154,6 @@ device_initcall(timer_init_syscore_ops); void __init time_init(void) { -#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET - arch_gettimeoffset = arm_gettimeoffset; -#endif - system_timer = machine_desc->timer; system_timer->init(); sched_clock_postinit(); diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c index 0e57e440c061..fb3c70124ac3 100644 --- a/arch/arm/mach-at91/at91x40_time.c +++ b/arch/arm/mach-at91/at91x40_time.c @@ -42,9 +42,10 @@ #define AT91_TC_CLK1BASE 0x40 #define AT91_TC_CLK2BASE 0x80 -static unsigned long at91x40_gettimeoffset(void) +static u32 at91x40_gettimeoffset(void) { - return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128)); + return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / + (AT91X40_MASTER_CLOCK / 128)) * 1000; } static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) @@ -64,6 +65,8 @@ void __init at91x40_timer_init(void) { unsigned int v; + arch_gettimeoffset = at91x40_gettimeoffset; + at91_tc_write(AT91_TC_BCR, 0); v = at91_tc_read(AT91_TC_BMR); v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE; @@ -82,6 +85,5 @@ void __init at91x40_timer_init(void) struct sys_timer at91x40_timer = { .init = at91x40_timer_init, - .offset = at91x40_gettimeoffset, }; diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c index f0fe6b5350e2..d96dd94fb582 100644 --- a/arch/arm/mach-ebsa110/core.c +++ b/arch/arm/mach-ebsa110/core.c @@ -158,7 +158,7 @@ static void __init ebsa110_init_early(void) * interrupt, then the PIT counter will roll over (ie, be negative). * This actually works out to be convenient. */ -static unsigned long ebsa110_gettimeoffset(void) +static u32 ebsa110_gettimeoffset(void) { unsigned long offset, count; @@ -181,7 +181,7 @@ static unsigned long ebsa110_gettimeoffset(void) */ offset = offset * (1000000 / HZ) / COUNT; - return offset; + return offset * 1000; } static irqreturn_t @@ -215,6 +215,8 @@ static struct irqaction ebsa110_timer_irq = { */ static void __init ebsa110_timer_init(void) { + arch_gettimeoffset = ebsa110_gettimeoffset; + /* * Timer 1, mode 2, LSB/MSB */ @@ -227,7 +229,6 @@ static void __init ebsa110_timer_init(void) static struct sys_timer ebsa110_timer = { .init = ebsa110_timer_init, - .offset = ebsa110_gettimeoffset, }; static struct plat_serial8250_port serial_platform_data[] = { diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index e85bf17f2d2a..6f48b87a1ace 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -140,11 +140,29 @@ static struct irqaction ep93xx_timer_irq = { .handler = ep93xx_timer_interrupt, }; +static u32 ep93xx_gettimeoffset(void) +{ + int offset; + + offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time; + + /* + * Timer 4 is based on a 983.04 kHz reference clock, + * so dividing by 983040 gives the fraction of a second, + * so dividing by 0.983040 converts to uS. + * Refactor the calculation to avoid overflow. + * Finally, multiply by 1000 to give nS. + */ + return (offset + (53 * offset / 3072)) * 1000; +} + static void __init ep93xx_timer_init(void) { u32 tmode = EP93XX_TIMER123_CONTROL_MODE | EP93XX_TIMER123_CONTROL_CLKSEL; + arch_gettimeoffset = ep93xx_gettimeoffset; + /* Enable periodic HZ timer. */ __raw_writel(tmode, EP93XX_TIMER1_CONTROL); __raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD); @@ -158,19 +176,8 @@ static void __init ep93xx_timer_init(void) setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq); } -static unsigned long ep93xx_gettimeoffset(void) -{ - int offset; - - offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time; - - /* Calculate (1000000 / 983040) * offset. */ - return offset + (53 * offset / 3072); -} - struct sys_timer ep93xx_timer = { .init = ep93xx_timer_init, - .offset = ep93xx_gettimeoffset, }; diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c index aa1331e86bcf..17ef91fa3d56 100644 --- a/arch/arm/mach-h720x/common.c +++ b/arch/arm/mach-h720x/common.c @@ -42,12 +42,12 @@ void __init arch_dma_init(dma_t *dma) } /* - * Return usecs since last timer reload + * Return nsecs since last timer reload * (timercount * (usecs perjiffie)) / (ticks per jiffie) */ -unsigned long h720x_gettimeoffset(void) +u32 h720x_gettimeoffset(void) { - return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH; + return ((CPU_REG(TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH) * 1000; } /* diff --git a/arch/arm/mach-h720x/common.h b/arch/arm/mach-h720x/common.h index 2489537d33dd..79cfb9706360 100644 --- a/arch/arm/mach-h720x/common.h +++ b/arch/arm/mach-h720x/common.h @@ -13,7 +13,7 @@ * */ -extern unsigned long h720x_gettimeoffset(void); +extern u32 h720x_gettimeoffset(void); extern void __init h720x_init_irq(void); extern void __init h720x_map_io(void); extern void h720x_restart(char, const char *); diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c index 24df2a349a98..ba349cffcd3a 100644 --- a/arch/arm/mach-h720x/cpu-h7201.c +++ b/arch/arm/mach-h720x/cpu-h7201.c @@ -46,6 +46,8 @@ static struct irqaction h7201_timer_irq = { */ void __init h7201_init_time(void) { + arch_gettimeoffset = h720x_gettimeoffset; + CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; @@ -56,5 +58,4 @@ void __init h7201_init_time(void) struct sys_timer h7201_timer = { .init = h7201_init_time, - .offset = h720x_gettimeoffset, }; diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c index c37d570b852d..fb9ca76c7313 100644 --- a/arch/arm/mach-h720x/cpu-h7202.c +++ b/arch/arm/mach-h720x/cpu-h7202.c @@ -180,6 +180,8 @@ static struct irqaction h7202_timer_irq = { */ void __init h7202_init_time(void) { + arch_gettimeoffset = h720x_gettimeoffset; + CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; @@ -190,7 +192,6 @@ void __init h7202_init_time(void) struct sys_timer h7202_timer = { .init = h7202_init_time, - .offset = h720x_gettimeoffset, }; void __init h7202_init_irq (void) diff --git a/arch/arm/mach-rpc/time.c b/arch/arm/mach-rpc/time.c index 581fca934bb3..6ddccb0210ac 100644 --- a/arch/arm/mach-rpc/time.c +++ b/arch/arm/mach-rpc/time.c @@ -24,7 +24,7 @@ #include -unsigned long ioc_timer_gettimeoffset(void) +static u32 ioc_timer_gettimeoffset(void) { unsigned int count1, count2, status; long offset; @@ -56,7 +56,7 @@ unsigned long ioc_timer_gettimeoffset(void) } offset = (LATCH - offset) * (tick_nsec / 1000); - return (offset + LATCH/2) / LATCH; + return ((offset + LATCH/2) / LATCH) * 1000; } void __init ioctime_init(void) @@ -84,12 +84,12 @@ static struct irqaction ioc_timer_irq = { */ static void __init ioc_timer_init(void) { + arch_gettimeoffset = ioc_timer_gettimeoffset; ioctime_init(); setup_irq(IRQ_TIMER0, &ioc_timer_irq); } struct sys_timer ioc_timer = { .init = ioc_timer_init, - .offset = ioc_timer_gettimeoffset, }; diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c index 60552e22f22e..67206df94aa8 100644 --- a/arch/arm/plat-samsung/time.c +++ b/arch/arm/plat-samsung/time.c @@ -95,7 +95,7 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks) * IRQs are disabled before entering here from do_gettimeofday() */ -static unsigned long s3c2410_gettimeoffset (void) +static u32 s3c2410_gettimeoffset(void) { unsigned long tdone; unsigned long tval; @@ -120,7 +120,7 @@ static unsigned long s3c2410_gettimeoffset (void) tdone += timer_startval; } - return timer_ticks_to_usec(tdone); + return timer_ticks_to_usec(tdone) * 1000; } @@ -273,6 +273,8 @@ static void __init s3c2410_timer_resources(void) static void __init s3c2410_timer_init(void) { + arch_gettimeoffset = s3c2410_gettimeoffset; + s3c2410_timer_resources(); s3c2410_timer_setup(); setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); @@ -280,6 +282,5 @@ static void __init s3c2410_timer_init(void) struct sys_timer s3c24xx_timer = { .init = s3c2410_timer_init, - .offset = s3c2410_gettimeoffset, .resume = s3c2410_timer_setup }; -- cgit v1.2.3 From 49356ae94c8238eb3945244f4e5a0a263eafba24 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 7 Nov 2012 16:32:41 -0700 Subject: ARM: at91: convert timer suspend/resume to clock_event_device Move at91's timer suspend/resume functions from struct sys_timer at91sam926x_timer into struct clock_event_device pit_clkevt. This will allow the sys_timer suspend/resume fields to be removed, and eventually lead to a complete removal of struct sys_timer. Cc: Andrew Victor Cc: Nicolas Ferre Acked-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Stephen Warren --- arch/arm/mach-at91/at91sam926x_time.c | 47 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c index 358412f1f5f8..f7191e11df27 100644 --- a/arch/arm/mach-at91/at91sam926x_time.c +++ b/arch/arm/mach-at91/at91sam926x_time.c @@ -104,12 +104,38 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev) } } +static void at91sam926x_pit_suspend(struct clock_event_device *cedev) +{ + /* Disable timer */ + pit_write(AT91_PIT_MR, 0); +} + +static void at91sam926x_pit_reset(void) +{ + /* Disable timer and irqs */ + pit_write(AT91_PIT_MR, 0); + + /* Clear any pending interrupts, wait for PIT to stop counting */ + while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0) + cpu_relax(); + + /* Start PIT but don't enable IRQ */ + pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); +} + +static void at91sam926x_pit_resume(struct clock_event_device *cedev) +{ + at91sam926x_pit_reset(); +} + static struct clock_event_device pit_clkevt = { .name = "pit", .features = CLOCK_EVT_FEAT_PERIODIC, .shift = 32, .rating = 100, .set_mode = pit_clkevt_mode, + .suspend = at91sam926x_pit_suspend, + .resume = at91sam926x_pit_resume, }; @@ -150,19 +176,6 @@ static struct irqaction at91sam926x_pit_irq = { .irq = NR_IRQS_LEGACY + AT91_ID_SYS, }; -static void at91sam926x_pit_reset(void) -{ - /* Disable timer and irqs */ - pit_write(AT91_PIT_MR, 0); - - /* Clear any pending interrupts, wait for PIT to stop counting */ - while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0) - cpu_relax(); - - /* Start PIT but don't enable IRQ */ - pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); -} - #ifdef CONFIG_OF static struct of_device_id pit_timer_ids[] = { { .compatible = "atmel,at91sam9260-pit" }, @@ -250,12 +263,6 @@ static void __init at91sam926x_pit_init(void) clockevents_register_device(&pit_clkevt); } -static void at91sam926x_pit_suspend(void) -{ - /* Disable timer */ - pit_write(AT91_PIT_MR, 0); -} - void __init at91sam926x_ioremap_pit(u32 addr) { #if defined(CONFIG_OF) @@ -275,6 +282,4 @@ void __init at91sam926x_ioremap_pit(u32 addr) struct sys_timer at91sam926x_timer = { .init = at91sam926x_pit_init, - .suspend = at91sam926x_pit_suspend, - .resume = at91sam926x_pit_reset, }; -- cgit v1.2.3 From 5b30d5bf8204e9b9837511cf72d051980dbb90a7 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 7 Nov 2012 16:34:13 -0700 Subject: ARM: pxa: convert timer suspend/resume to clock_event_device Move PXA's timer suspend/resume functions from struct sys_timer pxa_timer into struct clock_event_device ckevt_pxa_osmr0. This will allow the sys_timer suspend/resume fields to be removed, and eventually lead to a complete removal of struct sys_timer. Cc: Russell King Cc: Haojian Zhuang Acked-by: Eric Miao Signed-off-by: Stephen Warren --- arch/arm/mach-pxa/time.c | 76 ++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index 4bc47d63698b..ce58bc9acb14 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c @@ -89,12 +89,50 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) } } +#ifdef CONFIG_PM +static unsigned long osmr[4], oier, oscr; + +static void pxa_timer_suspend(struct clock_event_device *cedev) +{ + osmr[0] = readl_relaxed(OSMR0); + osmr[1] = readl_relaxed(OSMR1); + osmr[2] = readl_relaxed(OSMR2); + osmr[3] = readl_relaxed(OSMR3); + oier = readl_relaxed(OIER); + oscr = readl_relaxed(OSCR); +} + +static void pxa_timer_resume(struct clock_event_device *cedev) +{ + /* + * Ensure that we have at least MIN_OSCR_DELTA between match + * register 0 and the OSCR, to guarantee that we will receive + * the one-shot timer interrupt. We adjust OSMR0 in preference + * to OSCR to guarantee that OSCR is monotonically incrementing. + */ + if (osmr[0] - oscr < MIN_OSCR_DELTA) + osmr[0] += MIN_OSCR_DELTA; + + writel_relaxed(osmr[0], OSMR0); + writel_relaxed(osmr[1], OSMR1); + writel_relaxed(osmr[2], OSMR2); + writel_relaxed(osmr[3], OSMR3); + writel_relaxed(oier, OIER); + writel_relaxed(oscr, OSCR); +} +#else +#define pxa_timer_suspend NULL +#define pxa_timer_resume NULL +#endif + static struct clock_event_device ckevt_pxa_osmr0 = { .name = "osmr0", .features = CLOCK_EVT_FEAT_ONESHOT, .rating = 200, .set_next_event = pxa_osmr0_set_next_event, .set_mode = pxa_osmr0_set_mode, + .suspend = pxa_timer_suspend, + .resume = pxa_timer_resume, }; static struct irqaction pxa_ost0_irq = { @@ -127,44 +165,6 @@ static void __init pxa_timer_init(void) clockevents_register_device(&ckevt_pxa_osmr0); } -#ifdef CONFIG_PM -static unsigned long osmr[4], oier, oscr; - -static void pxa_timer_suspend(void) -{ - osmr[0] = readl_relaxed(OSMR0); - osmr[1] = readl_relaxed(OSMR1); - osmr[2] = readl_relaxed(OSMR2); - osmr[3] = readl_relaxed(OSMR3); - oier = readl_relaxed(OIER); - oscr = readl_relaxed(OSCR); -} - -static void pxa_timer_resume(void) -{ - /* - * Ensure that we have at least MIN_OSCR_DELTA between match - * register 0 and the OSCR, to guarantee that we will receive - * the one-shot timer interrupt. We adjust OSMR0 in preference - * to OSCR to guarantee that OSCR is monotonically incrementing. - */ - if (osmr[0] - oscr < MIN_OSCR_DELTA) - osmr[0] += MIN_OSCR_DELTA; - - writel_relaxed(osmr[0], OSMR0); - writel_relaxed(osmr[1], OSMR1); - writel_relaxed(osmr[2], OSMR2); - writel_relaxed(osmr[3], OSMR3); - writel_relaxed(oier, OIER); - writel_relaxed(oscr, OSCR); -} -#else -#define pxa_timer_suspend NULL -#define pxa_timer_resume NULL -#endif - struct sys_timer pxa_timer = { .init = pxa_timer_init, - .suspend = pxa_timer_suspend, - .resume = pxa_timer_resume, }; -- cgit v1.2.3 From e3cbfb6213757429694775aa7e97ee80c98ee2c6 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 7 Nov 2012 16:35:11 -0700 Subject: ARM: sa1100: convert timer suspend/resume to clock_event_device Move sa1100's timer suspend/resume functions from struct sys_timer sa1100_timer into struct clock_event_device ckevt_sa1100_osmr0. This will allow the sys_timer suspend/resume fields to be removed, and eventually lead to a complete removal of struct sys_timer. Signed-off-by: Stephen Warren --- arch/arm/mach-sa1100/time.c | 66 ++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c index 80702c9ecc77..164f8276233c 100644 --- a/arch/arm/mach-sa1100/time.c +++ b/arch/arm/mach-sa1100/time.c @@ -69,12 +69,45 @@ sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) } } +#ifdef CONFIG_PM +unsigned long osmr[4], oier; + +static void sa1100_timer_suspend(struct clock_event_device *cedev) +{ + osmr[0] = readl_relaxed(OSMR0); + osmr[1] = readl_relaxed(OSMR1); + osmr[2] = readl_relaxed(OSMR2); + osmr[3] = readl_relaxed(OSMR3); + oier = readl_relaxed(OIER); +} + +static void sa1100_timer_resume(struct clock_event_device *cedev) +{ + writel_relaxed(0x0f, OSSR); + writel_relaxed(osmr[0], OSMR0); + writel_relaxed(osmr[1], OSMR1); + writel_relaxed(osmr[2], OSMR2); + writel_relaxed(osmr[3], OSMR3); + writel_relaxed(oier, OIER); + + /* + * OSMR0 is the system timer: make sure OSCR is sufficiently behind + */ + writel_relaxed(OSMR0 - LATCH, OSCR); +} +#else +#define sa1100_timer_suspend NULL +#define sa1100_timer_resume NULL +#endif + static struct clock_event_device ckevt_sa1100_osmr0 = { .name = "osmr0", .features = CLOCK_EVT_FEAT_ONESHOT, .rating = 200, .set_next_event = sa1100_osmr0_set_next_event, .set_mode = sa1100_osmr0_set_mode, + .suspend = sa1100_timer_suspend, + .resume = sa1100_timer_resume, }; static struct irqaction sa1100_timer_irq = { @@ -105,39 +138,6 @@ static void __init sa1100_timer_init(void) clockevents_register_device(&ckevt_sa1100_osmr0); } -#ifdef CONFIG_PM -unsigned long osmr[4], oier; - -static void sa1100_timer_suspend(void) -{ - osmr[0] = readl_relaxed(OSMR0); - osmr[1] = readl_relaxed(OSMR1); - osmr[2] = readl_relaxed(OSMR2); - osmr[3] = readl_relaxed(OSMR3); - oier = readl_relaxed(OIER); -} - -static void sa1100_timer_resume(void) -{ - writel_relaxed(0x0f, OSSR); - writel_relaxed(osmr[0], OSMR0); - writel_relaxed(osmr[1], OSMR1); - writel_relaxed(osmr[2], OSMR2); - writel_relaxed(osmr[3], OSMR3); - writel_relaxed(oier, OIER); - - /* - * OSMR0 is the system timer: make sure OSCR is sufficiently behind - */ - writel_relaxed(OSMR0 - LATCH, OSCR); -} -#else -#define sa1100_timer_suspend NULL -#define sa1100_timer_resume NULL -#endif - struct sys_timer sa1100_timer = { .init = sa1100_timer_init, - .suspend = sa1100_timer_suspend, - .resume = sa1100_timer_resume, }; -- cgit v1.2.3 From 8726e96fcb29298351c777670742b553ca947508 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 7 Nov 2012 17:07:45 -0700 Subject: ARM: ux500: convert timer suspend/resume to clock_event_device Move ux500's timer suspend/resume functions from struct sys_timer ux500_timer into struct clock_event_device nmdk_clkevt. This will allow the sys_timer suspend/resume fields to be removed, and eventually lead to a complete removal of struct sys_timer. Cc: Srinidhi Kasagar Acked-by: Linus Walleij Signed-off-by: Stephen Warren --- arch/arm/mach-ux500/timer.c | 7 ------- drivers/clocksource/nomadik-mtu.c | 33 ++++++++++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c index 875309acb022..46a724493964 100644 --- a/arch/arm/mach-ux500/timer.c +++ b/arch/arm/mach-ux500/timer.c @@ -100,13 +100,6 @@ dt_fail: ux500_twd_init(); } -static void ux500_timer_reset(void) -{ - nmdk_clkevt_reset(); - nmdk_clksrc_reset(); -} - struct sys_timer ux500_timer = { .init = ux500_timer_init, - .resume = ux500_timer_reset, }; diff --git a/drivers/clocksource/nomadik-mtu.c b/drivers/clocksource/nomadik-mtu.c index 8914c3c1c88b..025afc6dd324 100644 --- a/drivers/clocksource/nomadik-mtu.c +++ b/drivers/clocksource/nomadik-mtu.c @@ -134,12 +134,32 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode, } } +void nmdk_clksrc_reset(void) +{ + /* Disable */ + writel(0, mtu_base + MTU_CR(0)); + + /* ClockSource: configure load and background-load, and fire it up */ + writel(nmdk_cycle, mtu_base + MTU_LR(0)); + writel(nmdk_cycle, mtu_base + MTU_BGLR(0)); + + writel(clk_prescale | MTU_CRn_32BITS | MTU_CRn_ENA, + mtu_base + MTU_CR(0)); +} + +static void nmdk_clkevt_resume(struct clock_event_device *cedev) +{ + nmdk_clkevt_reset(); + nmdk_clksrc_reset(); +} + static struct clock_event_device nmdk_clkevt = { .name = "mtu_1", .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, .rating = 200, .set_mode = nmdk_clkevt_mode, .set_next_event = nmdk_clkevt_next, + .resume = nmdk_clkevt_resume, }; /* @@ -161,19 +181,6 @@ static struct irqaction nmdk_timer_irq = { .dev_id = &nmdk_clkevt, }; -void nmdk_clksrc_reset(void) -{ - /* Disable */ - writel(0, mtu_base + MTU_CR(0)); - - /* ClockSource: configure load and background-load, and fire it up */ - writel(nmdk_cycle, mtu_base + MTU_LR(0)); - writel(nmdk_cycle, mtu_base + MTU_BGLR(0)); - - writel(clk_prescale | MTU_CRn_32BITS | MTU_CRn_ENA, - mtu_base + MTU_CR(0)); -} - void __init nmdk_timer_init(void __iomem *base, int irq) { unsigned long rate; -- cgit v1.2.3 From 656c669bc0cb9d2a621318b4b7300e8072930278 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 7 Nov 2012 17:24:28 -0700 Subject: ARM: samsung: register syscore_ops for timer resume directly Instead of using struct sys_timer's resume function, register syscore_ops directly in s3c2410_timer_init(). This will allow the sys_timer suspend/ resume fields to be removed, and eventually lead to a complete removal of struct sys_timer. Cc: Ben Dooks Cc: Kukjin Kim Signed-off-by: Stephen Warren --- arch/arm/plat-samsung/time.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c index 67206df94aa8..773745a85f0f 100644 --- a/arch/arm/plat-samsung/time.c +++ b/arch/arm/plat-samsung/time.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -271,6 +272,10 @@ static void __init s3c2410_timer_resources(void) clk_enable(tin); } +static struct syscore_ops s3c24xx_syscore_ops = { + .resume = s3c2410_timer_setup, +}; + static void __init s3c2410_timer_init(void) { arch_gettimeoffset = s3c2410_gettimeoffset; @@ -278,9 +283,9 @@ static void __init s3c2410_timer_init(void) s3c2410_timer_resources(); s3c2410_timer_setup(); setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); + register_syscore_ops(&s3c24xx_syscore_ops); } struct sys_timer s3c24xx_timer = { .init = s3c2410_timer_init, - .resume = s3c2410_timer_setup }; -- cgit v1.2.3 From 7704c095230e2e9863f3aacd0489a4b4cc00bf45 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 7 Nov 2012 16:35:33 -0700 Subject: ARM: remove struct sys_timer suspend and resume fields These fields duplicate e.g. struct clock_event_device's suspend and resume fields, so remove them now that nothing is using them. The aim is to remove all fields from struct sys_timer except .init, then replace the ARM machine descriptor's .timer field with a .init_time function instead, and delete struct sys_timer. Reviewed-by: Linus Walleij Signed-off-by: Stephen Warren --- arch/arm/include/asm/mach/time.h | 11 ----------- arch/arm/kernel/time.c | 34 ---------------------------------- 2 files changed, 45 deletions(-) diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index cac8d9c7d5d9..d316d76ef242 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h @@ -17,15 +17,6 @@ * Initialise the kernels jiffy timer source, claim interrupt * using setup_irq. This is called early on during initialisation * while interrupts are still disabled on the local CPU. - * - suspend - * Suspend the kernel jiffy timer source, if necessary. This - * is called with interrupts disabled, after all normal devices - * have been suspended. If no action is required, set this to - * NULL. - * - resume - * Resume the kernel jiffy timer source, if necessary. This - * is called with interrupts disabled before any normal devices - * are resumed. If no action is required, set this to NULL. * - offset * Return the timer offset in microseconds since the last timer * interrupt. Note: this must take account of any unprocessed @@ -33,8 +24,6 @@ */ struct sys_timer { void (*init)(void); - void (*suspend)(void); - void (*resume)(void); }; extern void timer_tick(void); diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index ea36bfaeba91..0b51a7c88157 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -119,39 +118,6 @@ int __init register_persistent_clock(clock_access_fn read_boot, return -EINVAL; } -#if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS) -static int timer_suspend(void) -{ - if (system_timer->suspend) - system_timer->suspend(); - - return 0; -} - -static void timer_resume(void) -{ - if (system_timer->resume) - system_timer->resume(); -} -#else -#define timer_suspend NULL -#define timer_resume NULL -#endif - -static struct syscore_ops timer_syscore_ops = { - .suspend = timer_suspend, - .resume = timer_resume, -}; - -static int __init timer_init_syscore_ops(void) -{ - register_syscore_ops(&timer_syscore_ops); - - return 0; -} - -device_initcall(timer_init_syscore_ops); - void __init time_init(void) { system_timer = machine_desc->timer; -- cgit v1.2.3 From 6bb27d7349db51b50c40534710fe164ca0d58902 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 8 Nov 2012 12:40:59 -0700 Subject: ARM: delete struct sys_timer Now that the only field in struct sys_timer is .init, delete the struct, and replace the machine descriptor .timer field with the initialization function itself. This will enable moving timer drivers into drivers/clocksource without having to place a public prototype of each struct sys_timer object into include/linux; the intent is to create a single of_clocksource_init() function that determines which timer driver to initialize by scanning the device dtree, much like the proposed irqchip_init() at: http://www.spinics.net/lists/arm-kernel/msg203686.html Includes mach-omap2 fixes from Igor Grinberg. Tested-by: Robert Jarzmik Signed-off-by: Stephen Warren --- arch/arm/include/asm/mach/arch.h | 3 +-- arch/arm/include/asm/mach/time.h | 16 ---------------- arch/arm/kernel/time.c | 9 +-------- arch/arm/mach-at91/at91rm9200_time.c | 5 ----- arch/arm/mach-at91/at91sam926x_time.c | 6 +----- arch/arm/mach-at91/at91x40_time.c | 5 ----- arch/arm/mach-at91/board-1arm.c | 2 +- arch/arm/mach-at91/board-afeb-9260v1.c | 2 +- arch/arm/mach-at91/board-cam60.c | 2 +- arch/arm/mach-at91/board-carmeva.c | 2 +- arch/arm/mach-at91/board-cpu9krea.c | 2 +- arch/arm/mach-at91/board-cpuat91.c | 2 +- arch/arm/mach-at91/board-csb337.c | 2 +- arch/arm/mach-at91/board-csb637.c | 2 +- arch/arm/mach-at91/board-dt.c | 2 +- arch/arm/mach-at91/board-eb01.c | 2 +- arch/arm/mach-at91/board-eb9200.c | 2 +- arch/arm/mach-at91/board-ecbat91.c | 2 +- arch/arm/mach-at91/board-eco920.c | 2 +- arch/arm/mach-at91/board-flexibity.c | 2 +- arch/arm/mach-at91/board-foxg20.c | 2 +- arch/arm/mach-at91/board-gsia18s.c | 2 +- arch/arm/mach-at91/board-kafa.c | 2 +- arch/arm/mach-at91/board-kb9202.c | 2 +- arch/arm/mach-at91/board-neocore926.c | 2 +- arch/arm/mach-at91/board-pcontrol-g20.c | 2 +- arch/arm/mach-at91/board-picotux200.c | 2 +- arch/arm/mach-at91/board-qil-a9260.c | 2 +- arch/arm/mach-at91/board-rm9200dk.c | 2 +- arch/arm/mach-at91/board-rm9200ek.c | 2 +- arch/arm/mach-at91/board-rsi-ews.c | 2 +- arch/arm/mach-at91/board-sam9-l9260.c | 2 +- arch/arm/mach-at91/board-sam9260ek.c | 2 +- arch/arm/mach-at91/board-sam9261ek.c | 2 +- arch/arm/mach-at91/board-sam9263ek.c | 2 +- arch/arm/mach-at91/board-sam9g20ek.c | 4 ++-- arch/arm/mach-at91/board-sam9m10g45ek.c | 2 +- arch/arm/mach-at91/board-sam9rlek.c | 2 +- arch/arm/mach-at91/board-snapper9260.c | 2 +- arch/arm/mach-at91/board-stamp9g20.c | 4 ++-- arch/arm/mach-at91/board-usb-a926x.c | 6 +++--- arch/arm/mach-at91/board-yl-9200.c | 2 +- arch/arm/mach-at91/generic.h | 7 +++---- arch/arm/mach-bcm/board_bcm.c | 6 +----- arch/arm/mach-bcm2835/bcm2835.c | 2 +- arch/arm/mach-clps711x/board-autcpu12.c | 2 +- arch/arm/mach-clps711x/board-cdb89712.c | 2 +- arch/arm/mach-clps711x/board-clep7312.c | 2 +- arch/arm/mach-clps711x/board-edb7211.c | 2 +- arch/arm/mach-clps711x/board-fortunet.c | 2 +- arch/arm/mach-clps711x/board-p720t.c | 2 +- arch/arm/mach-clps711x/common.c | 6 +----- arch/arm/mach-clps711x/common.h | 4 +--- arch/arm/mach-cns3xxx/cns3420vb.c | 2 +- arch/arm/mach-cns3xxx/core.c | 6 +----- arch/arm/mach-cns3xxx/core.h | 2 +- arch/arm/mach-davinci/board-da830-evm.c | 2 +- arch/arm/mach-davinci/board-da850-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-leopard.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 2 +- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 4 ++-- arch/arm/mach-davinci/board-mityomapl138.c | 2 +- arch/arm/mach-davinci/board-neuros-osd2.c | 2 +- arch/arm/mach-davinci/board-omapl138-hawk.c | 2 +- arch/arm/mach-davinci/board-sffsdr.c | 2 +- arch/arm/mach-davinci/board-tnetv107x-evm.c | 2 +- arch/arm/mach-davinci/da8xx-dt.c | 2 +- arch/arm/mach-davinci/include/mach/common.h | 4 +--- arch/arm/mach-davinci/time.c | 7 +------ arch/arm/mach-dove/cm-a510.c | 2 +- arch/arm/mach-dove/common.c | 8 ++------ arch/arm/mach-dove/common.h | 2 +- arch/arm/mach-dove/dove-db-setup.c | 2 +- arch/arm/mach-ebsa110/core.c | 8 ++------ arch/arm/mach-ep93xx/adssphere.c | 2 +- arch/arm/mach-ep93xx/core.c | 6 +----- arch/arm/mach-ep93xx/edb93xx.c | 16 ++++++++-------- arch/arm/mach-ep93xx/gesbc9312.c | 2 +- arch/arm/mach-ep93xx/include/mach/platform.h | 2 +- arch/arm/mach-ep93xx/micro9.c | 8 ++++---- arch/arm/mach-ep93xx/simone.c | 2 +- arch/arm/mach-ep93xx/snappercl15.c | 2 +- arch/arm/mach-ep93xx/ts72xx.c | 2 +- arch/arm/mach-ep93xx/vision_ep9307.c | 2 +- arch/arm/mach-exynos/common.h | 2 +- arch/arm/mach-exynos/mach-armlex4210.c | 2 +- arch/arm/mach-exynos/mach-exynos4-dt.c | 2 +- arch/arm/mach-exynos/mach-exynos5-dt.c | 2 +- arch/arm/mach-exynos/mach-nuri.c | 2 +- arch/arm/mach-exynos/mach-origen.c | 2 +- arch/arm/mach-exynos/mach-smdk4x12.c | 4 ++-- arch/arm/mach-exynos/mach-smdkv310.c | 4 ++-- arch/arm/mach-exynos/mach-universal_c210.c | 2 +- arch/arm/mach-exynos/mct.c | 6 +----- arch/arm/mach-footbridge/cats-hw.c | 2 +- arch/arm/mach-footbridge/common.h | 4 ++-- arch/arm/mach-footbridge/dc21285-timer.c | 6 +----- arch/arm/mach-footbridge/ebsa285.c | 2 +- arch/arm/mach-footbridge/isa-timer.c | 6 +----- arch/arm/mach-footbridge/netwinder-hw.c | 2 +- arch/arm/mach-footbridge/personal.c | 2 +- arch/arm/mach-gemini/board-nas4220b.c | 6 +----- arch/arm/mach-gemini/board-rut1xx.c