Skip to contentSkip to conversation

85xx: get_tbclk() speed up and rounding fix

PATCH New Kumar Gala 2 participants 2 messages Feb 12, 2008 – Feb 28, 2008

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 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

---

In my git tree as well.

 cpu/mpc85xx/cpu.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
cpu/mpc85xx/cpu.c +3 -5
index ac8b018..558ab0c 100644
@@ -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;
 }
 
 
Signature · 1 line
1.5.3.8
Applied
#1 lore raw

PATCH 1/1 85xx: get_tbclk() speed up and rounding fix

Quoted 9 lines · Kumar Gala

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

Applied to for-1.3.3, thanks

Andy