summaryrefslogtreecommitdiff
path: root/cpu/mpc85xx/cpu.c
diff options
context:
space:
mode:
authorJames Yang <James.Yang@freescale.com>2008-02-08 16:44:53 -0600
committerAndrew Fleming-AFLEMING <afleming@freescale.com>2008-03-26 11:43:04 -0500
commit591933ca6eabc440e6ed6967233aaf56fce464a3 (patch)
treed62e9b345930064e26fde5485c2cafb688445f26 /cpu/mpc85xx/cpu.c
parent1ced121600b2060ab2ff9f0fddd9421fd70a0dc6 (diff)
85xx: get_tbclk() speed up and rounding fix
Speed up get_tbclk() by referencing pre-computed bus clock frequency value from global data instead of sys_info_t. Fix rounding of result to nearest; previously it was rounding upwards. Signed-off-by: James Yang <James.Yang@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'cpu/mpc85xx/cpu.c')
-rw-r--r--cpu/mpc85xx/cpu.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c
index 0ac004db95..4aac599e12 100644
--- a/cpu/mpc85xx/cpu.c
+++ b/cpu/mpc85xx/cpu.c
@@ -30,6 +30,8 @@
#include <command.h>
#include <asm/cache.h>
+DECLARE_GLOBAL_DATA_PTR;
+
struct cpu_type {
char name[15];
u32 soc_ver;
@@ -201,11 +203,7 @@ int do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
*/
unsigned long get_tbclk (void)
{
-
- sys_info_t sys_info;
-
- get_sys_info(&sys_info);
- return ((sys_info.freqSystemBus + 7L) / 8L);
+ return (gd->bus_clk + 4UL)/8UL;
}