aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-10-20 07:04:51 -0400
committerPaul Mackerras <paulus@samba.org>2005-10-20 07:04:51 -0400
commit374e99d450a0c44dc30041fa83eccfd0890330c7 (patch)
treeffa9384b104133941df368dd6542d76d1286ca1c /arch/ppc64
parent0458060c1c59c5378d8fb5daabe18cf4681c35cd (diff)
powerpc: Move some calculations from xxx_calibrate_decr to time_init
Previously the individual xxx_calibrate_decr functions would each print the timebase and cpu frequency and calculate several values such as tb_to_us and tb_to_xs. This moves those printks and calculations into time_init just after the call to the platform's calibrate_decr function. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64')
-rw-r--r--arch/ppc64/kernel/pmac_time.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/arch/ppc64/kernel/pmac_time.c b/arch/ppc64/kernel/pmac_time.c
index 56f335115916..928bf213ec4e 100644
--- a/arch/ppc64/kernel/pmac_time.c
+++ b/arch/ppc64/kernel/pmac_time.c
@@ -152,8 +152,7 @@ unsigned long __init pmac_get_boot_time(void)
152void __init pmac_calibrate_decr(void) 152void __init pmac_calibrate_decr(void)
153{ 153{
154 struct device_node *cpu; 154 struct device_node *cpu;
155 unsigned int freq, *fp; 155 unsigned int *fp;
156 struct div_result divres;
157 156
158 /* 157 /*
159 * The cpu node should have a timebase-frequency property 158 * The cpu node should have a timebase-frequency property
@@ -165,16 +164,7 @@ void __init pmac_calibrate_decr(void)
165 fp = (unsigned int *) get_property(cpu, "timebase-frequency", NULL); 164 fp = (unsigned int *) get_property(cpu, "timebase-frequency", NULL);
166 if (fp == 0) 165 if (fp == 0)
167 panic("can't get cpu timebase frequency"); 166 panic("can't get cpu timebase frequency");
168 freq = *fp; 167 ppc_tb_freq = *fp;
169 printk("time_init: decrementer frequency = %u.%.6u MHz\n",
170 freq/1000000, freq%1000000);
171 tb_ticks_per_jiffy = freq / HZ;
172 tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
173 tb_ticks_per_usec = freq / 1000000;
174 tb_to_us = mulhwu_scale_factor(freq, 1000000);
175 div128_by_32( 1024*1024, 0, tb_ticks_per_sec, &divres );
176 tb_to_xs = divres.result_low;
177 ppc_tb_freq = freq;
178 168
179 fp = (unsigned int *)get_property(cpu, "clock-frequency", NULL); 169 fp = (unsigned int *)get_property(cpu, "clock-frequency", NULL);
180 if (fp == 0) 170 if (fp == 0)