diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-02-21 14:45:08 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-02-26 06:17:03 -0500 |
commit | 50530378161fa8d7837243119ed9140ee65e55d4 (patch) | |
tree | b3ae4e02f34a9d115bb4cf703ac19b17ec13688b /arch | |
parent | d9d1063d47cbfe45f8b369475a35c3cdd64fb69c (diff) |
[POWERPC] 8xx: Timebase frequency should not depend on bus-frequency
m8xx_setup.c says:
/* Force all 8xx processors to use divide by 16 processor clock. */
And at the same time it is using bus-frequency for calculating
timebase. It is okay for most setups because bus-frequency is
equal to clock-frequency.
The problem emerges when cpu frequency is > 66MHz, quoting
u-boot/cpu/mpc8xx/speed.c:
if (gd->cpu_clk <= 66000000) {
sccr_reg |= SCCR_EBDF00; /* bus division factor = 1 */
gd->bus_clk = gd->cpu_clk;
} else {
sccr_reg |= SCCR_EBDF01; /* bus division factor = 2 */
gd->bus_clk = gd->cpu_clk / 2;
}
So in case of cpu clock > 66MHz, bus_clk = cpu_clk / 2. An then, from
Linux, we calculate timebase frequency as tb_freq = bus_clk / 16,
that is cpu_clk / 2 / 16, which is wrong.
This fixes the system time drifting problem on the EP885C board
running at 133MHz.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/8xx/m8xx_setup.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index 184f998d1be..0d9f75c74f8 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c | |||
@@ -111,17 +111,12 @@ void __init mpc8xx_calibrate_decr(void) | |||
111 | 111 | ||
112 | /* Processor frequency is MHz. | 112 | /* Processor frequency is MHz. |
113 | */ | 113 | */ |
114 | ppc_tb_freq = 50000000; | ||
115 | if (!get_freq("bus-frequency", &ppc_tb_freq)) { | ||
116 | printk(KERN_ERR "WARNING: Estimating decrementer frequency " | ||
117 | "(not found)\n"); | ||
118 | } | ||
119 | ppc_tb_freq /= 16; | ||
120 | ppc_proc_freq = 50000000; | 114 | ppc_proc_freq = 50000000; |
121 | if (!get_freq("clock-frequency", &ppc_proc_freq)) | 115 | if (!get_freq("clock-frequency", &ppc_proc_freq)) |
122 | printk(KERN_ERR "WARNING: Estimating processor frequency " | 116 | printk(KERN_ERR "WARNING: Estimating processor frequency " |
123 | "(not found)\n"); | 117 | "(not found)\n"); |
124 | 118 | ||
119 | ppc_tb_freq = ppc_proc_freq / 16; | ||
125 | printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq); | 120 | printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq); |
126 | 121 | ||
127 | /* Perform some more timer/timebase initialization. This used | 122 | /* Perform some more timer/timebase initialization. This used |