projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fdt_support: Add multi-serial support for stdout fixup
[oweals/u-boot.git]
/
cpu
/
mpc5xxx
/
speed.c
diff --git
a/cpu/mpc5xxx/speed.c
b/cpu/mpc5xxx/speed.c
index cb27779a2290bbc311d81d2bcbbcecc2022dbe9e..8027d3e08a2c8054a97bbcd00d0200389fccdfa0 100644
(file)
--- a/
cpu/mpc5xxx/speed.c
+++ b/
cpu/mpc5xxx/speed.c
@@
-25,15
+25,17
@@
#include <mpc5xxx.h>
#include <asm/processor.h>
#include <mpc5xxx.h>
#include <asm/processor.h>
+DECLARE_GLOBAL_DATA_PTR;
+
/* ------------------------------------------------------------------------- */
/* Bus-to-Core Multipliers */
static int bus2core[] = {
/* ------------------------------------------------------------------------- */
/* Bus-to-Core Multipliers */
static int bus2core[] = {
-
0, 0, 0, 10, 20, 20, 25, 45
,
-
30, 55, 40, 50, 0, 60, 35
, 0,
-
30, 25, 65, 10, 70, 20, 75, 45
,
- 0,
55, 40, 50, 80, 60, 35
, 0
+
3, 2, 2, 2, 4, 4, 5, 9
,
+
6, 11, 8, 10, 3, 12, 7
, 0,
+
6, 5, 13, 2, 14, 4, 15, 9
,
+ 0,
11, 8, 10, 16, 12, 7
, 0
};
/* ------------------------------------------------------------------------- */
};
/* ------------------------------------------------------------------------- */
@@
-43,26
+45,24
@@
static int bus2core[] = {
int get_clocks (void)
{
int get_clocks (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
ulong val, vco;
ulong val, vco;
-#if !defined(C
FG
_MPC5XXX_CLKIN)
-#error clock measuring not implemented yet - define C
FG
_MPC5XXX_CLKIN
+#if !defined(C
ONFIG_SYS
_MPC5XXX_CLKIN)
+#error clock measuring not implemented yet - define C
ONFIG_SYS
_MPC5XXX_CLKIN
#endif
val = *(vu_long *)MPC5XXX_CDM_PORCFG;
if (val & (1 << 6)) {
#endif
val = *(vu_long *)MPC5XXX_CDM_PORCFG;
if (val & (1 << 6)) {
- vco = C
FG
_MPC5XXX_CLKIN * 12;
+ vco = C
ONFIG_SYS
_MPC5XXX_CLKIN * 12;
} else {
} else {
- vco = C
FG
_MPC5XXX_CLKIN * 16;
+ vco = C
ONFIG_SYS
_MPC5XXX_CLKIN * 16;
}
if (val & (1 << 5)) {
gd->bus_clk = vco / 8;
} else {
gd->bus_clk = vco / 4;
}
}
if (val & (1 << 5)) {
gd->bus_clk = vco / 8;
} else {
gd->bus_clk = vco / 4;
}
- gd->cpu_clk = gd->bus_clk * bus2core[val & 0x1f] /
10
;
+ gd->cpu_clk = gd->bus_clk * bus2core[val & 0x1f] /
2
;
val = *(vu_long *)MPC5XXX_CDM_CFG;
if (val & (1 << 8)) {
val = *(vu_long *)MPC5XXX_CDM_CFG;
if (val & (1 << 8)) {
@@
-81,12
+81,13
@@
int get_clocks (void)
int prt_mpc5xxx_clks (void)
{
int prt_mpc5xxx_clks (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
- printf(" Bus %ld MHz, IPB %ld MHz, PCI %ld MHz\n",
- gd->bus_clk / 1000000, gd->ipb_clk / 1000000,
- gd->pci_clk / 1000000);
+ char buf1[32], buf2[32], buf3[32];
+ printf (" Bus %s MHz, IPB %s MHz, PCI %s MHz\n",
+ strmhz(buf1, gd->bus_clk),
+ strmhz(buf2, gd->ipb_clk),
+ strmhz(buf3, gd->pci_clk)
+ );
return (0);
}
return (0);
}