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

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@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; }

On Tue, Feb 12, 2008 at 9:32 AM, Kumar Gala galak@kernel.crashing.org wrote:
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@kernel.crashing.org
Applied to for-1.3.3, thanks
Andy
participants (2)
-
Andy Fleming
-
Kumar Gala