Skip to contentSkip to conversation

74xx_7xx: Fix rounding problem in CPU frequency calculation

PATCH New Stefan Roese 2 participants 2 messages May 14, 2009 – May 15, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 74xx_7xx: Fix rounding problem in CPU frequency calculation

This patch fixes a problem in the CPU frequency calculation. Without it a 798MHz CPU is displayed as 368.503 MHz. And with it it's 798 MHz.

---
 cpu/74xx_7xx/speed.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
cpu/74xx_7xx/speed.c +2 -2
index bc33a67..f2fdcd5 100644
@@ -149,8 +149,8 @@ int get_clocks (void)
 
 	case CPU_750GX:
 	case CPU_750FX:
-		clock = gd->bus_clk *
-			hid1_fx_multipliers_x_10[get_hid1 () >> 27] / 10;
+		clock = (gd->bus_clk / 10) *
+			hid1_fx_multipliers_x_10[get_hid1 () >> 27];
 		break;
 
 	case CPU_7450:
Signature · 1 line
1.6.2.5
#1 lore raw

PATCH 1/1 74xx_7xx: Fix rounding problem in CPU frequency calculation

Dear Stefan Roese,

Quoted 7 lines · In message <[email protected]> you wrote:

This patch fixes a problem in the CPU frequency calculation. Without it a 798MHz CPU is displayed as 368.503 MHz. And with it it's 798 MHz.

---
 cpu/74xx_7xx/speed.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Operating-system software is the program that  orchestrates  all  the
basic functions of a computer.
- The Wall Street Journal, Tuesday, September 15, 1987, page 40