aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/timer.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2012-03-28 06:22:30 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-04-11 06:11:48 -0400
commit0f2c9f20e4e339de30cfd5613dfa9505e7b9c58b (patch)
treecdeac60cb531a28d2890bf2dda3709fd9572e4c0 /arch/arm/mach-shmobile/timer.c
parent0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff)
ARM: mach-shmobile: Introduce shmobile_setup_delay()
Add the function shmobile_setup_delay() to let platforms configure their maximum loops per jiffy delay. With this jiffies calculation done the dependency on early timer is removed. In the future this allows us to assign timers using the regular driver model via the device tree. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile/timer.c')
-rw-r--r--arch/arm/mach-shmobile/timer.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
index 2fba5f3d1c8a..599e0081a533 100644
--- a/arch/arm/mach-shmobile/timer.c
+++ b/arch/arm/mach-shmobile/timer.c
@@ -19,9 +19,26 @@
19 * 19 *
20 */ 20 */
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/delay.h>
22#include <asm/mach/time.h> 23#include <asm/mach/time.h>
23#include <asm/smp_twd.h> 24#include <asm/smp_twd.h>
24 25
26void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz,
27 unsigned int mult, unsigned int div)
28{
29 /* calculate a worst-case loops-per-jiffy value
30 * based on maximum cpu core mhz setting and the
31 * __delay() implementation in arch/arm/lib/delay.S
32 *
33 * this will result in a longer delay than expected
34 * when the cpu core runs on lower frequencies.
35 */
36
37 unsigned int value = (1000000 * mult) / (HZ * div);
38
39 lpj_fine = max_cpu_core_mhz * value;
40}
41
25static void __init shmobile_late_time_init(void) 42static void __init shmobile_late_time_init(void)
26{ 43{
27 /* 44 /*