summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/mpc5xxx/cpu_init.c16
-rw-r--r--cpu/mpc5xxx/fec.c5
2 files changed, 11 insertions, 10 deletions
diff --git a/cpu/mpc5xxx/cpu_init.c b/cpu/mpc5xxx/cpu_init.c
index cec5c2bc67..a93a198cf5 100644
--- a/cpu/mpc5xxx/cpu_init.c
+++ b/cpu/mpc5xxx/cpu_init.c
@@ -24,14 +24,6 @@
#include <common.h>
#include <mpc5xxx.h>
-#if defined(CONFIG_MGT5100)
-#define START_REG(start) ((start) >> 15)
-#define STOP_REG(start, size) (((start) + (size) - 1) >> 15)
-#elif defined(CONFIG_MPC5200)
-#define START_REG(start) ((start) >> 16)
-#define STOP_REG(start, size) (((start) + (size) - 1) >> 16)
-#endif
-
/*
* Breath some life into the CPU...
*
@@ -159,6 +151,14 @@ void cpu_init_f (void)
#if defined(CONFIG_MPC5200)
/* enable timebase */
*(vu_long *)(MPC5XXX_XLBARB + 0x40) |= (1 << 13);
+
+ /* Motorola reports IPB should better run at 133 MHz. */
+ *(vu_long *)MPC5XXX_ADDECR |= 1;
+ /* pci_clk_sel = 0x02, ipb_clk_sel = 0x00; */
+ addecr = *(vu_long *)MPC5XXX_CDM_CFG;
+ addecr &= ~0x103;
+ addecr |= 0x02;
+ *(vu_long *)MPC5XXX_CDM_CFG = addecr;
#endif
}
diff --git a/cpu/mpc5xxx/fec.c b/cpu/mpc5xxx/fec.c
index 557355f9d2..06dd56fc50 100644
--- a/cpu/mpc5xxx/fec.c
+++ b/cpu/mpc5xxx/fec.c
@@ -208,6 +208,7 @@ static void mpc5xxx_fec_set_hwaddr(mpc5xxx_fec_priv *fec, char *mac)
/********************************************************************/
static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
{
+ DECLARE_GLOBAL_DATA_PTR;
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
struct mpc5xxx_sdma *sdma = (struct mpc5xxx_sdma *)MPC5XXX_SDMA;
const uint8 phyAddr = 0; /* Only one PHY */
@@ -269,10 +270,10 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
fec->eth->x_cntrl = 0x00000004; /* full-duplex, heartbeat disabled */
/*
- * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock(25Mhz)
+ * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
* and do not drop the Preamble.
*/
- fec->eth->mii_speed = (0x5 << 1); /* No MII for 7-wire mode */
+ fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
}
/*