Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11615
b: refs/heads/master
c: 374e99d
h: refs/heads/master
i:
  11613: edb099f
  11611: 892f72f
  11607: 99c532d
  11599: da1f59e
  11583: 8c32a76
v: v3
  • Loading branch information
Paul Mackerras committed Oct 20, 2005
1 parent e08ae08 commit 44b19b6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0458060c1c59c5378d8fb5daabe18cf4681c35cd
refs/heads/master: 374e99d450a0c44dc30041fa83eccfd0890330c7
27 changes: 12 additions & 15 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,9 @@ int do_settimeofday(struct timespec *tv)

EXPORT_SYMBOL(do_settimeofday);

#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_MAPLE) || defined(CONFIG_PPC_BPA) || defined(CONFIG_PPC_ISERIES)
void __init generic_calibrate_decr(void)
{
struct device_node *cpu;
struct div_result divres;
unsigned int *fp;
int node_found;

Expand Down Expand Up @@ -591,20 +589,7 @@ void __init generic_calibrate_decr(void)
"(not found)\n");

of_node_put(cpu);

printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
ppc_tb_freq/1000000, ppc_tb_freq%1000000);
printk(KERN_INFO "time_init: processor frequency = %lu.%.6lu MHz\n",
ppc_proc_freq/1000000, ppc_proc_freq%1000000);

tb_ticks_per_jiffy = ppc_tb_freq / HZ;
tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
tb_ticks_per_usec = ppc_tb_freq / 1000000;
tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000);
div128_by_32(1024*1024, 0, tb_ticks_per_sec, &divres);
tb_to_xs = divres.result_low;
}
#endif

unsigned long get_boot_time(void)
{
Expand Down Expand Up @@ -633,6 +618,18 @@ void __init time_init(void)

ppc_md.calibrate_decr();

printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
ppc_tb_freq / 1000000, ppc_tb_freq % 1000000);
printk(KERN_INFO "time_init: processor frequency = %lu.%.6lu MHz\n",
ppc_proc_freq / 1000000, ppc_proc_freq % 1000000);

tb_ticks_per_jiffy = ppc_tb_freq / HZ;
tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
tb_ticks_per_usec = ppc_tb_freq / 1000000;
tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000);
div128_by_32(1024*1024, 0, tb_ticks_per_sec, &res);
tb_to_xs = res.result_low;

#ifdef CONFIG_PPC64
get_paca()->default_decr = tb_ticks_per_jiffy;
#endif
Expand Down
14 changes: 2 additions & 12 deletions trunk/arch/ppc64/kernel/pmac_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ unsigned long __init pmac_get_boot_time(void)
void __init pmac_calibrate_decr(void)
{
struct device_node *cpu;
unsigned int freq, *fp;
struct div_result divres;
unsigned int *fp;

/*
* The cpu node should have a timebase-frequency property
Expand All @@ -165,16 +164,7 @@ void __init pmac_calibrate_decr(void)
fp = (unsigned int *) get_property(cpu, "timebase-frequency", NULL);
if (fp == 0)
panic("can't get cpu timebase frequency");
freq = *fp;
printk("time_init: decrementer frequency = %u.%.6u MHz\n",
freq/1000000, freq%1000000);
tb_ticks_per_jiffy = freq / HZ;
tb_ticks_per_sec = tb_ticks_per_jiffy * HZ;
tb_ticks_per_usec = freq / 1000000;
tb_to_us = mulhwu_scale_factor(freq, 1000000);
div128_by_32( 1024*1024, 0, tb_ticks_per_sec, &divres );
tb_to_xs = divres.result_low;
ppc_tb_freq = freq;
ppc_tb_freq = *fp;

fp = (unsigned int *)get_property(cpu, "clock-frequency", NULL);
if (fp == 0)
Expand Down

0 comments on commit 44b19b6

Please sign in to comment.