diff options
Diffstat (limited to 'arch/arm/mach-shmobile/timer.c')
-rw-r--r-- | arch/arm/mach-shmobile/timer.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c index 895794b543c..a68919727e2 100644 --- a/arch/arm/mach-shmobile/timer.c +++ b/arch/arm/mach-shmobile/timer.c @@ -19,7 +19,26 @@ * */ #include <linux/platform_device.h> +#include <linux/delay.h> #include <asm/mach/time.h> +#include <asm/smp_twd.h> + +void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz, + unsigned int mult, unsigned int div) +{ + /* calculate a worst-case loops-per-jiffy value + * based on maximum cpu core mhz setting and the + * __delay() implementation in arch/arm/lib/delay.S + * + * this will result in a longer delay than expected + * when the cpu core runs on lower frequencies. + */ + + unsigned int value = (1000000 * mult) / (HZ * div); + + if (!preset_lpj) + preset_lpj = max_cpu_core_mhz * value; +} static void __init shmobile_late_time_init(void) { @@ -36,11 +55,15 @@ static void __init shmobile_late_time_init(void) early_platform_driver_probe("earlytimer", 2, 0); } -static void __init shmobile_timer_init(void) +void __init shmobile_earlytimer_init(void) { late_time_init = shmobile_late_time_init; } +static void __init shmobile_timer_init(void) +{ +} + struct sys_timer shmobile_timer = { .init = shmobile_timer_init, }; |