aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/time.c')
-rw-r--r--arch/sparc64/kernel/time.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index a31a0439244f..62e316ab1339 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -849,9 +849,6 @@ static unsigned long sparc64_init_timers(void)
849{ 849{
850 struct device_node *dp; 850 struct device_node *dp;
851 unsigned long clock; 851 unsigned long clock;
852#ifdef CONFIG_SMP
853 extern void smp_tick_init(void);
854#endif
855 852
856 dp = of_find_node_by_path("/"); 853 dp = of_find_node_by_path("/");
857 if (tlb_type == spitfire) { 854 if (tlb_type == spitfire) {
@@ -874,10 +871,6 @@ static unsigned long sparc64_init_timers(void)
874 clock = of_getintprop_default(dp, "stick-frequency", 0); 871 clock = of_getintprop_default(dp, "stick-frequency", 0);
875 } 872 }
876 873
877#ifdef CONFIG_SMP
878 smp_tick_init();
879#endif
880
881 return clock; 874 return clock;
882} 875}
883 876
@@ -1038,10 +1031,31 @@ static void __init setup_clockevent_multiplier(unsigned long hz)
1038 sparc64_clockevent.mult = mult; 1031 sparc64_clockevent.mult = mult;
1039} 1032}
1040 1033
1034static unsigned long tb_ticks_per_usec __read_mostly;
1035
1036void __delay(unsigned long loops)
1037{
1038 unsigned long bclock, now;
1039
1040 bclock = tick_ops->get_tick();
1041 do {
1042 now = tick_ops->get_tick();
1043 } while ((now-bclock) < loops);
1044}
1045EXPORT_SYMBOL(__delay);
1046
1047void udelay(unsigned long usecs)
1048{
1049 __delay(tb_ticks_per_usec * usecs);
1050}
1051EXPORT_SYMBOL(udelay);
1052
1041void __init time_init(void) 1053void __init time_init(void)
1042{ 1054{
1043 unsigned long clock = sparc64_init_timers(); 1055 unsigned long clock = sparc64_init_timers();
1044 1056
1057 tb_ticks_per_usec = clock / USEC_PER_SEC;
1058
1045 timer_ticks_per_nsec_quotient = 1059 timer_ticks_per_nsec_quotient =
1046 clocksource_hz2mult(clock, SPARC64_NSEC_PER_CYC_SHIFT); 1060 clocksource_hz2mult(clock, SPARC64_NSEC_PER_CYC_SHIFT);
1047 1061