85xx: get_tbclk() speed up and rounding fix
authorJames Yang <James.Yang@freescale.com>
Fri, 8 Feb 2008 22:44:53 +0000 (16:44 -0600)
committerAndrew Fleming-AFLEMING <afleming@freescale.com>
Wed, 26 Mar 2008 16:43:04 +0000 (11:43 -0500)
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>
cpu/mpc85xx/cpu.c

index 0ac004db95c95a91bf97cdd0d2343f16f78e4dc8..4aac599e12d5c1df9a1307b9a3602c811afec534 100644 (file)
@@ -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;
 }