aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-versatile
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-01-14 15:07:35 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-02 04:35:36 -0400
commitf5fc00826d1e60af0e22cb9f65b933d823a8ed84 (patch)
treebcff2df77e951dbfc0833cda47620ee3c65694ac /arch/arm/mach-versatile
parent6be4826e37122b25cb10b215fc84c3a0b1fe1402 (diff)
ARM: Realview/Versatile: separate out common sched_clock()
Provide a common sched_clock() implementation for Versatile and Realview. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-versatile')
-rw-r--r--arch/arm/mach-versatile/core.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index b68ddd349f12..490fc7597bb6 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -28,7 +28,6 @@
28#include <linux/amba/clcd.h> 28#include <linux/amba/clcd.h>
29#include <linux/amba/pl061.h> 29#include <linux/amba/pl061.h>
30#include <linux/amba/mmci.h> 30#include <linux/amba/mmci.h>
31#include <linux/cnt32_to_63.h>
32#include <linux/io.h> 31#include <linux/io.h>
33 32
34#include <asm/clkdev.h> 33#include <asm/clkdev.h>
@@ -227,27 +226,6 @@ void __init versatile_map_io(void)
227 iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); 226 iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc));
228} 227}
229 228
230#define VERSATILE_REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET)
231
232/*
233 * This is the Versatile sched_clock implementation. This has
234 * a resolution of 41.7ns, and a maximum value of about 35583 days.
235 *
236 * The return value is guaranteed to be monotonic in that range as
237 * long as there is always less than 89 seconds between successive
238 * calls to this function.
239 */
240unsigned long long sched_clock(void)
241{
242 unsigned long long v = cnt32_to_63(readl(VERSATILE_REFCOUNTER));
243
244 /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
245 v *= 125<<1;
246 do_div(v, 3<<1);
247
248 return v;
249}
250
251 229
252#define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) 230#define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET)
253 231