[U-Boot-Users] [PATCH] 85xx: get_tbclk() speed up and rounding fix

Kumar Gala galak at kernel.crashing.org
Tue Feb 12 16:32:55 CET 2008


From: James Yang

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
Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
---

In my git tree as well.

 cpu/mpc85xx/cpu.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c
index ac8b018..558ab0c 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;
+
 int checkcpu (void)
 {
 	sys_info_t sysinfo;
@@ -190,11 +192,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;
 }


-- 
1.5.3.8





More information about the U-Boot mailing list