Commit 591933ca authored by James Yang's avatar James Yang Committed by Andrew Fleming-AFLEMING
Browse files

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: default avatarJames Yang <James.Yang@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent 1ced1216
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include <command.h> #include <command.h>
#include <asm/cache.h> #include <asm/cache.h>
DECLARE_GLOBAL_DATA_PTR;
struct cpu_type { struct cpu_type {
char name[15]; char name[15];
u32 soc_ver; u32 soc_ver;
...@@ -201,11 +203,7 @@ int do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) ...@@ -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) unsigned long get_tbclk (void)
{ {
return (gd->bus_clk + 4UL)/8UL;
sys_info_t sys_info;
get_sys_info(&sys_info);
return ((sys_info.freqSystemBus + 7L) / 8L);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment