diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-20 07:04:51 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-20 07:04:51 -0400 |
commit | 374e99d450a0c44dc30041fa83eccfd0890330c7 (patch) | |
tree | ffa9384b104133941df368dd6542d76d1286ca1c /arch/powerpc/kernel | |
parent | 0458060c1c59c5378d8fb5daabe18cf4681c35cd (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/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/time.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index d1608473075f..7d406b73a855 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -548,11 +548,9 @@ int do_settimeofday(struct timespec *tv) | |||
548 | 548 | ||
549 | EXPORT_SYMBOL(do_settimeofday); | 549 | EXPORT_SYMBOL(do_settimeofday); |
550 | 550 | ||
551 | #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_MAPLE) || defined(CONFIG_PPC_BPA) || defined(CONFIG_PPC_ISERIES) | ||
552 | void __init generic_calibrate_decr(void) | 551 | void __init generic_calibrate_decr(void) |
553 | { | 552 | { |
554 | struct device_node *cpu; | 553 | struct device_node *cpu; |
555 | struct div_result divres; | ||
556 | unsigned int *fp; | 554 | unsigned int *fp; |
557 | int node_found; | 555 | int node_found; |
558 | 556 | ||
@@ -591,20 +589,7 @@ void __init generic_calibrate_decr(void) | |||
591 | "(not found)\n"); | 589 | "(not found)\n"); |
592 | 590 | ||
593 | of_node_put(cpu); | 591 | of_node_put(cpu); |
594 | |||
595 | printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n", | ||
596 | ppc_tb_freq/1000000, ppc_tb_freq%1000000); | ||
597 | printk(KERN_INFO "time_init: processor frequency = %lu.%.6lu MHz\n", | ||
598 | ppc_proc_freq/1000000, ppc_proc_freq%1000000); | ||
599 | |||
600 | tb_ticks_per_jiffy = ppc_tb_freq / HZ; | ||
601 | tb_ticks_per_sec = tb_ticks_per_jiffy * HZ; | ||
602 | tb_ticks_per_usec = ppc_tb_freq / 1000000; | ||
603 | tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000); | ||
604 | div128_by_32(1024*1024, 0, tb_ticks_per_sec, &divres); | ||
605 | tb_to_xs = divres.result_low; | ||
606 | } | 592 | } |
607 | #endif | ||
608 | 593 | ||
609 | unsigned long get_boot_time(void) | 594 | unsigned long get_boot_time(void) |
610 | { | 595 | { |
@@ -633,6 +618,18 @@ void __init time_init(void) | |||
633 | 618 | ||
634 | ppc_md.calibrate_decr(); | 619 | ppc_md.calibrate_decr(); |
635 | 620 | ||
621 | printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n", | ||
622 | ppc_tb_freq / 1000000, ppc_tb_freq % 1000000); | ||
623 | printk(KERN_INFO "time_init: processor frequency = %lu.%.6lu MHz\n", | ||
624 | ppc_proc_freq / 1000000, ppc_proc_freq % 1000000); | ||
625 | |||
626 | tb_ticks_per_jiffy = ppc_tb_freq / HZ; | ||
627 | tb_ticks_per_sec = tb_ticks_per_jiffy * HZ; | ||
628 | tb_ticks_per_usec = ppc_tb_freq / 1000000; | ||
629 | tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000); | ||
630 | div128_by_32(1024*1024, 0, tb_ticks_per_sec, &res); | ||
631 | tb_to_xs = res.result_low; | ||
632 | |||
636 | #ifdef CONFIG_PPC64 | 633 | #ifdef CONFIG_PPC64 |
637 | get_paca()->default_decr = tb_ticks_per_jiffy; | 634 | get_paca()->default_decr = tb_ticks_per_jiffy; |
638 | #endif | 635 | #endif |