diff options
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/timer.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index 83ad3fe0a75f..cc1d73514ffa 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | extern void shmobile_earlytimer_init(void); | 4 | extern void shmobile_earlytimer_init(void); |
5 | extern struct sys_timer shmobile_timer; | 5 | extern struct sys_timer shmobile_timer; |
6 | extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz, | ||
7 | unsigned int mult, unsigned int div); | ||
6 | struct twd_local_timer; | 8 | struct twd_local_timer; |
7 | void shmobile_twd_init(struct twd_local_timer *twd_local_timer); | 9 | void shmobile_twd_init(struct twd_local_timer *twd_local_timer); |
8 | extern void shmobile_setup_console(void); | 10 | extern void shmobile_setup_console(void); |
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 | ||
26 | void __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 | |||
25 | static void __init shmobile_late_time_init(void) | 42 | static void __init shmobile_late_time_init(void) |
26 | { | 43 | { |
27 | /* | 44 | /* |