aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-10-20 08:33:06 -0400
committerPaul Mackerras <paulus@samba.org>2005-10-20 08:33:06 -0400
commit5d14a18d59b661356409e5a1f624236155a209ba (patch)
tree445d21d8b1ec0e58623887f7ceb55c2d3f81f4d5 /arch/powerpc/platforms/powermac
parent17a6392d30b4ed89b88a47a318b2b6de6ae7b946 (diff)
powerpc: Fix some bugs in the new merged time code
I had the sense of the test for when to use the old 601-style RTC registers inverted. pmac_calibrate_decr and via_calibrate_decr weren't setting ppc_tb_freq, on which all the further calculations depended. Lastly, update_gtod was losing the top 32 bits of the new tb_to_xs value. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac')
-rw-r--r--arch/powerpc/platforms/powermac/time.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index eb9969b52f96..a6d2d231d5a0 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -216,8 +216,8 @@ via_calibrate_decr(void)
216 ; 216 ;
217 dend = get_dec(); 217 dend = get_dec();
218 218
219 ppc_tb_freq = (dstart - dend) * 100 / 6;
219 tb_ticks_per_jiffy = (dstart - dend) / ((6 * HZ)/100); 220 tb_ticks_per_jiffy = (dstart - dend) / ((6 * HZ)/100);
220 tb_to_us = mulhwu_scale_factor(dstart - dend, 60000);
221 221
222 printk(KERN_INFO "via_calibrate_decr: ticks per jiffy = %lu (%u ticks)\n", 222 printk(KERN_INFO "via_calibrate_decr: ticks per jiffy = %lu (%u ticks)\n",
223 tb_ticks_per_jiffy, dstart - dend); 223 tb_ticks_per_jiffy, dstart - dend);
@@ -306,6 +306,5 @@ pmac_calibrate_decr(void)
306 freq = *fp; 306 freq = *fp;
307 printk("time_init: decrementer frequency = %u.%.6u MHz\n", 307 printk("time_init: decrementer frequency = %u.%.6u MHz\n",
308 freq/1000000, freq%1000000); 308 freq/1000000, freq%1000000);
309 tb_ticks_per_jiffy = freq / HZ; 309 ppc_tb_freq = freq;
310 tb_to_us = mulhwu_scale_factor(freq, 1000000);
311} 310}