summaryrefslogtreecommitdiff
path: root/cpu/mpc5xxx
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-03-31 18:32:53 +0200
committerWolfgang Denk <wd@pollux.denx.de>2006-03-31 18:32:53 +0200
commitd87080b721e4f8dca977af7571c5338ae7bb8db7 (patch)
tree514fc21eec39a2dd57f7aea516844a4400f8f140 /cpu/mpc5xxx
parentf6dbbe986481cff01334c64cacb971a5f237a9a9 (diff)
GCC-4.x fixes: clean up global data pointer initialization for all boards.
Diffstat (limited to 'cpu/mpc5xxx')
-rw-r--r--cpu/mpc5xxx/cpu.c6
-rw-r--r--cpu/mpc5xxx/cpu_init.c4
-rw-r--r--cpu/mpc5xxx/fec.c4
-rw-r--r--cpu/mpc5xxx/i2c.c3
-rw-r--r--cpu/mpc5xxx/ide.c3
-rw-r--r--cpu/mpc5xxx/serial.c6
-rw-r--r--cpu/mpc5xxx/speed.c6
7 files changed, 14 insertions, 18 deletions
diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c
index 2d695d12eb1..563d5af3138 100644
--- a/cpu/mpc5xxx/cpu.c
+++ b/cpu/mpc5xxx/cpu.c
@@ -31,10 +31,10 @@
#include <mpc5xxx.h>
#include <asm/processor.h>
+DECLARE_GLOBAL_DATA_PTR;
+
int checkcpu (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
ulong clock = gd->cpu_clk;
char buf[32];
#ifndef CONFIG_MGT5100
@@ -94,8 +94,6 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
*/
unsigned long get_tbclk (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
ulong tbclk;
tbclk = (gd->bus_clk + 3L) / 4L;
diff --git a/cpu/mpc5xxx/cpu_init.c b/cpu/mpc5xxx/cpu_init.c
index 3df005009eb..4a370ffea94 100644
--- a/cpu/mpc5xxx/cpu_init.c
+++ b/cpu/mpc5xxx/cpu_init.c
@@ -24,6 +24,8 @@
#include <common.h>
#include <mpc5xxx.h>
+DECLARE_GLOBAL_DATA_PTR;
+
/*
* Breath some life into the CPU...
*
@@ -32,8 +34,6 @@
*/
void cpu_init_f (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
unsigned long addecr = (1 << 25); /* Boot_CS */
#if defined(CFG_RAMBOOT) && defined(CONFIG_MGT5100)
addecr |= (1 << 22); /* SDRAM enable */
diff --git a/cpu/mpc5xxx/fec.c b/cpu/mpc5xxx/fec.c
index 2e8e54958f1..19737ce868d 100644
--- a/cpu/mpc5xxx/fec.c
+++ b/cpu/mpc5xxx/fec.c
@@ -14,6 +14,8 @@
#include "sdma.h"
#include "fec.h"
+DECLARE_GLOBAL_DATA_PTR;
+
/* #define DEBUG 0x28 */
#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \
@@ -242,7 +244,6 @@ 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;
@@ -393,7 +394,6 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
/********************************************************************/
static int mpc5xxx_fec_init_phy(struct eth_device *dev, bd_t * bis)
{
- DECLARE_GLOBAL_DATA_PTR;
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
const uint8 phyAddr = CONFIG_PHY_ADDR; /* Only one PHY */
diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c
index 044db46f6fb..0f02e78a3bd 100644
--- a/cpu/mpc5xxx/i2c.c
+++ b/cpu/mpc5xxx/i2c.c
@@ -23,6 +23,8 @@
#include <common.h>
+DECLARE_GLOBAL_DATA_PTR;
+
#ifdef CONFIG_HARD_I2C
#include <mpc5xxx.h>
@@ -228,7 +230,6 @@ void i2c_init(int speed, int saddr)
static int mpc_get_fdr(int speed)
{
- DECLARE_GLOBAL_DATA_PTR;
static int fdr = -1;
if (fdr == -1) {
diff --git a/cpu/mpc5xxx/ide.c b/cpu/mpc5xxx/ide.c
index 1af794c6eca..29b99f6b15d 100644
--- a/cpu/mpc5xxx/ide.c
+++ b/cpu/mpc5xxx/ide.c
@@ -27,6 +27,8 @@
#ifdef CFG_CMD_IDE
#include <mpc5xxx.h>
+DECLARE_GLOBAL_DATA_PTR;
+
#define CALC_TIMING(t) (t + period - 1) / period
#ifdef CONFIG_IDE_RESET
@@ -35,7 +37,6 @@ extern void init_ide_reset (void);
int ide_preinit (void)
{
- DECLARE_GLOBAL_DATA_PTR;
long period, t0, t1, t2_8, t2_16, t4, ta;
vu_long reg;
struct mpc5xxx_sdma *psdma = (struct mpc5xxx_sdma *) MPC5XXX_SDMA;
diff --git a/cpu/mpc5xxx/serial.c b/cpu/mpc5xxx/serial.c
index 91e1def98cb..cacb9f05733 100644
--- a/cpu/mpc5xxx/serial.c
+++ b/cpu/mpc5xxx/serial.c
@@ -33,6 +33,8 @@
#include <common.h>
#include <mpc5xxx.h>
+DECLARE_GLOBAL_DATA_PTR;
+
#if defined(CONFIG_PSC_CONSOLE)
#if CONFIG_PSC_CONSOLE == 1
@@ -55,8 +57,6 @@
int serial_init (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
unsigned long baseclk;
int div;
@@ -146,8 +146,6 @@ serial_tstc(void)
void
serial_setbrg(void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
unsigned long baseclk, div;
diff --git a/cpu/mpc5xxx/speed.c b/cpu/mpc5xxx/speed.c
index 4f4e814e94d..7847adcefa4 100644
--- a/cpu/mpc5xxx/speed.c
+++ b/cpu/mpc5xxx/speed.c
@@ -25,6 +25,8 @@
#include <mpc5xxx.h>
#include <asm/processor.h>
+DECLARE_GLOBAL_DATA_PTR;
+
/* ------------------------------------------------------------------------- */
/* Bus-to-Core Multipliers */
@@ -43,8 +45,6 @@ static int bus2core[] = {
int get_clocks (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
ulong val, vco;
#if !defined(CFG_MPC5XXX_CLKIN)
@@ -81,8 +81,6 @@ int get_clocks (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);