]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
GCC-4.x fixes: clean up global data pointer initialization for all boards.
authorWolfgang Denk <wd@pollux.denx.de>
Fri, 31 Mar 2006 16:32:53 +0000 (18:32 +0200)
committerWolfgang Denk <wd@pollux.denx.de>
Fri, 31 Mar 2006 16:32:53 +0000 (18:32 +0200)
292 files changed:
CHANGELOG
README
board/MAI/AmigaOneG3SE/AmigaOneG3SE.c
board/MAI/AmigaOneG3SE/articiaS.c
board/MAI/AmigaOneG3SE/articiaS_pci.c
board/MAI/AmigaOneG3SE/cmd_boota.c
board/MAI/AmigaOneG3SE/serial.c
board/MAI/AmigaOneG3SE/via686.c
board/MAI/AmigaOneG3SE/video.c
board/Marvell/common/serial.c
board/Marvell/db64360/mpsc.c
board/Marvell/db64360/mv_eth.c
board/Marvell/db64360/sdram_init.c
board/Marvell/db64460/mpsc.c
board/Marvell/db64460/mv_eth.c
board/Marvell/db64460/sdram_init.c
board/adsvix/adsvix.c
board/amcc/ebony/ebony.c
board/amcc/luan/luan.c
board/amcc/ocotea/ocotea.c
board/amcc/walnut/walnut.c
board/amcc/yellowstone/yellowstone.c
board/amcc/yosemite/yosemite.c
board/amirix/ap1000/serial.c
board/armadillo/armadillo.c
board/assabet/assabet.c
board/at91rm9200dk/at91rm9200dk.c
board/bmw/serial.c
board/cerf250/cerf250.c
board/cm4008/cm4008.c
board/cm41xx/cm41xx.c
board/cmc_pu2/cmc_pu2.c
board/cogent/serial.c
board/cradle/cradle.c
board/csb226/csb226.c
board/csb637/csb637.c
board/cu824/cu824.c
board/dave/B2/B2.c
board/dave/PPChameleonEVB/PPChameleonEVB.c
board/delta/delta.c
board/dnp1110/dnp1110.c
board/eltec/bab7xx/bab7xx.c
board/eltec/elppc/elppc.c
board/ep7312/ep7312.c
board/esd/apc405/apc405.c
board/esd/ar405/ar405.c
board/esd/canbt/canbt.c
board/esd/cms700/cms700.c
board/esd/cpci2dp/cpci2dp.c
board/esd/cpci405/cpci405.c
board/esd/cpci750/mpsc.c
board/esd/cpci750/mv_eth.c
board/esd/cpci750/sdram_init.c
board/esd/cpci750/serial.c
board/esd/cpciiser4/cpciiser4.c
board/esd/dp405/dp405.c
board/esd/du405/du405.c
board/esd/hh405/hh405.c
board/esd/hub405/hub405.c
board/esd/pci405/pci405.c
board/esd/pmc405/pmc405.c
board/esd/vom405/vom405.c
board/etin/debris/debris.c
board/etx094/etx094.c
board/evb4510/evb4510.c
board/evb64260/evb64260.c
board/evb64260/mpsc.c
board/evb64260/sdram_init.c
board/evb64260/serial.c
board/ezkit533/ezkit533.c
board/gcplus/gcplus.c
board/gen860t/fpga.c
board/gen860t/gen860t.c
board/hermes/hermes.c
board/hymod/bsp.c
board/hymod/env.c
board/hymod/hymod.c
board/ids8247/ids8247.c
board/impa7/impa7.c
board/innokom/innokom.c
board/integratorap/integratorap.c
board/integratorcp/integratorcp.c
board/ixdp425/ixdp425.c
board/kb9202/kb9202.c
board/kup/kup4k/kup4k.c
board/lart/lart.c
board/logodl/logodl.c
board/lpd7a40x/lpd7a40x.c
board/lubbock/lubbock.c
board/lwmon/lwmon.c
board/mcc200/mcc200.c
board/ml2/serial.c
board/modnet50/modnet50.c
board/mp2usb/mp2usb.c
board/mpc8349ads/mpc8349ads.c
board/mpc8349ads/pci.c
board/mpl/common/common_util.c
board/mpl/common/memtst.c
board/mpl/common/pci.c
board/mpl/mip405/mip405.c
board/mpl/pip405/pip405.c
board/mpl/vcma9/vcma9.c
board/mvblue/mvblue.c
board/mx1ads/mx1ads.c
board/mx1fs2/mx1fs2.c
board/nc650/flash.c
board/netstar/netstar.c
board/ns9750dev/ns9750dev.c
board/nx823/nx823.c
board/omap1510inn/omap1510innovator.c
board/omap1610inn/omap1610innovator.c
board/omap2420h4/omap2420h4.c
board/omap5912osk/omap5912osk.c
board/omap730p2/omap730p2.c
board/oxc/oxc.c
board/pcippc2/fpga_serial.c
board/pcippc2/pcippc2.c
board/pcippc2/sconsole.c
board/pleb2/pleb2.c
board/pm520/pm520.c
board/pn62/pn62.c
board/prodrive/p3p440/p3p440.c
board/pxa255_idp/pxa_idp.c
board/quantum/quantum.c
board/rbc823/kbd.c
board/sacsng/clkinit.c
board/sandburst/common/sb_common.c
board/sbc405/sbc405.c
board/sbc8240/sbc8240.c
board/sc520_cdp/sc520_cdp.c
board/sc520_spunk/sc520_spunk.c
board/scb9328/scb9328.c
board/shannon/shannon.c
board/siemens/SCM/scm.c
board/sixnet/sixnet.c
board/smdk2400/smdk2400.c
board/smdk2410/smdk2410.c
board/stamp/stamp.c
board/sx1/sx1.c
board/tqm834x/tqm834x.c
board/tqm85xx/tqm85xx.c
board/tqm8xx/flash.c
board/tqm8xx/tqm8xx.c
board/trab/memory.c
board/trab/trab.c
board/trab/vfd.c
board/versatile/versatile.c
board/voiceblue/voiceblue.c
board/wepep250/wepep250.c
board/xaeniax/xaeniax.c
board/xilinx/ml300/serial.c
board/xm250/xm250.c
board/xpedite1k/xpedite1k.c
board/xsengine/xsengine.c
board/zylonite/zylonite.c
common/cmd_bdinfo.c
common/cmd_bedbug.c
common/cmd_boot.c
common/cmd_bootm.c
common/cmd_date.c
common/cmd_elf.c
common/cmd_ide.c
common/cmd_immap.c
common/cmd_load.c
common/cmd_log.c
common/cmd_nvedit.c
common/console.c
common/devices.c
common/dlmalloc.c
common/env_common.c
common/env_dataflash.c
common/env_eeprom.c
common/env_flash.c
common/env_nand.c
common/env_nowhere.c
common/env_nvram.c
common/exports.c
common/hush.c
common/lcd.c
common/lynxkdi.c
common/main.c
common/serial.c
common/soft_i2c.c
cpu/74xx_7xx/cpu.c
cpu/74xx_7xx/speed.c
cpu/74xx_7xx/traps.c
cpu/arm1136/cpu.c
cpu/arm720t/serial.c
cpu/arm720t/serial_netarm.c
cpu/arm920t/at91rm9200/serial.c
cpu/arm920t/cpu.c
cpu/arm920t/ks8695/serial.c
cpu/arm920t/s3c24x0/serial.c
cpu/arm925t/cpu.c
cpu/arm926ejs/cpu.c
cpu/arm946es/cpu.c
cpu/arm_intcm/cpu.c
cpu/bf533/serial.c
cpu/i386/sc520.c
cpu/i386/serial.c
cpu/ixp/cpu.c
cpu/ixp/serial.c
cpu/lh7a40x/cpu.c
cpu/lh7a40x/serial.c
cpu/mcf52x2/serial.c
cpu/mcf52x2/speed.c
cpu/mpc5xx/cpu.c
cpu/mpc5xx/serial.c
cpu/mpc5xx/speed.c
cpu/mpc5xxx/cpu.c
cpu/mpc5xxx/cpu_init.c
cpu/mpc5xxx/fec.c
cpu/mpc5xxx/i2c.c
cpu/mpc5xxx/ide.c
cpu/mpc5xxx/serial.c
cpu/mpc5xxx/speed.c
cpu/mpc8220/cpu.c
cpu/mpc8220/cpu_init.c
cpu/mpc8220/dramSetup.c
cpu/mpc8220/i2c.c
cpu/mpc8220/speed.c
cpu/mpc8220/uart.c
cpu/mpc824x/cpu.c
cpu/mpc824x/speed.c
cpu/mpc8260/commproc.c
cpu/mpc8260/cpu.c
cpu/mpc8260/cpu_init.c
cpu/mpc8260/ether_fcc.c
cpu/mpc8260/i2c.c
cpu/mpc8260/interrupts.c
cpu/mpc8260/pci.c
cpu/mpc8260/serial_scc.c
cpu/mpc8260/serial_smc.c
cpu/mpc8260/speed.c
cpu/mpc83xx/cpu.c
cpu/mpc83xx/cpu_init.c
cpu/mpc83xx/interrupts.c
cpu/mpc83xx/speed.c
cpu/mpc83xx/traps.c
cpu/mpc85xx/commproc.c
cpu/mpc85xx/cpu_init.c
cpu/mpc85xx/serial_scc.c
cpu/mpc85xx/speed.c
cpu/mpc85xx/traps.c
cpu/mpc8xx/commproc.c
cpu/mpc8xx/cpu.c
cpu/mpc8xx/cpu_init.c
cpu/mpc8xx/fec.c
cpu/mpc8xx/i2c.c
cpu/mpc8xx/serial.c
cpu/mpc8xx/speed.c
cpu/mpc8xx/video.c
cpu/nios/serial.c
cpu/nios2/serial.c
cpu/ppc4xx/405gp_pci.c
cpu/ppc4xx/cpu.c
cpu/ppc4xx/cpu_init.c
cpu/ppc4xx/i2c.c
cpu/ppc4xx/interrupts.c
cpu/ppc4xx/serial.c
cpu/ppc4xx/speed.c
cpu/pxa/cpu.c
cpu/pxa/serial.c
cpu/s3c44b0/serial.c
cpu/sa1100/cpu.c
cpu/sa1100/serial.c
drivers/netconsole.c
drivers/ns9750_serial.c
drivers/ps2ser.c
drivers/s3c4510b_uart.c
drivers/serial.c
drivers/serial_max3100.c
drivers/tsec.c
examples/mem_to_mem_idma2intr.c
examples/timer.c
lib_arm/armlinux.c
lib_blackfin/board.c
lib_i386/bios_setup.c
lib_i386/board.c
lib_m68k/board.c
lib_m68k/m68k_linux.c
lib_microblaze/board.c
lib_mips/mips_linux.c
lib_nios/board.c
lib_nios2/board.c
lib_ppc/board.c
net/net.c
post/ether.c
post/memory.c
post/post.c
post/sysmon.c
post/uart.c

index db9899af459957d698ad432a876f146f22e1b9df..a1b52502abbc93d8bdc2975e448cec13bf34ccc5 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
 Changes since U-Boot 1.1.4:
 ======================================================================
 
+* GCC-4.x fixes: clean up global data pointer initialization for all
+  boards
+
 * Update for Delta board:
   - redundant NAND environment
   - misc Monahans cleanups (remove dead code etc.)
diff --git a/README b/README
index 59f4cd2872a3307a94a0917cda00903078bfad24..ae9e10f533fe86c23f00a21869c32233b16cdf66 100644 (file)
--- a/README
+++ b/README
@@ -3309,6 +3309,8 @@ On ARM, the following registers are used:
 
     ==> U-Boot will use R8 to hold a pointer to the global data
 
+NOTE: DECLARE_GLOBAL_DATA_PTR must be used with file-global scope,
+or current versions of GCC may "optimize" the code too much.
 
 Memory Management:
 ------------------
index 0934e1b693aeb7fd0e16d60e04e5e8deace8a1d9..40f41c78185dbf6de24cc6fe3822af5650029fcb 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * (C) Copyright 2002
  * Hyperion Entertainment, ThomasF@hyperion-entertainment.com
+ * (C) Copyright 2006
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -88,8 +89,6 @@ long initdram (int board_type)
 
 void after_reloc (ulong dest_addr, gd_t *gd)
 {
-/* HJF:        DECLARE_GLOBAL_DATA_PTR; */
-
        board_init_r (gd, dest_addr);
 }
 
index a4dad6486b043ad130fd1ccaf4470f152e2d75aa..3901b80c1124395200b2f950b021812651448523 100644 (file)
@@ -29,6 +29,8 @@
 #include "smbus.h"
 #include "via686.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef DEBUG
 
 struct dimm_bank {
@@ -82,7 +84,6 @@ static inline unsigned short NSto10PS (unsigned char spd_byte)
 
 long detect_sdram (uint8 * rom, int dimmNum, struct dimm_bank *banks)
 {
-    DECLARE_GLOBAL_DATA_PTR;
        int dimm_address = (dimmNum == 0) ? SM_DIMM0_ADDR : SM_DIMM1_ADDR;
        uint32 busclock = gd->bus_clk;
        uint32 memclock = busclock;
@@ -394,8 +395,6 @@ uint32 burst_to_len (uint32 support)
 
 long articiaS_ram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        register uint32 i;
        register uint32 value1;
        register uint32 value2;
index d2e9f292e084d8dec2c55dbc418b782976489f58..480dae5b968c3efe948b438f4a3c27f8a506fbb7 100644 (file)
@@ -26,6 +26,8 @@
 #include "memio.h"
 #include "articiaS.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef ARTICIA_PCI_DEBUG
 
 #ifdef  ARTICIA_PCI_DEBUG
@@ -493,8 +495,6 @@ pci_dev_t video_dev;
 
 int articiaS_init_vga (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
     extern void shutdown_bios(void);
     pci_dev_t dev = ~0;
     int busnr = 0;
index 3e2835aaeba5a12554905bdd6c6c73ffee50d03a..143bba2f154099f17837ee4b9875ef1eea4b491e 100644 (file)
@@ -3,6 +3,7 @@
 #include "../disk/part_amiga.h"
 #include <asm/cache.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 #undef BOOTA_DEBUG
 
@@ -108,8 +109,6 @@ int do_boota (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 
        s = getenv ("autostart");
        if (s && strcmp (s, "yes") == 0) {
-               DECLARE_GLOBAL_DATA_PTR;
-
                void (*boot) (bd_t *, char *, block_dev_desc_t *);
                char *args;
 
index e83fb46c73550f300cae3338b453857df1304103..b6f57c7246bd652cc33ff66159261e1e1ea891cb 100644 (file)
@@ -4,6 +4,8 @@
 #include "memio.h"
 #include "articiaS.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifndef CFG_NS16550
 static uint32 ComPort1;
 
@@ -150,8 +152,6 @@ const NS16550_t Com1 = (NS16550_t) CFG_NS16550_COM2;
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uint32 clock_divisor = 115200 / gd->baudrate;
 
        NS16550_init (Com0, clock_divisor);
@@ -239,8 +239,6 @@ void serial_puts (const char *string)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uint32 clock_divisor = 115200 / gd->baudrate;
 
        NS16550_init (Com0, clock_divisor);
index c797e47691b9d893ab69388ed9c3e9c2121c6aa1..3606db82e0a7d48d63424a36d98e0051eb853d21 100644 (file)
@@ -28,6 +28,8 @@
 #include "via686.h"
 #include "i8259.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef VIA_DEBUG
 
 #ifdef  VIA_DEBUG
@@ -226,33 +228,31 @@ __asm         ("    .globl via_calibrate_time_base \n"
 
 extern unsigned long via_calibrate_time_base(void);
 
-void via_calibrate_bus_freq(void)
+void via_calibrate_bus_freq (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
-    unsigned long tb;
+       unsigned long tb;
 
-    /* This is 20 microseconds */
-    #define CALIBRATE_TIME 28636
+       /* This is 20 microseconds */
+#define CALIBRATE_TIME 28636
 
+       /* Enable the timer (and disable speaker) */
+       unsigned char c;
 
-    /* Enable the timer (and disable speaker) */
-    unsigned char c;
-    c = in_byte(0x61);
-    out_byte(0x61, ((c & ~0x02) | 0x01));
+       c = in_byte (0x61);
+       out_byte (0x61, ((c & ~0x02) | 0x01));
 
-    /* Set timer 2 to low/high writing */
-    out_byte(0x43, 0xb0);
-    out_byte(0x42, CALIBRATE_TIME & 0xff);
-    out_byte(0x42, CALIBRATE_TIME >>8);
+       /* Set timer 2 to low/high writing */
+       out_byte (0x43, 0xb0);
+       out_byte (0x42, CALIBRATE_TIME & 0xff);
+       out_byte (0x42, CALIBRATE_TIME >> 8);
 
-    /* Read the time base */
-    tb = via_calibrate_time_base();
+       /* Read the time base */
+       tb = via_calibrate_time_base ();
 
-    if (tb >= 700000)
-       gd->bus_clk = 133333333;
-    else
-       gd->bus_clk = 100000000;
+       if (tb >= 700000)
+               gd->bus_clk = 133333333;
+       else
+               gd->bus_clk = 100000000;
 
 }
 
index 36e3c624a982c7f5a3d09a9fa12f33fcb05922ea..f6327f72038c83862c9483b7fd9cd28b54a95aaf 100644 (file)
@@ -26,6 +26,8 @@
 #include "memio.h"
 #include <part.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 unsigned char *cursor_position;
 unsigned int cursor_row;
 unsigned int cursor_col;
@@ -480,7 +482,6 @@ extern char version_string[];
 void video_banner(void)
 {
     block_dev_desc_t *ide;
-    DECLARE_GLOBAL_DATA_PTR;
     int i;
     char *s;
     int maxdev;
index 9d0d2138e21785d9193e531bad74bbfa7c235ba2..6a1d4d7f5c7632498d013ba92158bce9c4f2f1c3 100644 (file)
 
 #include "ns16550.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_MPSC
 
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #if (defined CFG_INIT_CHAN1) || (defined CFG_INIT_CHAN2)
        int clock_divisor = 230400 / gd->baudrate;
 #endif
@@ -88,8 +88,6 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        galbrg_set_baudrate (CONFIG_MPSC_PORT, gd->baudrate);
 }
 
@@ -97,8 +95,6 @@ void serial_setbrg (void)
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int clock_divisor = 230400 / gd->baudrate;
 
 #ifdef CFG_INIT_CHAN1
@@ -130,8 +126,6 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int clock_divisor = 230400 / gd->baudrate;
 
 #ifdef CFG_INIT_CHAN1
index ccb3adc66c859f1d0ac371a725c94314f012314e..d8acd31953177f765a0941e758236b641030d75e 100644 (file)
@@ -42,6 +42,8 @@
 
 #include "../include/memory.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Define this if you wish to use the MPSC as a register based UART.
  * This will force the serial port to not use the SDMA engine at all.
  */
@@ -114,9 +116,7 @@ static void mpsc_debug_init (void)
 
        /* Clear the CFR  (CHR4) */
        /* Write random 'Z' bit (bit 29) of CHR4 to enable debug uart *UNDOCUMENTED FEATURE* */
-       temp = GTREGREAD (GALMPSC_CHANNELREG_4 + (CHANNEL * GALMPSC_indent: Standard input:229: Warning:old style assignment ambiguity in "=&".  Assuming "= &"
-
-REG_GAP));
+       temp = GTREGREAD (GALMPSC_CHANNELREG_4 + (CHANNEL * GALMPSC_REG_GAP));
        temp &= 0xffffff00;
        temp |= BIT29;
        GT_REG_WRITE (GALMPSC_CHANNELREG_4 + (CHANNEL * GALMPSC_REG_GAP),
@@ -158,7 +158,6 @@ char mpsc_getchar_debug (void)
  * global variables [josh] */
 int mpsc_putchar_early (char ch)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int mpsc = CHANNEL;
        int temp =
                GTREGREAD (GALMPSC_CHANNELREG_2 + (mpsc * GALMPSC_REG_GAP));
@@ -511,7 +510,6 @@ void mpsc_init2 (void)
 
 int galbrg_set_baudrate (int channel, int rate)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int clock;
 
        galbrg_disable (channel);       /*ok */
index 3c5dee73b7fbdb97ea5031566d66165be489bd03..e5a87ad295208358119effb128bcb1e8c371cd50 100644 (file)
@@ -732,6 +732,7 @@ int mv64360_eth_xmit (struct eth_device *dev, volatile void *dataPtr,
        pkt_info.cmd_sts = ETH_TX_FIRST_DESC | ETH_TX_LAST_DESC;        /* DMA owned, first last */
        pkt_info.byte_cnt = dataSize;
        pkt_info.buf_ptr = (unsigned int) dataPtr;
+       pkt_info.return_info = 0;
 
        status = eth_port_send (ethernet_private, ETH_Q0, &pkt_info);
        if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL)) {
index d2635f88ebd63293d90ec1372f6c12c030dfd139..f04aaf9a6edb12f0228187826acc3dd1c4b5d85d 100644 (file)
@@ -42,6 +42,8 @@
 #include "64360.h"
 #include "mv_regs.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef DEBUG
 #define MAP_PCI
 
@@ -246,8 +248,6 @@ static inline unsigned short NSto10PS (unsigned char spd_byte)
 /* static int check_dimm(uchar slot, AUX_MEM_DIMM_INFO *info) */
 static int check_dimm (uchar slot, AUX_MEM_DIMM_INFO * dimmInfo)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long spd_checksum;
 
 #ifdef ZUMA_NTL
index 33fbc491626ed22a0a425fc0e66cbb8f9957c8f3..b783aff8d1c585bebc8f7b1afc178879ee70250a 100644 (file)
@@ -42,6 +42,8 @@
 
 #include "../include/memory.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Define this if you wish to use the MPSC as a register based UART.
  * This will force the serial port to not use the SDMA engine at all.
  */
@@ -114,9 +116,7 @@ static void mpsc_debug_init (void)
 
        /* Clear the CFR  (CHR4) */
        /* Write random 'Z' bit (bit 29) of CHR4 to enable debug uart *UNDOCUMENTED FEATURE* */
-       temp = GTREGREAD (GALMPSC_CHANNELREG_4 + (CHANNEL * GALMPSC_indent: Standard input:229: Warning:old style assignment ambiguity in "=&".  Assuming "= &"
-
-REG_GAP));
+       temp = GTREGREAD (GALMPSC_CHANNELREG_4 + (CHANNEL * GALMPSC_REG_GAP));
        temp &= 0xffffff00;
        temp |= BIT29;
        GT_REG_WRITE (GALMPSC_CHANNELREG_4 + (CHANNEL * GALMPSC_REG_GAP),
@@ -158,7 +158,6 @@ char mpsc_getchar_debug (void)
  * global variables [josh] */
 int mpsc_putchar_early (char ch)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int mpsc = CHANNEL;
        int temp =
                GTREGREAD (GALMPSC_CHANNELREG_2 + (mpsc * GALMPSC_REG_GAP));
@@ -511,7 +510,6 @@ void mpsc_init2 (void)
 
 int galbrg_set_baudrate (int channel, int rate)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int clock;
 
        galbrg_disable (channel);       /*ok */
index ec5d581065c7f6beb9c3838426ca27352829735e..b2c7835a57981a5497540d2a9d8b4e8ab58b69d2 100644 (file)
@@ -731,6 +731,7 @@ int mv64460_eth_xmit (struct eth_device *dev, volatile void *dataPtr,
        pkt_info.cmd_sts = ETH_TX_FIRST_DESC | ETH_TX_LAST_DESC;        /* DMA owned, first last */
        pkt_info.byte_cnt = dataSize;
        pkt_info.buf_ptr = (unsigned int) dataPtr;
+       pkt_info.return_info = 0;
 
        status = eth_port_send (ethernet_private, ETH_Q0, &pkt_info);
        if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL)) {
index 8cfe84c217619367d898dca0deec354f9b8627d7..176220232e5de79e3510a838a6af867d4ce6cd6b 100644 (file)
@@ -42,6 +42,8 @@
 #include "64460.h"
 #include "mv_regs.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef DEBUG
 #define        MAP_PCI
 
@@ -246,8 +248,6 @@ static inline unsigned short NSto10PS (unsigned char spd_byte)
 /* static int check_dimm(uchar slot, AUX_MEM_DIMM_INFO *info) */
 static int check_dimm (uchar slot, AUX_MEM_DIMM_INFO * dimmInfo)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long spd_checksum;
 
 #ifdef ZUMA_NTL
index 5e770e9493d2649ae2f2595151d7c242031cb8ff..c430d634e12f9cf4aa09dc2748aa7d79ab8fa8b2 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 /*
@@ -38,8 +40,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -62,8 +62,6 @@ int board_late_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index a2595eec520e82c94af18edaead7beeb975ba567..dcafac950d67bcf96ca35828f8c0e2e11131f883 100644 (file)
@@ -28,6 +28,8 @@
 #define FLASH_ONBD_N           2       /* 00000010 */
 #define FLASH_SRAM_SEL         1       /* 00000001 */
 
+DECLARE_GLOBAL_DATA_PTR;
+
 long int fixed_sdram(void);
 
 int board_early_init_f(void)
@@ -107,7 +109,7 @@ long int initdram(int board_type)
        long dram_size = 0;
 
 #if defined(CONFIG_SPD_EEPROM)
-       dram_size = spd_sdram(0);
+       dram_size = spd_sdram();
 #else
        dram_size = fixed_sdram();
 #endif
@@ -235,8 +237,6 @@ int pci_pre_init(struct pci_controller *hose)
 #if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
 void pci_target_init(struct pci_controller *hose)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*--------------------------------------------------------------------------+
         * Disable everything
         *--------------------------------------------------------------------------*/
index c6b79a9f5ffdabd6f60788613e2cf632835e3527..06a57f6c4aac3c8b2df8282b764d50b9901b5a5b 100644 (file)
@@ -28,6 +28,7 @@
 #include <spd_sdram.h>
 #include "epld.h"
 
+DECLARE_GLOBAL_DATA_PTR;
 
 extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
 
@@ -291,8 +292,6 @@ int pci_pre_init( struct pci_controller *hose )
 #if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
 void pci_target_init(struct pci_controller *hose)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*--------------------------------------------------------------------------+
         * Disable everything
         *--------------------------------------------------------------------------*/
index d1a29c52a513787b4f48f1365dd2153d682c7aaa..3f6d2042d72150b39a4a157a1dcb9050f6f6a216 100644 (file)
@@ -30,6 +30,8 @@
 #include <spd_sdram.h>
 #include <ppc4xx_enet.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define BOOT_SMALL_FLASH       32      /* 00100000 */
 #define FLASH_ONBD_N           2       /* 00000010 */
 #define FLASH_SRAM_SEL         1       /* 00000001 */
@@ -204,7 +206,7 @@ long int initdram (int board_type)
        long dram_size = 0;
 
 #if defined(CONFIG_SPD_EEPROM)
-       dram_size = spd_sdram (0);
+       dram_size = spd_sdram ();
 #else
        dram_size = fixed_sdram ();
 #endif
@@ -334,8 +336,6 @@ int pci_pre_init(struct pci_controller * hose )
 #if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
 void pci_target_init(struct pci_controller * hose )
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*--------------------------------------------------------------------------+
         * Disable everything
         *--------------------------------------------------------------------------*/
index f1a96a6e7d23a9c90209ccb7caa66d32b74548ef..292e02609e2380847ef92e2493d6b4dab4ff144b 100644 (file)
@@ -99,7 +99,7 @@ void sdram_init(void)
  */
 long int initdram(int board_type)
 {
-       return spd_sdram(0);
+       return spd_sdram();
 }
 
 int testdram(void)
index 8ddf910c8e4e37264ab8e4f292bc9abb3da241f1..20965c8e3ead7e039b17eb289f5e864af425e6ea 100644 (file)
@@ -24,6 +24,8 @@
 #include <asm/processor.h>
 #include <spd_sdram.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips   */
 
 int board_early_init_f(void)
@@ -136,7 +138,6 @@ int board_early_init_f(void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        uint pbcr;
        int size_val = 0;
 
index 509d8e4cce422daa8c23f09dd2efe734a94f53da..392d0dc34e40b07077916d717cb41d22e4232827 100644 (file)
@@ -24,6 +24,8 @@
 #include <asm/processor.h>
 #include <spd_sdram.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips   */
 
 int board_early_init_f(void)
@@ -132,7 +134,6 @@ int board_early_init_f(void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        uint pbcr;
        int size_val = 0;
 
index 39c415792592e91157adc6eeee57ac464d9af091..c6ee7728129db67f0cfa3dab0b3b5fcb8019ebc8 100644 (file)
@@ -27,9 +27,7 @@
 
 #include <ns16550.h>
 
-#if 0
-#include "serial.h"
-#endif
+DECLARE_GLOBAL_DATA_PTR;
 
 const NS16550_t COM_PORTS[] =
        { (NS16550_t) CFG_NS16550_COM1, (NS16550_t) CFG_NS16550_COM2 };
@@ -40,8 +38,6 @@ static int gComPort = 0;
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
 
        (void) NS16550_init (COM_PORTS[0], clock_divisor);
@@ -71,8 +67,6 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
 
 #ifdef CFG_INIT_CHAN1
index de04c66385462bdfb6e9066df5000765a4d1b936..ca5bd1d1640403de06d81afbd88f854ebfb21492 100644 (file)
@@ -28,6 +28,8 @@
 #include <common.h>
 #include <clps7111.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 
@@ -37,8 +39,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Activate LED flasher */
        IO_LEDFLSH = 0x40;
 
@@ -53,8 +53,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index d3ccbb536763453e669a43949fa49d0049dcbcd4..4f84a58117b6a6069a4278326fa823d240c7c71f 100644 (file)
@@ -27,6 +27,8 @@
 #include <common.h>
 #include <SA-1100.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 /*
@@ -99,8 +101,6 @@ neponset_init(void)
 int
 board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_arch_number = MACH_TYPE_ASSABET;
        gd->bd->bi_boot_params = 0xc0000100;
 
@@ -112,8 +112,6 @@ board_init(void)
 int
 dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 90167768539174d40dae3f14d21d64b0781402cc..002981a762481e01cd3ce1816946d13c9bebdd13 100644 (file)
@@ -27,6 +27,8 @@
 #include <at91rm9200_net.h>
 #include <dm9161.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 /*
  * Miscelaneous platform dependent initialisations
@@ -34,8 +36,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Enable Ctrlc */
        console_init_f ();
 
@@ -56,8 +56,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
        return 0;
index f36a41b9ffaa4dcc457de8eb4a6b28e51f94e98f..712a95b19e50e50e4b39449708d1a90d42369ba1 100644 (file)
@@ -24,6 +24,8 @@
 #include <common.h>
 #include "ns16550.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if CONFIG_CONS_INDEX == 1
 static struct NS16550 *console =
                (struct NS16550 *) (CFG_EUMB_ADDR + 0x4500);
@@ -38,8 +40,6 @@ extern ulong get_bus_freq (ulong);
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int clock_divisor = gd->bus_clk / 16 / gd->baudrate;
 
        NS16550_init (CONFIG_CONS_INDEX - 1, clock_divisor);
@@ -75,8 +75,6 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int clock_divisor = get_bus_freq (0) / 16 / gd->baudrate;
 
        NS16550_reinit (console, clock_divisor);
index cc1bc16f6e127904548a26535d93c47bb30fc29d..307894fd613d4ff44f7b4c105db0c20d94de22a1 100644 (file)
@@ -27,6 +27,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 
@@ -36,8 +38,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -60,8 +60,6 @@ int board_late_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index 4d2013b4073c6e8053f511f3b0a11556d863623f..d34737c4979af53539acd9cf36ee5bd9a058ee03 100644 (file)
@@ -31,6 +31,8 @@
 #include <common.h>
 #include <asm/arch/platform.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 #define        ks8695_read(a)    *((volatile unsigned int *) (KS8695_IO_BASE+(a)))
@@ -75,8 +77,6 @@ int board_late_init (void)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number of CM4008 */
        gd->bd->bi_arch_number = 624;
 
@@ -92,8 +92,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
 
index 65eaa942c54c3a03484e50cae6b5143f3bd573ca..02d05afef6e824b618e872670a3af75c7e6723e2 100644 (file)
@@ -31,6 +31,8 @@
 #include <common.h>
 #include <asm/arch/platform.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 #define        ks8695_read(a)    *((volatile unsigned int *) (KS8695_IO_BASE+(a)))
@@ -75,8 +77,6 @@ int board_late_init (void)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number of CM41xx */
        gd->bd->bi_arch_number = 672;
 
@@ -92,8 +92,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
 
index 14168e636bb8a06694bf0de5d9941608866b51e8..9ae3c42be50685ef92ff5e78f348348b08a68991 100644 (file)
@@ -33,6 +33,8 @@
 #include <at91rm9200_net.h>
 #include <dm9161.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 /*
  * Miscelaneous platform dependent initialisations
@@ -45,7 +47,6 @@ int hw_detect (void);
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        AT91PS_PIO piob = AT91C_BASE_PIOB;
        AT91PS_PIO pioc = AT91C_BASE_PIOC;
 
@@ -109,8 +110,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
        return 0;
index 4c200170d0db13daed80ac597d9ab49941f45974..2b595a85aea872c000407245c438fdcb0581e704 100644 (file)
@@ -6,6 +6,8 @@
 #include <common.h>
 #include <board/cogent/serial.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if (CMA_MB_CAPS & CMA_MB_CAP_SERPAR)
 
 #if (defined(CONFIG_8xx) && defined(CONFIG_8xx_CONS_NONE)) || \
 
 int serial_init (void)
 {
-/*  DECLARE_GLOBAL_DATA_PTR; */
-
-    cma_mb_serial *mbsp = (cma_mb_serial *)CMA_MB_SERIAL_BASE;
+       cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
 
-    cma_mb_reg_write(&mbsp->ser_ier, 0x00);    /* turn off interrupts */
-    serial_setbrg ();
-    cma_mb_reg_write(&mbsp->ser_lcr, 0x03);    /* 8 data, 1 stop, no parity */
-    cma_mb_reg_write(&mbsp->ser_mcr, 0x03);    /* RTS/DTR */
-    cma_mb_reg_write(&mbsp->ser_fcr, 0x07);    /* Clear & enable FIFOs */
+       cma_mb_reg_write (&mbsp->ser_ier, 0x00);        /* turn off interrupts */
+       serial_setbrg ();
+       cma_mb_reg_write (&mbsp->ser_lcr, 0x03);        /* 8 data, 1 stop, no parity */
+       cma_mb_reg_write (&mbsp->ser_mcr, 0x03);        /* RTS/DTR */
+       cma_mb_reg_write (&mbsp->ser_fcr, 0x07);        /* Clear & enable FIFOs */
 
-    return (0);
+       return (0);
 }
 
-void
-serial_setbrg (void)
+void serial_setbrg (void)
 {
-    DECLARE_GLOBAL_DATA_PTR;
-
-    cma_mb_serial *mbsp = (cma_mb_serial *)CMA_MB_SERIAL_BASE;
-    unsigned int divisor;
-    unsigned char lcr;
-
-    if ((divisor = br_to_div(gd->baudrate)) == 0)
-       divisor = DEFDIV;
-
-    lcr = cma_mb_reg_read(&mbsp->ser_lcr);
-    cma_mb_reg_write(&mbsp->ser_lcr, lcr|0x80);/* Access baud rate(set DLAB)*/
-    cma_mb_reg_write(&mbsp->ser_brl, divisor & 0xff);
-    cma_mb_reg_write(&mbsp->ser_brh, (divisor >> 8) & 0xff);
-    cma_mb_reg_write(&mbsp->ser_lcr, lcr);     /* unset DLAB */
+       cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
+       unsigned int divisor;
+       unsigned char lcr;
+
+       if ((divisor = br_to_div (gd->baudrate)) == 0)
+               divisor = DEFDIV;
+
+       lcr = cma_mb_reg_read (&mbsp->ser_lcr);
+       cma_mb_reg_write (&mbsp->ser_lcr, lcr | 0x80);  /* Access baud rate(set DLAB) */
+       cma_mb_reg_write (&mbsp->ser_brl, divisor & 0xff);
+       cma_mb_reg_write (&mbsp->ser_brh, (divisor >> 8) & 0xff);
+       cma_mb_reg_write (&mbsp->ser_lcr, lcr); /* unset DLAB */
 }
 
-void
-serial_putc(const char c)
+void serial_putc (const char c)
 {
-    cma_mb_serial *mbsp = (cma_mb_serial *)CMA_MB_SERIAL_BASE;
+       cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
 
-    if (c == '\n')
-       serial_putc('\r');
+       if (c == '\n')
+               serial_putc ('\r');
 
-    while ((cma_mb_reg_read(&mbsp->ser_lsr) & LSR_THRE) == 0)
-       ;
+       while ((cma_mb_reg_read (&mbsp->ser_lsr) & LSR_THRE) == 0);
 
-    cma_mb_reg_write(&mbsp->ser_thr, c);
+       cma_mb_reg_write (&mbsp->ser_thr, c);
 }
 
-void
-serial_puts(const char *s)
+void serial_puts (const char *s)
 {
-    while (*s != '\0')
-       serial_putc(*s++);
+       while (*s != '\0')
+               serial_putc (*s++);
 }
 
-int
-serial_getc(void)
+int serial_getc (void)
 {
-    cma_mb_serial *mbsp = (cma_mb_serial *)CMA_MB_SERIAL_BASE;
+       cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
 
-    while ((cma_mb_reg_read(&mbsp->ser_lsr) & LSR_DR) == 0)
-       ;
+       while ((cma_mb_reg_read (&mbsp->ser_lsr) & LSR_DR) == 0);
 
-    return ((int)cma_mb_reg_read(&mbsp->ser_rhr) & 0x7f);
+       return ((int) cma_mb_reg_read (&mbsp->ser_rhr) & 0x7f);
 }
 
-int
-serial_tstc(void)
+int serial_tstc (void)
 {
-    cma_mb_serial *mbsp = (cma_mb_serial *)CMA_MB_SERIAL_BASE;
+       cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_SERIAL_BASE;
 
-    return ((cma_mb_reg_read(&mbsp->ser_lsr) & LSR_DR) != 0);
+       return ((cma_mb_reg_read (&mbsp->ser_lsr) & LSR_DR) != 0);
 }
 
 #endif /* CONS_NONE */
@@ -118,71 +109,63 @@ serial_tstc(void)
 #error CONFIG_KGDB_INDEX must be configured for Cogent motherboard serial
 #endif
 
-void
-kgdb_serial_init(void)
+void kgdb_serial_init (void)
 {
-    cma_mb_serial *mbsp = (cma_mb_serial *)CMA_MB_KGDB_SER_BASE;
-    unsigned int divisor;
+       cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_KGDB_SER_BASE;
+       unsigned int divisor;
 
-    if ((divisor = br_to_div(CONFIG_KGDB_BAUDRATE)) == 0)
-       divisor = DEFDIV;
+       if ((divisor = br_to_div (CONFIG_KGDB_BAUDRATE)) == 0)
+               divisor = DEFDIV;
 
-    cma_mb_reg_write(&mbsp->ser_ier, 0x00);    /* turn off interrupts */
-    cma_mb_reg_write(&mbsp->ser_lcr, 0x80);    /* Access baud rate(set DLAB)*/
-    cma_mb_reg_write(&mbsp->ser_brl, divisor & 0xff);
-    cma_mb_reg_write(&mbsp->ser_brh, (divisor >> 8) & 0xff);
-    cma_mb_reg_write(&mbsp->ser_lcr, 0x03);    /* 8 data, 1 stop, no parity */
-    cma_mb_reg_write(&mbsp->ser_mcr, 0x03);    /* RTS/DTR */
-    cma_mb_reg_write(&mbsp->ser_fcr, 0x07);    /* Clear & enable FIFOs */
+       cma_mb_reg_write (&mbsp->ser_ier, 0x00);        /* turn off interrupts */
+       cma_mb_reg_write (&mbsp->ser_lcr, 0x80);        /* Access baud rate(set DLAB) */
+       cma_mb_reg_write (&mbsp->ser_brl, divisor & 0xff);
+       cma_mb_reg_write (&mbsp->ser_brh, (divisor >> 8) & 0xff);
+       cma_mb_reg_write (&mbsp->ser_lcr, 0x03);        /* 8 data, 1 stop, no parity */
+       cma_mb_reg_write (&mbsp->ser_mcr, 0x03);        /* RTS/DTR */
+       cma_mb_reg_write (&mbsp->ser_fcr, 0x07);        /* Clear & enable FIFOs */
 
-    printf("[on cma10x serial port B] ");
+       printf ("[on cma10x serial port B] ");
 }
 
-void
-putDebugChar(int c)
+void putDebugChar (int c)
 {
-    cma_mb_serial *mbsp = (cma_mb_serial *)CMA_MB_KGDB_SER_BASE;
+       cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_KGDB_SER_BASE;
 
-    while ((cma_mb_reg_read(&mbsp->ser_lsr) & LSR_THRE) == 0)
-       ;
+       while ((cma_mb_reg_read (&mbsp->ser_lsr) & LSR_THRE) == 0);
 
-    cma_mb_reg_write(&mbsp->ser_thr, c & 0xff);
+       cma_mb_reg_write (&mbsp->ser_thr, c & 0xff);
 }
 
-void
-putDebugStr(const char *str)
+void putDebugStr (const char *str)
 {
-    while (*str != '\0') {
-       if (*str == '\n')
-           putDebugChar('\r');
-       putDebugChar(*str++);
-    }
+       while (*str != '\0') {
+               if (*str == '\n')
+                       putDebugChar ('\r');
+               putDebugChar (*str++);
+       }
 }
 
-int
-getDebugChar(void)
+int getDebugChar (void)
 {
-    cma_mb_serial *mbsp = (cma_mb_serial *)CMA_MB_KGDB_SER_BASE;
+       cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_KGDB_SER_BASE;
 
-    while ((cma_mb_reg_read(&mbsp->ser_lsr) & LSR_DR) == 0)
-       ;
+       while ((cma_mb_reg_read (&mbsp->ser_lsr) & LSR_DR) == 0);
 
-    return ((int)cma_mb_reg_read(&mbsp->ser_rhr) & 0x7f);
+       return ((int) cma_mb_reg_read (&mbsp->ser_rhr) & 0x7f);
 }
 
-void
-kgdb_interruptible(int yes)
+void kgdb_interruptible (int yes)
 {
-    cma_mb_serial *mbsp = (cma_mb_serial *)CMA_MB_KGDB_SER_BASE;
-
-    if (yes == 1) {
-       printf("kgdb: turning serial ints on\n");
-       cma_mb_reg_write(&mbsp->ser_ier, 0xf);
-    }
-    else {
-       printf("kgdb: turning serial ints off\n");
-       cma_mb_reg_write(&mbsp->ser_ier, 0x0);
-    }
+       cma_mb_serial *mbsp = (cma_mb_serial *) CMA_MB_KGDB_SER_BASE;
+
+       if (yes == 1) {
+               printf ("kgdb: turning serial ints on\n");
+               cma_mb_reg_write (&mbsp->ser_ier, 0xf);
+       } else {
+               printf ("kgdb: turning serial ints off\n");
+               cma_mb_reg_write (&mbsp->ser_ier, 0x0);
+       }
 }
 
 #endif /* KGDB && KGDB_NONE */
index 6f65f3275731294158deb8c6e5ec7fec98879529..6d8d55570f8eb0bb3f10b776ad18083c8c1185b5 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/arch/pxa-regs.h>
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 
@@ -181,8 +183,6 @@ int
 board_init (void)
 /**********************************************************/
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        led_code (0xf, YELLOW);
 
        /* arch number of HHP Cradle */
@@ -209,8 +209,6 @@ int
 dram_init (void)
 /**********************************************************/
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index c99a71557c0799b3a7cc4bb753415c762ccbd24b..80caf8b464e17e5bda816760a9248a799845454b 100644 (file)
@@ -26,6 +26,8 @@
 #include <common.h>
 #include <asm/arch/pxa-regs.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
 # define SHOW_BOOT_PROGRESS(arg)        show_boot_progress(arg)
 #else
@@ -65,8 +67,6 @@ int misc_init_r(void)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -88,8 +88,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 6100a53fb7763d00f1df394ee1ea5ddc7394e868..aeb1a138d254aa727784ef965c8e204b960f5b43 100644 (file)
@@ -26,6 +26,8 @@
 #include <at91rm9200_net.h>
 #include <bcm5221.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 /*
  * Miscelaneous platform dependent initialisations
@@ -33,8 +35,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Enable Ctrlc */
        console_init_f ();
 
@@ -51,8 +51,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
        return 0;
index 5844a5cf324b137b41ef1b569c4c63a8774be370..3edd27a3ebd101443f439d26857c35acda5cb9e0 100644 (file)
@@ -2,7 +2,7 @@
  * (C) Copyright 2001
  * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
  *
- * (C) Copyright 2001, 2002
+ * (C) Copyright 2001-2006
  * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
 
  * See file CREDITS for list of people who contributed to this
 #include <asm/processor.h>
 #include <pci.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define BOARD_REV_REG 0xFE80002B
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char  revision = *(volatile char *)(BOARD_REV_REG);
        char  buf[32];
 
index 29676b800fc58bb1146569cb3c68688b0ea2dc2e..64fe948fcce840155976b355922a13c46b9afdab 100644 (file)
 #include <common.h>
 #include <asm/hardware.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Miscelaneous platform dependent initialization
  */
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        u32 temp;
 
        /* Configuration Port Control Register*/
@@ -119,8 +120,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 52055b85b38dad679f5f4f2a8c06cda74520b816..e8302d9fc7f72befebaa790f499ab098201474ab 100644 (file)
@@ -29,6 +29,8 @@
 #include <command.h>
 #include <malloc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 /* Prototypes */
@@ -81,8 +83,6 @@ extern flash_info_t flash_info[];     /* info for FLASH chips */
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* adjust flash start and size as well as the offset */
        gd->bd->bi_flashstart = 0 - flash_info[0].size;
        gd->bd->bi_flashoffset= flash_info[0].size - CFG_MONITOR_LEN;
index 6ef7e2fc26ffbd86b3edc03d75d370d509a1423a..2b7238674258839bf8a03574e5a860cf76070458 100644 (file)
@@ -30,6 +30,8 @@
 #include <da9030.h>
 #include <asm/arch/pxa-regs.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 static void init_DA9030(void);
@@ -40,8 +42,6 @@ static void init_DA9030(void);
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -65,8 +65,6 @@ int board_late_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index 24c3e00c7f57ae423d90f856b3b4b74650e8f5f8..ab8e7beb99b0e2a9d9f3408f313360cc11cc53f9 100644 (file)
@@ -24,8 +24,8 @@
 
 #include <common.h>
 #include <SA-1100.h>
-/* ------------------------------------------------------------------------- */
 
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
        /* arch number of DNP1110-Board */
        gd->bd->bi_arch_number = MACH_TYPE_DNP1110;
 
-    /* flash vpp on */
-    PPDR |= 0x80;      /* assumes LCD controller is off */
-    PPSR |= 0x80;
+       /* flash vpp on */
+       PPDR |= 0x80;   /* assumes LCD controller is off */
+       PPSR |= 0x80;
 
        return 0;
 }
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index fc48ed547e707fe41d3871d4ddeadc90f2962eb0..555475e4d9c5872a3d52bc3f9465def4aa88466c 100644 (file)
@@ -31,6 +31,8 @@
 #include <ns87308.h>
 #include <video_fb.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*---------------------------------------------------------------------------*/
 /*
  * Get Bus clock frequency
@@ -169,8 +171,6 @@ long int initdram (int board_type)
 
 void after_reloc (ulong dest_addr)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*
         * Jump to the main U-Boot board init code
         */
index a9dbeb209599eb71978253afdb72e45ae5b1616a..108adb13d5fb70c4d9ab79973756e562ba43c6ee 100644 (file)
@@ -26,6 +26,8 @@
 #include <mpc106.h>
 #include <video_fb.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 int checkboard (void)
@@ -137,8 +139,6 @@ void watchdog_reset (void)
 
 void after_reloc (ulong dest_addr)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*
         * Jump to the main U-Boot board init code
         */
index 11eab234bce967bbfe19660b8c57d8a1ab02d2a3..6968a5dbdd11d41404dacfd3ae533e1cd281c7b9 100644 (file)
@@ -25,8 +25,7 @@
 #include <common.h>
 #include <clps7111.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -34,8 +33,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Activate LED flasher */
        IO_LEDFLSH = 0x40;
 
@@ -50,8 +47,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 4b2b07a39303dd6c9564eeb261b98b69f1b0ca22..078df001e95cdf7307532818222350bd65413b10 100644 (file)
@@ -26,7 +26,7 @@
 #include <command.h>
 #include <malloc.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 #if 0
 #define FPGA_DEBUG
@@ -166,8 +166,6 @@ int misc_init_f (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile unsigned short *fpga_mode =
                (unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
        volatile unsigned short *fpga_ctrl2 =
@@ -301,8 +299,6 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
index 3aac3c6732936ce5a12807d83ee25db2c542ef67..dfead3363c208a0eb95068cb1f41fb7f40f23335 100644 (file)
@@ -26,6 +26,8 @@
 #include <asm/processor.h>
 #include <command.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*cmd_boot.c*/
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 extern void lxt971_no_sleep(void);
@@ -53,8 +55,6 @@ const unsigned char fpgadata_xl30[] = {
 
 int board_early_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int index, len, i;
        int status;
 
@@ -151,8 +151,6 @@ int board_early_init_f (void)
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int index;
        int len;
        char str[64];
index 2ced6cb17f282767fbf8aad2a658a165da19f2aa..055a39773061ac05cb8839d07b4d8d1a0430e701 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/processor.h>
 #include <command.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 /*cmd_boot.c*/
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
@@ -50,8 +51,6 @@ const unsigned char fpgadata[] = {
 
 int board_early_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long cntrl0Reg;
        int index, len, i;
        int status;
index e283a92764bd743904676814477b23ff1e457fd6..cb04710737426121fe203211b755bda849df039e 100644 (file)
 #include <command.h>
 #include <malloc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 extern void lxt971_no_sleep(void);
 
-
 /* fpga configuration data - not compressed, generated by bin2c */
 const unsigned char fpgadata[] =
 {
@@ -87,8 +87,6 @@ int misc_init_f (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* adjust flash start and offset */
        gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
        gd->bd->bi_flashoffset = 0;
index 1a27ca0911f95d00389e74c6dbbd04d6c8d954f7..36bf329f8192f8962159f3caaa22b7aea955b746 100644 (file)
@@ -26,6 +26,8 @@
 #include <command.h>
 #include <malloc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int board_early_init_f (void)
 {
        unsigned long cntrl0Reg;
@@ -74,7 +76,6 @@ int misc_init_f (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned long cntrl0Reg;
 
        /* adjust flash start and offset */
index 2ab96731e04138181ede471b992e36c5ead969d2..f80361081a6c080d6011a5fa168724515f8fea3e 100644 (file)
@@ -27,7 +27,8 @@
 #include <malloc.h>
 #include <net.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
+
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);       /*cmd_boot.c*/
 #if 0
 #define FPGA_DEBUG
@@ -100,8 +101,6 @@ int board_early_init_f (void)
 #endif
 
 #ifdef FPGA_DEBUG
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* set up serial port with default baudrate */
        (void) get_clocks ();
        gd->baudrate = CONFIG_BAUDRATE;
@@ -126,8 +125,6 @@ int board_early_init_f (void)
                if (status != 0) {
                        /* booting FPGA failed */
 #ifndef FPGA_DEBUG
-                       DECLARE_GLOBAL_DATA_PTR;
-
                        /* set up serial port with default baudrate */
                        (void) get_clocks ();
                        gd->baudrate = CONFIG_BAUDRATE;
@@ -268,7 +265,6 @@ int misc_init_f (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned long cntrl0Reg;
 
        /* adjust flash start and offset */
@@ -707,8 +703,6 @@ U_BOOT_CMD(
  */
 int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd = gd->bd;
        char *buf;
        ulong crc;
index 52398b24ea41665c1f3cd4f66b7de9a0c29d12aa..25c10e062ebfe403e9d142d7ff9d5f76ccf94c20 100644 (file)
@@ -42,6 +42,8 @@
 
 #include "../../Marvell/include/memory.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Define this if you wish to use the MPSC as a register based UART.
  * This will force the serial port to not use the SDMA engine at all.
  */
@@ -157,7 +159,6 @@ char mpsc_getchar_debug (void)
  * global variables [josh] */
 int mpsc_putchar_early (char ch)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int mpsc = CHANNEL;
        int temp =
                GTREGREAD (GALMPSC_CHANNELREG_2 + (mpsc * GALMPSC_REG_GAP));
@@ -510,7 +511,6 @@ void mpsc_init2 (void)
 
 int galbrg_set_baudrate (int channel, int rate)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int clock;
 
        galbrg_disable (channel);       /*ok */
index be176dcc845693f150dba3dda4e01ebccbd5ea04..bc84ef08e6905b12b1bc2583abc5ed9e7a60c53d 100644 (file)
@@ -733,6 +733,7 @@ int mv64360_eth_xmit (struct eth_device *dev, volatile void *dataPtr,
        pkt_info.cmd_sts = ETH_TX_FIRST_DESC | ETH_TX_LAST_DESC;        /* DMA owned, first last */
        pkt_info.byte_cnt = dataSize;
        pkt_info.buf_ptr = (unsigned int) dataPtr;
+       pkt_info.return_info = 0;
 
        status = eth_port_send (ethernet_private, ETH_Q0, &pkt_info);
        if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL)) {
index db545ef68df0739762aea6a3a55b202f0a4dbb92..6bdfc1d1cc00e39386327ec2ad189f7d00447493 100644 (file)
@@ -45,6 +45,7 @@
 #include "64360.h"
 #include "mv_regs.h"
 
+DECLARE_GLOBAL_DATA_PTR;
 
 #undef DEBUG
 /* #define DEBUG */
@@ -250,8 +251,6 @@ NSto10PS(unsigned char spd_byte)
 /* static int check_dimm(uchar slot, AUX_MEM_DIMM_INFO *info) */
 static int check_dimm (uchar slot, AUX_MEM_DIMM_INFO * dimmInfo)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long spd_checksum;
 
        uchar addr = slot == 0 ? DIMM0_I2C_ADDR : DIMM1_I2C_ADDR;
index 44de052566774f6c63fda8a798384a9215e660c8..ba32ac12acedd54ee1b329a5592e55d361a4e5de 100644 (file)
 #include "../../Marvell/include/memory.h"
 #include "serial.h"
 
-
 #include "mpsc.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        mpsc_init (gd->baudrate);
 
        return (0);
@@ -70,8 +69,6 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        galbrg_set_baudrate (CONFIG_MPSC_PORT, gd->baudrate);
 }
 
index 7bf7bb5a5e5490309e68fbfe1567ebc0b411bfc9..fcb8cbbe735caf24f07e576103ea7b91097dbb29 100644 (file)
@@ -26,6 +26,8 @@
 #include <asm/processor.h>
 #include <command.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*cmd_boot.c*/
 
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
@@ -55,8 +57,6 @@ const unsigned char fpgadata[] = {
 
 int board_early_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int index, len, i;
        volatile unsigned char dummy;
        int status;
index fd51f7f343e8fcd5af4356608201b63565b4a4a1..240ab78aa796e71f3b352543ec1ac846297087cb 100644 (file)
@@ -26,6 +26,7 @@
 #include <command.h>
 #include <malloc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 /* fpga configuration data - not compressed, generated by bin2c */
 const unsigned char fpgadata[] =
@@ -84,8 +85,6 @@ int misc_init_f (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* adjust flash start and offset */
        gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
        gd->bd->bi_flashoffset = 0;
index 26e834196bd923f2b2051d8fc9c0e12a8b981b02..a019ce4215093b4b160259723d0850e86917e4b1 100644 (file)
@@ -28,6 +28,8 @@
 #include <405gp_i2c.h>
 #include <command.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*cmd_boot.c*/
 
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
@@ -55,8 +57,6 @@ const unsigned char fpgadata[] = {
 
 int board_early_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int index, len, i;
        int status;
 
index 99fd556c69485c2dbba871dc629ffef1dbc9ccf5..ea344c0f26dd2a7054932f62c0f3c15879113447 100644 (file)
@@ -34,6 +34,8 @@
 #include <pci.h>
 #include <sm501.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_VIDEO_SM501
 
 #define SWAP32(x)       ((((x) & 0x000000ff) << 24) | (((x) & 0x0000ff00) << 8)|\
@@ -358,8 +360,6 @@ int board_early_init_f (void)
 
 int cf_enable(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i;
 
        volatile unsigned short *fpga_ctrl =
@@ -391,8 +391,6 @@ int cf_enable(void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile unsigned short *fpga_ctrl =
                (unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
        volatile unsigned short *lcd_contrast =
@@ -628,8 +626,6 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
@@ -673,8 +669,6 @@ long int initdram (int board_type)
 #ifdef CONFIG_IDE_RESET
 void ide_set_reset(int on)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile unsigned short *fpga_mode =
                (unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
        volatile unsigned short *fpga_status =
@@ -788,8 +782,6 @@ U_BOOT_CMD(eepwren, 2,      0,      do_eep_wren,
  */
 void video_get_info_str (int line_number, char *info)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char str[64];
        char str2[64];
        int i = getenv_r("serial#", str2, sizeof(str));
index 0c6771fb120e4baf39c73496f3236b01cc62ebc6..1e0accbe0e515a3a26b3775561bf56d6aaf8b33c 100644 (file)
 #include <command.h>
 #include <malloc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 extern void lxt971_no_sleep(void);
 
-
 int board_revision(void)
 {
        unsigned long osrl_reg;
@@ -110,8 +110,6 @@ int misc_init_f (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile unsigned char *duart0_mcr = (unsigned char *)((ulong)DUART0_BA + 4);
        volatile unsigned char *duart1_mcr = (unsigned char *)((ulong)DUART1_BA + 4);
        volatile unsigned char *duart2_mcr = (unsigned char *)((ulong)DUART2_BA + 4);
@@ -208,8 +206,6 @@ int misc_init_r (void)
  */
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
index 4be4d7e7d9eb352b97ea4e0a05fe37cbee7546c7..e5d2273f07f478e3a9c826c98792906e6b10a98f 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "pci405.h"
 
+DECLARE_GLOBAL_DATA_PTR;
 
 /* Prototypes */
 int gunzip(void *, int, unsigned char *, unsigned long *);
@@ -111,8 +112,6 @@ int board_revision(void)
 
 unsigned long fpga_done_state(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (gd->board_type < 2) {
                return FPGA_DONE_STATE_V11;
        } else {
@@ -123,8 +122,6 @@ unsigned long fpga_done_state(void)
 
 unsigned long fpga_init_state(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (gd->board_type < 2) {
                return FPGA_INIT_STATE_V11;
        } else {
@@ -320,8 +317,6 @@ int misc_init_r (void)
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
index f9e4d4377c6cc3e320903a9f2e1dc978666437f5..7499671aaf5d031c81994df148aa40a9a94a7dc8 100644 (file)
 #include <command.h>
 #include <malloc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 extern void lxt971_no_sleep(void);
 
-
 /* fpga configuration data - not compressed, generated by bin2c */
 const unsigned char fpgadata[] =
 {
@@ -100,8 +100,6 @@ int board_early_init_f (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* adjust flash start and offset */
        gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
        gd->bd->bi_flashoffset = 0;
index bc5fa7c69b2b2f596254b2e1803c862c78d17613..8be552e2ea2511e3c2ae750db8b654670d022221 100644 (file)
 #include <command.h>
 #include <malloc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 extern void lxt971_no_sleep(void);
 
-
 /* fpga configuration data - not compressed, generated by bin2c */
 const unsigned char fpgadata[] =
 {
@@ -81,8 +81,6 @@ int board_early_init_f (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* adjust flash start and offset */
        gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
        gd->bd->bi_flashoffset = 0;
index 93c502c9de8fac2de5011d40ac0cd5a678daf540..08ed635f346032ce9d3e33733b4374bf4886d958 100644 (file)
@@ -26,6 +26,8 @@
 #include <pci.h>
 #include <i2c.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard (void)
 {
        /*TODO: Check processor type */
@@ -170,8 +172,6 @@ void nvram_write(long dest, const void *src, size_t count)
 
 int misc_init_r(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Write ethernet addr in NVRAM for VxWorks */
        nvram_write(CFG_ENV_ADDR + CFG_NVRAM_VXWORKS_OFFS,
                        (char*)&gd->bd->bi_enetaddr[0], 6);
index dba3c1181e641d231b1be6d9467485b70fc40bac..eb58b5d52989641f0cfc408e5fa38a676e154120 100644 (file)
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <mpc8xx.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 static long int dram_size (long int, long int *, long int);
@@ -90,8 +92,6 @@ const uint sdram_table[] = {
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char *s = getenv ("serial#");
        char *e;
 
index 0008e5a000e32f1b3a337377eb01a47fd09f3fea..13abbb70136ad9f4e1eff95bfb5468dc0e7e30b2 100644 (file)
@@ -25,6 +25,8 @@
 #include <asm/hardware.h>
 #include <command.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_EVB4510
 
 /* ------------------------------------------------------------------------- */
@@ -35,8 +37,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        icache_enable();
 
        /* address for the kernel command line */
@@ -52,7 +52,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
 #if CONFIG_NR_DRAM_BANKS == 2
index 6a9d1645694ebab6b3eace8289d5919f2fbaf739..ab599410b27f1a17d521e15b09684cf4c5553ffd 100644 (file)
@@ -37,6 +37,9 @@
 #include "mpsc.h"
 #include "i2c.h"
 #include "64260.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_ZUMA_V2
 extern void zuma_mbox_init(void);
 #endif
@@ -323,8 +326,6 @@ int misc_init_r (void)
 void
 after_reloc(ulong dest_addr)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* check to see if we booted from the sram.  If so, move things
         * back to the way they should be. (we're running from main
         * memory at this point now */
index ee623ca569275e4976f08b1dc855705008f94864..98ac7f63df9917c8b2d47f46f64618fc684b3a63 100644 (file)
@@ -32,6 +32,8 @@
 #include <malloc.h>
 #include "mpsc.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int (*mpsc_putchar)(char ch) = mpsc_putchar_early;
 
 static volatile unsigned int *rx_desc_base=NULL;
@@ -115,7 +117,6 @@ struct _tag_mirror_hack {
 int
 mpsc_putchar_early(char ch)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int mpsc=CHANNEL;
        int temp=GTREGREAD_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP);
        galmpsc_set_tcschar(mpsc,ch);
@@ -177,79 +178,82 @@ mpsc_putchar_sdma(char ch)
        return 0;
 }
 
-char
-mpsc_getchar(void)
+char mpsc_getchar (void)
 {
-    DECLARE_GLOBAL_DATA_PTR;
-    static unsigned int done = 0;
-    volatile char ch;
-    unsigned int len=0, idx=0, temp;
-
-    volatile unsigned int *p;
-
-
-    do {
-       p=&rx_desc_base[rx_desc_index*8];
-
-       INVALIDATE_DCACHE(&p[0], &p[1]);
-       /* Wait for character */
-       while (p[1] & DESC_OWNER){
-           udelay(100);
-           INVALIDATE_DCACHE(&p[0], &p[1]);
-       }
-
-       /* Handle error case */
-       if (p[1] & (1<<15)) {
-               printf("oops, error: %08x\n", p[1]);
-
-               temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_2,CHANNEL,GALMPSC_REG_GAP);
-               temp |= (1 << 23);
-               GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_2, CHANNEL,GALMPSC_REG_GAP, temp);
-
-               /* Can't poll on abort bit, so we just wait. */
-               udelay(100);
+       static unsigned int done = 0;
+       volatile char ch;
+       unsigned int len = 0, idx = 0, temp;
 
-               galsdma_enable_rx();
-       }
-
-       /* Number of bytes left in this descriptor */
-       len = p[0] & 0xffff;
-
-       if (len) {
-           /* Where to look */
-           idx = 5;
-           if (done > 3) idx = 4;
-           if (done > 7) idx = 7;
-           if (done > 11) idx = 6;
-
-           INVALIDATE_DCACHE(&p[idx], &p[idx+1]);
-           ch = p[idx] & 0xff;
-           done++;
-       }
+       volatile unsigned int *p;
 
-       if (done < len) {
-               /* this descriptor has more bytes still
-                * shift down the char we just read, and leave the
-                * buffer in place for the next time around
-                */
-               p[idx] =  p[idx] >> 8;
-               FLUSH_DCACHE(&p[idx], &p[idx+1]);
-       }
 
-       if (done == len) {
-               /* nothing left in this descriptor.
-                * go to next one
-                */
-               p[1] = DESC_OWNER | DESC_FIRST | DESC_LAST;
-               p[0] = 0x00100000;
-               FLUSH_DCACHE(&p[0], &p[1]);
-               /* Next descriptor */
-               rx_desc_index = (rx_desc_index + 1) % RX_DESC;
-               done = 0;
-       }
-    } while (len==0);  /* galileo bug.. len might be zero */
-
-    return ch;
+       do {
+               p = &rx_desc_base[rx_desc_index * 8];
+
+               INVALIDATE_DCACHE (&p[0], &p[1]);
+               /* Wait for character */
+               while (p[1] & DESC_OWNER) {
+                       udelay (100);
+                       INVALIDATE_DCACHE (&p[0], &p[1]);
+               }
+
+               /* Handle error case */
+               if (p[1] & (1 << 15)) {
+                       printf ("oops, error: %08x\n", p[1]);
+
+                       temp = GTREGREAD_MIRROR (GALMPSC_CHANNELREG_2,
+                                                CHANNEL, GALMPSC_REG_GAP);
+                       temp |= (1 << 23);
+                       GT_REG_WRITE_MIRROR (GALMPSC_CHANNELREG_2, CHANNEL,
+                                            GALMPSC_REG_GAP, temp);
+
+                       /* Can't poll on abort bit, so we just wait. */
+                       udelay (100);
+
+                       galsdma_enable_rx ();
+               }
+
+               /* Number of bytes left in this descriptor */
+               len = p[0] & 0xffff;
+
+               if (len) {
+                       /* Where to look */
+                       idx = 5;
+                       if (done > 3)
+                               idx = 4;
+                       if (done > 7)
+                               idx = 7;
+                       if (done > 11)
+                               idx = 6;
+
+                       INVALIDATE_DCACHE (&p[idx], &p[idx + 1]);
+                       ch = p[idx] & 0xff;
+                       done++;
+               }
+
+               if (done < len) {
+                       /* this descriptor has more bytes still
+                        * shift down the char we just read, and leave the
+                        * buffer in place for the next time around
+                        */
+                       p[idx] = p[idx] >> 8;
+                       FLUSH_DCACHE (&p[idx], &p[idx + 1]);
+               }
+
+               if (done == len) {
+                       /* nothing left in this descriptor.
+                        * go to next one
+                        */
+                       p[1] = DESC_OWNER | DESC_FIRST | DESC_LAST;
+                       p[0] = 0x00100000;
+                       FLUSH_DCACHE (&p[0], &p[1]);
+                       /* Next descriptor */
+                       rx_desc_index = (rx_desc_index + 1) % RX_DESC;
+                       done = 0;
+               }
+       } while (len == 0);     /* galileo bug.. len might be zero */
+
+       return ch;
 }
 
 int
@@ -266,8 +270,6 @@ mpsc_test_char(void)
 int
 mpsc_init(int baud)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        memset(MIRROR_HACK, 0, sizeof(struct _tag_mirror_hack));
        MIRROR_HACK->GALMPSC_ROUTING_REGISTER_M=0x3fffffff;
 
@@ -382,7 +384,6 @@ mpsc_init2(void)
 int
 galbrg_set_baudrate(int channel, int rate)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int clock;
 
        galbrg_disable(channel);
@@ -410,7 +411,6 @@ galbrg_set_baudrate(int channel, int rate)
 static int
 galbrg_set_CDV(int channel, int value)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR(GALBRG_0_CONFREG, channel, GALBRG_REG_GAP);
@@ -424,7 +424,6 @@ galbrg_set_CDV(int channel, int value)
 static int
 galbrg_enable(int channel)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR(GALBRG_0_CONFREG, channel, GALBRG_REG_GAP);
@@ -437,7 +436,6 @@ galbrg_enable(int channel)
 static int
 galbrg_disable(int channel)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR(GALBRG_0_CONFREG, channel, GALBRG_REG_GAP);
@@ -450,7 +448,6 @@ galbrg_disable(int channel)
 static int
 galbrg_set_clksrc(int channel, int value)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR(GALBRG_0_CONFREG,channel, GALBRG_REG_GAP);
@@ -583,7 +580,6 @@ galsdma_set_burstsize(int channel, unsigned int value)
 static int
 galmpsc_connect(int channel, int connect)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR_G(GALMPSC_ROUTING_REGISTER);
@@ -629,7 +625,6 @@ galmpsc_route_serial(int channel, int connect)
 static int
 galmpsc_route_rx_clock(int channel, int brg)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR_G(GALMPSC_RxC_ROUTE);
@@ -647,7 +642,6 @@ galmpsc_route_rx_clock(int channel, int brg)
 static int
 galmpsc_route_tx_clock(int channel, int brg)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR_G(GALMPSC_TxC_ROUTE);
@@ -688,7 +682,6 @@ galmpsc_write_config_regs(int mpsc, int mode)
 static int
 galmpsc_config_channel_regs(int mpsc)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_1,mpsc,GALMPSC_REG_GAP, 0);
        GT_REG_WRITE_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP, 0);
        GT_REG_WRITE(GALMPSC_CHANNELREG_3+(mpsc*GALMPSC_REG_GAP), 1);
@@ -709,7 +702,6 @@ galmpsc_config_channel_regs(int mpsc)
 static int
 galmpsc_set_brkcnt(int mpsc, int value)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_1,mpsc,GALMPSC_REG_GAP);
@@ -723,7 +715,6 @@ galmpsc_set_brkcnt(int mpsc, int value)
 static int
 galmpsc_set_tcschar(int mpsc, int value)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_1,mpsc,GALMPSC_REG_GAP);
@@ -737,7 +728,6 @@ galmpsc_set_tcschar(int mpsc, int value)
 static int
 galmpsc_set_char_length(int mpsc, int value)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR(GALMPSC_PROTOCONF_REG,mpsc,GALMPSC_REG_GAP);
@@ -751,7 +741,6 @@ galmpsc_set_char_length(int mpsc, int value)
 static int
 galmpsc_set_stop_bit_length(int mpsc, int value)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR(GALMPSC_PROTOCONF_REG,mpsc,GALMPSC_REG_GAP);
@@ -764,7 +753,6 @@ galmpsc_set_stop_bit_length(int mpsc, int value)
 static int
 galmpsc_set_parity(int mpsc, int value)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int temp;
 
        temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP);
@@ -784,7 +772,6 @@ galmpsc_set_parity(int mpsc, int value)
 static int
 galmpsc_enter_hunt(int mpsc)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int temp;
 
        temp = GTREGREAD_MIRROR(GALMPSC_CHANNELREG_2,mpsc,GALMPSC_REG_GAP);
@@ -802,7 +789,6 @@ galmpsc_enter_hunt(int mpsc)
 static int
 galmpsc_shutdown(int mpsc)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #if 0
        unsigned int temp;
 
index 8d63c6fa2ab03f169f1af180b60859ed60ab9965..fae6d1090dfdc7bb295deffb355f408cb657132f 100644 (file)
@@ -35,6 +35,8 @@
 #include "i2c.h"
 #include "64260.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* #define     DEBUG */
 #define        MAP_PCI
 
@@ -199,7 +201,6 @@ static int check_dimm (uchar slot, sdram_info_t * info)
  * the array which is passed in with the relevant information */
 static int check_dimm (uchar slot, sdram_info_t * info)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        uchar addr = slot == 0 ? DIMM0_I2C_ADDR : DIMM1_I2C_ADDR;
        int ret;
        uchar rows, cols, sdram_banks, supp_cal, width, cal_val;
index d9c7a157c10abd616c24048408cf67433a2571b7..191445c691c4f0d9978f624f703d79af90f88717 100644 (file)
@@ -39,6 +39,8 @@
 
 #include "mpsc.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if (defined CFG_INIT_CHAN1) || (defined CFG_INIT_CHAN2)
 const NS16550_t COM_PORTS[] = { (NS16550_t) CFG_NS16550_COM1,
                                (NS16550_t) CFG_NS16550_COM2 };
@@ -48,8 +50,6 @@ const NS16550_t COM_PORTS[] = { (NS16550_t) CFG_NS16550_COM1,
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #if (defined CFG_INIT_CHAN1) || (defined CFG_INIT_CHAN2)
        int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
 #endif
@@ -90,8 +90,6 @@ serial_tstc(void)
 void
 serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        galbrg_set_baudrate(CONFIG_MPSC_PORT, gd->baudrate);
 }
 
@@ -99,8 +97,6 @@ serial_setbrg (void)
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
 
 #ifdef CFG_INIT_CHAN1
@@ -137,8 +133,6 @@ serial_tstc(void)
 void
 serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
 
 #ifdef CFG_INIT_CHAN1
index f8ee9003adf71b992527944f410e25620abf0b02..8d6c8de70b0ebbcfb51059d2d0a5b6317a1ceeec 100644 (file)
@@ -30,6 +30,8 @@
 #include "psd4256.h"
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        printf("CPU:   ADSP BF533 Rev.: 0.%d\n", *pCHIPID >> 28);
@@ -41,7 +43,6 @@ int checkboard(void)
 
 long int initdram(int board_type)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef DEBUG
        int brate;
        char *tmp = getenv("baudrate");
index 261e894f46f6e68c39dac61e7c11632ac1b6c698..829b5975976fd250e9379943880fb8b023fa8e7b 100644 (file)
@@ -26,7 +26,8 @@
 
 #include <common.h>
 #include <SA-1100.h>
-/* ------------------------------------------------------------------------- */
+
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -35,8 +36,6 @@
 int
 board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_arch_number = MACH_TYPE_GRAPHICSCLIENT;
 
        gd->bd->bi_boot_params = 0xc000003c; /* Weird address? */
@@ -62,8 +61,6 @@ board_init(void)
 int
 dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index 37788d5396a86af3b4ed1fd717ebca74bf35b906..2ba7e0e4207b92a8997b5b463fead7ff4f7fa62b 100644 (file)
@@ -32,6 +32,8 @@
 #include <command.h>
 #include "fpga.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if (CONFIG_FPGA)
 
 #if 0
@@ -189,8 +191,6 @@ void fpga_selectmap_init (void)
  */
 int gen860t_init_fpga (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i;
 
        PRINTF ("%s:%d: Initialize FPGA interface (relocation offset = 0x%.8lx)\n", __FUNCTION__, __LINE__, gd->reloc_off);
index b7a1b56437aba5e19c6b13d71803c6962e5f0260..eb732210053ada257bf28b0cc97e75b0f2f80769 100644 (file)
@@ -30,6 +30,8 @@
 #include "fpga.h"
 #include "ioport.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
 #endif
@@ -126,8 +128,6 @@ const uint selectmap_upm_table[] = {
  */
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char *s;
        char buf[64];
        int i;
@@ -305,5 +305,3 @@ int post_hotkeys_pressed (void)
        return 0;               /* No hotkeys supported */
 }
 #endif
-
-/* vim: set ts=4 sw=4 tw=78 : */
index e95d9ee3324d76c0773177617939f0b8a3a885a7..a523db1a487d92a94d6298ed5ac8d63b3f25dbe8 100644 (file)
@@ -32,6 +32,8 @@
 # define SHOW_BOOT_PROGRESS(arg)
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 static long int dram_size (long int, long int *, long int);
@@ -105,8 +107,6 @@ const uint sdram_table[] = {
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char *s = getenv ("serial#");
        char *e;
 
index 0596fa4aadeb5d7fd80f45a15e139ba1bebd17c1..6868f260c2094699772505fa06cfda896d593c8d 100644 (file)
@@ -28,6 +28,8 @@
 #include <net.h>
 #include <asm/iopin_8260.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*-----------------------------------------------------------------------
  * Board Special Commands: FPGA load/store, EEPROM erase
  */
@@ -75,8 +77,6 @@
 int
 fpga_load (int mezz, uchar *addr, ulong size)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        hymod_conf_t *cp = &gd->bd->bi_hymod_conf;
        xlx_info_t *fp;
        xlx_iopins_t *fpgaio;
index f9e14213ceb91b4826d3df3ec5ffd2fb6fcb983f..062553bfad087504856c92e86abaab6f33037a3c 100644 (file)
@@ -23,6 +23,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* imports from fetch.c */
 extern int fetch_and_parse (char *, ulong, int (*)(uchar *, uchar *));
 
@@ -32,8 +34,6 @@ static char *def_global_env_path = "/hymod/global_env";
 static int
 env_callback (uchar *name, uchar *value)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        hymod_conf_t *cp = &gd->bd->bi_hymod_conf;
        char ov[CFG_CBSIZE], nv[CFG_CBSIZE], *p, *q, *nn, c, *curver, *newver;
        int override = 1, append = 0, remove = 0, nnl, ovl, nvl;
index dea0a70a23a410aa68772a9226500080c64e5043..5e98e9edb7f171a0e0e7ff66181959e1296dbfea 100644 (file)
@@ -30,6 +30,8 @@
 #include <i2c.h>
 #include <asm/iopin_8260.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 /* imports from eeprom.c */
@@ -424,8 +426,6 @@ initdram (int board_type)
 int
 last_stage_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        hymod_conf_t *cp = &gd->bd->bi_hymod_conf;
        int rc;
 
index 081ef658e0d92322ec8d359e031b21cc1cba587e..7b9a83d0f954b195830391a02977ee2d3f78cecd 100644 (file)
@@ -25,6 +25,8 @@
 #include <ioports.h>
 #include <mpc8260.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * I/O Port configuration table
  *
@@ -295,8 +297,6 @@ long int initdram (int board_type)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_flashstart = 0xff800000;
 }
 
index e49692328246eb6050920b16d17325fa82e19dda..3230dd48f0767622b1d295cb5c42227befdbc303 100644 (file)
@@ -25,6 +25,8 @@
 #include <common.h>
 #include <clps7111.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 
@@ -34,8 +36,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Activate LED flasher */
        IO_LEDFLSH = 0x40;
 
@@ -50,8 +50,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index ae5402e8431c9698a0fad0d1250aa1b830ff459a..7f8f47c3a2ef7338acf9d60fc70a50d9bf61523a 100644 (file)
@@ -27,6 +27,8 @@
 #include <asm/arch/pxa-regs.h>
 #include <asm/mach-types.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
 # define SHOW_BOOT_PROGRESS(arg)        show_boot_progress(arg)
 #else
@@ -95,8 +97,6 @@ int misc_init_r(void)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -116,8 +116,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index d4f61d6403d530f7139196c6ee523d367f5cb79d..e659907567ba748bab17e0b18ccb601dd0e6e295 100644 (file)
@@ -39,6 +39,8 @@
 #include <pci.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void flash__init (void);
 void ether__init (void);
 void peripheral_power_enable (void);
@@ -65,8 +67,6 @@ static inline void delay (unsigned long loops)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number of Integrator Board */
        gd->bd->bi_arch_number = MACH_TYPE_INTEGRATOR;
 
@@ -480,8 +480,6 @@ void ether__init (void)
 ******************************/
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
 
index 216876b469db2bc18dad073f52dd0f160279b182..d6d6e13d5a475f20290bb86277affe17365522b8 100644 (file)
@@ -35,6 +35,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void flash__init (void);
 void ether__init (void);
 void peripheral_power_enable (void);
@@ -54,8 +56,6 @@ void show_boot_progress(int progress)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number of Integrator Board */
        gd->bd->bi_arch_number = MACH_TYPE_CINTEGRATOR;
 
@@ -105,8 +105,6 @@ void ether__init (void)
 ******************************/
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
 
index c04626a34650ac64ca91b9576a9d5881aede3e9d..aa965914507ae59e9c79eede6152089c02a710f7 100644 (file)
 #include <asm/arch/ixp425.h>
 #include <common.h>
 
-/* ------------------------------------------------------------------------- */
-
-
-/* local prototypes */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -49,8 +45,6 @@ int board_post_init (void)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number of IXDP */
        gd->bd->bi_arch_number = MACH_TYPE_IXDP425;
 
@@ -64,8 +58,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
 
index 4a7cf77ba5212389e340017ec4a8d21a20221edb..ec51dca914901c1a0bc8e2bde92f61be66d44a0a 100644 (file)
@@ -31,7 +31,8 @@
 #include <at91rm9200_net.h>
 #include <lxt971a.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Miscelaneous platform dependent initialisations
  */
@@ -42,8 +43,6 @@ void lowlevel_init(void) {
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Enable Ctrlc */
        console_init_f ();
 
@@ -60,8 +59,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
        return 0;
index e621c436ffd25837d4cd8332a7ea5c597cd13d22..4e377a142bb5dadb795f87a6db068ecee288499f 100644 (file)
@@ -29,6 +29,8 @@
    #include "s1d13706.h"
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef DEBUG
 #ifdef  DEBUG
 # define debugk(fmt,args...)    printf(fmt ,##args)
@@ -44,10 +46,6 @@ typedef struct {
 
 /* ------------------------------------------------------------------------- */
 
-#if 0
-static long int dram_size (long int, long int *, long int);
-#endif
-
 #ifdef CONFIG_KUP4K_LOGO
 void lcd_logo(bd_t *bd);
 #endif
@@ -235,62 +233,8 @@ long int initdram (int board_type)
 
 /* ------------------------------------------------------------------------- */
 
-/*
- * Check memory range for valid RAM. A simple memory test determines
- * the actually available RAM size between addresses `base' and
- * `base + maxsize'. Some (not all) hardware errors are detected:
- * - short between address lines
- * - short between data lines
- */
-#if 0
-static long int dram_size (long int mamr_value, long int *base,
-                                                  long int maxsize)
-{
-       volatile immap_t *immap = (immap_t *) CFG_IMMR;
-       volatile memctl8xx_t *memctl = &immap->im_memctl;
-       volatile long int *addr;
-       ulong cnt, val;
-       ulong save[32];                         /* to make test non-destructive */
-       unsigned char i = 0;
-
-       memctl->memc_mamr = mamr_value;
-
-       for (cnt = maxsize / sizeof (long); cnt > 0; cnt >>= 1) {
-               addr = base + cnt;              /* pointer arith! */
-
-               save[i++] = *addr;
-               *addr = ~cnt;
-       }
-
-       /* write 0 to base address */
-       addr = base;
-       save[i] = *addr;
-       *addr = 0;
-
-       /* check at base address */
-       if ((val = *addr) != 0) {
-               *addr = save[i];
-               return (0);
-       }
-
-       for (cnt = 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
-               addr = base + cnt;              /* pointer arith! */
-
-               val = *addr;
-               *addr = save[--i];
-
-               if (val != (~cnt)) {
-                       return (cnt * sizeof (long));
-               }
-       }
-       return (maxsize);
-}
-#endif
-
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_STATUS_LED
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
 #endif
index 66b730dba7fe68a46f136ed3d04899d5932da050..8d534c8e6738fd8af533c69b3522b9e42cd4049a 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 
@@ -33,8 +35,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -49,7 +49,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        bd_t *bd = gd->bd;
 
        bd->bi_dram[0].start = PHYS_SDRAM_1;
index 95634ac0044cd00434b10a90598cfb86589458d0..14fd28f56fc37ab4d4ad604f56fe7456c365d0ff 100644 (file)
@@ -25,6 +25,8 @@
 #include <common.h>
 #include <asm/arch/pxa-regs.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /**
  * board_init: - setup some data structures
  *
@@ -33,8 +35,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -57,8 +57,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 4c373eead51a987e40c81d7166d72b7f002bede9..e12bbf04fb2f508a86bd05e814652803aa60e176 100644 (file)
 
 #include <lpd7a400_cpld.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Miscellaneous platform dependent initialisations
  */
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* set up the I/O ports */
 
        /* enable flash programming */
@@ -74,8 +74,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index e618ab96a1d4cc24d244c803c586126060e909bc..58291706c0d91b044cdaaee362f92a7a206e035e 100644 (file)
@@ -27,8 +27,7 @@
 
 #include <common.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -36,8 +35,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -60,8 +57,6 @@ int board_late_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index a174b57b70edf09f81a1c3d710f6f3a607a8387d..9e8ea2db194b91260188638b825bd927e07a0e6e 100644 (file)
@@ -45,6 +45,8 @@ V* Verification:  dzu@denx.de
 #include <linux/types.h>
 #include <linux/string.h>      /* for strdup */
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*------------------------ Local prototypes ---------------------------*/
 static long int dram_size (long int, long int *, long int);
 static void kbd_init (void);
@@ -455,8 +457,6 @@ Z*               for the lwmon board.
  ***********************************************************************/
 int board_postclk_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        kbd_init();
 
 #ifdef CONFIG_MODEM_SUPPORT
@@ -471,15 +471,11 @@ int board_postclk_init (void)
 
 struct serial_device * default_serial_console (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return gd->do_mdm_init ? &serial_scc_device : &serial_smc_device;
 }
 
 static void kbd_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uchar kbd_data[KEYBD_DATALEN];
        uchar tmp_data[KEYBD_DATALEN];
        uchar val, errcd;
@@ -571,8 +567,6 @@ V* Verification: dzu@denx.de
  ***********************************************************************/
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uchar kbd_data[KEYBD_DATALEN];
        char keybd_env[2 * KEYBD_DATALEN + 1];
        uchar kbd_init_status = gd->kbd_status >> 8;
index d1c99fdd85f00f6776b7699894bd58166bc4e662..456411dd92d5e20392255ab9cd1cb63e2b596539 100644 (file)
@@ -30,6 +30,8 @@
 
 #include "mt48lc8m32b2-6-7.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern flash_info_t flash_info[];      /* FLASH chips info */
 
 ulong flash_get_size (ulong base, int banknum);
@@ -190,8 +192,6 @@ int checkboard (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*
         * Adjust flash start and offset to detected values
         */
index 92baba927598a914ba308d9e45eccab1979bd31e..74687f12c63ba69c20ebcf42d2384dc1aa2ac058 100644 (file)
 #include <ns16550.h>
 #endif
 
-#if 0
-#include "serial.h"
-#endif
+DECLARE_GLOBAL_DATA_PTR;
 
 #if (defined CFG_INIT_CHAN1) || (defined CFG_INIT_CHAN2)
 const NS16550_t COM_PORTS[] = { (NS16550_t) CFG_NS16550_COM1,
-                               (NS16550_t) CFG_NS16550_COM2 };
+       (NS16550_t) CFG_NS16550_COM2
+};
 #endif
 
-int
-serial_init (void)
+int serial_init (void)
 {
-               DECLARE_GLOBAL_DATA_PTR;
-
-           int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
+       int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
 
 #ifdef CFG_INIT_CHAN1
-           (void)NS16550_init(COM_PORTS[0], clock_divisor);
+       (void) NS16550_init (COM_PORTS[0], clock_divisor);
 #endif
 #ifdef CFG_INIT_CHAN2
-           (void)NS16550_init(COM_PORTS[1], clock_divisor);
+       (void) NS16550_init (COM_PORTS[1], clock_divisor);
 #endif
-               return 0;
+       return 0;
 
 }
 
-void
-serial_putc(const char c)
+void serial_putc (const char c)
 {
-    if (c == '\n')
-       NS16550_putc(COM_PORTS[CFG_DUART_CHAN], '\r');
+       if (c == '\n')
+               NS16550_putc (COM_PORTS[CFG_DUART_CHAN], '\r');
 
-    NS16550_putc(COM_PORTS[CFG_DUART_CHAN], c);
+       NS16550_putc (COM_PORTS[CFG_DUART_CHAN], c);
 }
 
-int
-serial_getc(void)
+int serial_getc (void)
 {
-    return NS16550_getc(COM_PORTS[CFG_DUART_CHAN]);
+       return NS16550_getc (COM_PORTS[CFG_DUART_CHAN]);
 }
 
-int
-serial_tstc(void)
+int serial_tstc (void)
 {
-    return NS16550_tstc(COM_PORTS[CFG_DUART_CHAN]);
+       return NS16550_tstc (COM_PORTS[CFG_DUART_CHAN]);
 }
 
-void
-serial_setbrg (void)
+void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
-    int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
+       int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate;
 
 #ifdef CFG_INIT_CHAN1
-    NS16550_reinit(COM_PORTS[0], clock_divisor);
+       NS16550_reinit (COM_PORTS[0], clock_divisor);
 #endif
 #ifdef CFG_INIT_CHAN2
-    NS16550_reinit(COM_PORTS[1], clock_divisor);
+       NS16550_reinit (COM_PORTS[1], clock_divisor);
 #endif
 }
 
-void
-serial_puts (const char *s)
+void serial_puts (const char *s)
 {
        while (*s) {
                serial_putc (*s++);
@@ -100,32 +89,27 @@ serial_puts (const char *s)
 }
 
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-void
-kgdb_serial_init(void)
+void kgdb_serial_init (void)
 {
 }
 
-void
-putDebugChar (int c)
+void putDebugChar (int c)
 {
        serial_putc (c);
 }
 
-void
-putDebugStr (const char *str)
+void putDebugStr (const char *str)
 {
        serial_puts (str);
 }
 
-int
-getDebugChar (void)
+int getDebugChar (void)
 {
-       return serial_getc();
+       return serial_getc ();
 }
 
-void
-kgdb_interruptible (int yes)
+void kgdb_interruptible (int yes)
 {
        return;
 }
-#endif /* CFG_CMD_KGDB */
+#endif /* CFG_CMD_KGDB */
index 448c6233e9cf9338e27fc915b3cae72d4ff899e4..4544069c2ff4030ed1c25bdd9672ee6333884103 100644 (file)
@@ -24,8 +24,7 @@
 
 #include <common.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -33,7 +32,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        /* address for the kernel command line */
        gd->bd->bi_boot_params = 0x800;
        return 0;
@@ -41,7 +39,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        if (CONFIG_NR_DRAM_BANKS == 2) {
index e75be1e3aa86fd3b9c80a9d3a8c097600d2df5e7..486d44c202f1523f97ac0ec88625ad4ef943a8ae 100644 (file)
 #include <dm9161.h>
 #include <asm/mach-types.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Miscelaneous platform dependent initialisations
  */
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Enable Ctrlc */
        console_init_f ();
 
@@ -56,8 +55,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
        return 0;
index 505acbc090911046cff9d3ae8221424a5850c4a2..9841298d6e6ebd6c48b3d1f7e870851854584d4b 100644 (file)
@@ -64,7 +64,7 @@ long int initdram (int board_type)
        /* DDR SDRAM - Main SODIMM */
        im->sysconf.ddrlaw[0].bar = CFG_DDR_BASE & LAWBAR_BAR;
 #if defined(CONFIG_SPD_EEPROM)
-       msize = spd_sdram(NULL);
+       msize = spd_sdram();
 #else
        msize = fixed_sdram();
 #endif
index c5594248d88fb48094b5fbf531b456869f44b4a7..319e35c9703c00b788f1b0989f2879bb42b938f1 100644 (file)
@@ -26,6 +26,8 @@
 #include <asm/mpc8349_pci.h>
 #include <i2c.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_PCI
 
 /* System RAM mapped to PCI space */
@@ -127,7 +129,6 @@ pib_init(void)
 void
 pci_init_board(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t *      immr;
        volatile clk8349_t *    clk;
        volatile law8349_t *    pci_law;
index b331d6ec474234b1cedf7674e5d43e4cfa429d17..06d021a026a04abc22dc225e75ebd704322454d8 100644 (file)
@@ -42,6 +42,9 @@
 #include "../mip405/mip405.h"
 #include <405gp_pci.h>
 #endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_PATI)
 #define FIRM_START 0xFFF00000
 #endif
@@ -584,7 +587,6 @@ extern int get_boot_mode(void);
 void video_get_info_str (int line_number, char *info)
 {
        /* init video info strings for graphic console */
-       DECLARE_GLOBAL_DATA_PTR;
        PPC405_SYS_INFO sys_info;
        char rev;
        int i,boot;
index 2c77d375ea00a5a2d2420fa2af69ed788ec48c5b..ff1190ab21294cc24533d8a30693f26c72f933aa 100644 (file)
@@ -50,13 +50,15 @@ int testdram (void)
 #include <asm/processor.h>
 #include <405gp_i2c.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define FALSE           0
 #define TRUE            1
 
-#define TEST_QUIET                     8
+#define TEST_QUIET     8
 #define TEST_SHOW_PROG         4
 #define TEST_SHOW_ERR  2
-#define TEST_SHOW_ALL          1
+#define TEST_SHOW_ALL  1
 
 #define TESTPAT1 0xAA55AA55
 #define TESTPAT2 0x55AA55AA
@@ -468,7 +470,6 @@ static RAM_MEMTEST_FUNC test_stage[TEST_STAGES] = {
 
 void mem_test_reloc(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned long addr;
        int i;
        for (i=0; i< TEST_STAGES; i++) {
index 692930b41639d5e55f800cf0d8199fd8c39112f2..bde14beeb168f3d9f33ec7c8dda4e7007c5f48d1 100644 (file)
@@ -32,7 +32,7 @@
 #ifdef CONFIG_405GP
 #ifdef CONFIG_PCI
 
-#undef DEBUG
+DECLARE_GLOBAL_DATA_PTR;
 
 #include "piix4_pci.h"
 #include "pci_parts.h"
@@ -94,7 +94,6 @@ static struct pci_controller hose = {
 
 static void reloc_pci_cfg_table(struct pci_config_table *table)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned long addr;
 
        for (; table && table->vendor; table++) {
index 9c469b09ac964d2a652c257d0529b9a02ada4ba2..34f328999d1d27b7ac8df257a791e3cd3be20964 100644 (file)
@@ -70,6 +70,9 @@
 #include "../common/common_util.h"
 #include <i2c.h>
 #include <rtc.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
 extern block_dev_desc_t * scsi_get_dev(int dev);
 extern block_dev_desc_t * ide_get_dev(int dev);
 
@@ -189,8 +192,6 @@ const sdram_t sdram_table[] = {
 void SDRAM_err (const char *s)
 {
 #ifndef SDRAM_DEBUG
-       DECLARE_GLOBAL_DATA_PTR;
-
        (void) get_clocks ();
        gd->baudrate = 9600;
        serial_init ();
@@ -241,8 +242,6 @@ void write_4hex (unsigned long val)
 
 int init_sdram (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long   tmp, baseaddr;
        unsigned short  i;
        unsigned char   trp_clocks,
@@ -681,7 +680,6 @@ extern flash_info_t flash_info[];   /* info for FLASH chips */
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        /* adjust flash start and size as well as the offset */
        gd->bd->bi_flashstart=0-flash_info[0].size;
        gd->bd->bi_flashsize=flash_info[0].size-CFG_MONITOR_LEN;
index a398362f96aef4fad6eab5f3f77e22681ba831f0..38286081ae79bb62af6fd1a37295d0de39f94fbd 100644 (file)
@@ -31,6 +31,8 @@
 #include "../common/isa.h"
 #include "../common/common_util.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef SDRAM_DEBUG
 
 #define FALSE           0
@@ -134,8 +136,6 @@ unsigned short NSto10PS (unsigned char spd_byte)
 void SDRAM_err (const char *s)
 {
 #ifndef SDRAM_DEBUG
-       DECLARE_GLOBAL_DATA_PTR;
-
        (void) get_clocks ();
        gd->baudrate = 9600;
        serial_init ();
@@ -191,9 +191,6 @@ int board_early_init_f (void)
                        trc_clocks, tctp_clocks;
        unsigned char cal_index, cal_val, spd_version, spd_chksum;
        unsigned char buf[8];
-#ifdef SDRAM_DEBUG
-       DECLARE_GLOBAL_DATA_PTR;
-#endif
        /* set up the config port */
        mtdcr (ebccfga, pb7ap);
        mtdcr (ebccfgd, CONFIG_PORT_AP);
@@ -613,8 +610,6 @@ static int test_dram (unsigned long ramsize);
 
 long int initdram (int board_type)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long bank_reg[4], tmp, bank_size;
        int i, ds;
        unsigned long TotalSize;
@@ -666,7 +661,6 @@ extern flash_info_t flash_info[];   /* info for FLASH chips */
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        /* adjust flash start and size as well as the offset */
        gd->bd->bi_flashstart=0-flash_info[0].size;
        gd->bd->bi_flashsize=flash_info[0].size-CFG_MONITOR_LEN;
index ffdba5d990da9dee8f671b334d15a2f59819c614..0d2003d2fc3ae89822d6b1915df9ef6223310ebc 100644 (file)
@@ -32,7 +32,7 @@
 #include "vcma9.h"
 #include "../common/common_util.h"
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 #define FCLK_SPEED 1
 
@@ -71,7 +71,6 @@ static inline void delay(unsigned long loops)
 
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
        S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
 
@@ -275,8 +274,6 @@ static void Show_VCMA9_Info(char *board_name, char *serial)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = Get_SDRAM_ChipSize() * Get_SDRAM_ChipNr();
 
index 20a551dfa5a3e8d64dc30eca40fa97183415330b..ee8f3e3015f865e1d0484e1997f80eeaaafae990 100644 (file)
@@ -14,6 +14,8 @@
 #include <pci.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 u32 get_BoardType (void);
 
 #define PCI_CONFIG(b,d,f,r)    cpu_to_le32(0x80000000 | ((b&0xff)<<16) \
@@ -50,7 +52,6 @@ void hw_watchdog_reset (void)
 }
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong busfreq = get_bus_freq (0);
        char buf[32];
        u32 BoardType = get_BoardType ();
index 5c33ba3c0ea8354122425cc4c54bde63dbd3cbe6..913f95c5e89180e97f4c2f23512335a200aa4a6c 100644 (file)
@@ -27,7 +27,7 @@
 /*#include <mc9328.h>*/
 #include <asm/arch/imx-regs.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 #define FCLK_SPEED 1
 
 
 #if 0
 
-static inline void delay (unsigned long loops) {
+static inline void delay (unsigned long loops)
+{
        __asm__ volatile ("1:\n"
-         "subs %0, %1, #1\n"
-         "bne 1b":"=r" (loops):"0" (loops));
+                         "subs %0, %1, #1\n"
+                         "bne 1b":"=r" (loops):"0" (loops));
 }
 
 #endif
@@ -67,62 +68,58 @@ static inline void delay (unsigned long loops) {
  * Miscellaneous platform dependent initialisations
  */
 
-void SetAsynchMode(void) {
-       __asm__ (
-               "mrc p15,0,r0,c1,c0,0 \n"
-               "mov r2, #0xC0000000 \n"
-               "orr r0,r2,r0 \n"
-               "mcr p15,0,r0,c1,c0,0 \n"
-       );
+void SetAsynchMode (void)
+{
+       __asm__ ("mrc p15,0,r0,c1,c0,0 \n"
+                "mov r2, #0xC0000000 \n"
+                "orr r0,r2,r0 \n" "mcr p15,0,r0,c1,c0,0 \n");
 }
 
 static u32 mc9328sid;
 
-int board_init (void) {
+int board_init (void)
+{
+       volatile unsigned int tmp;
 
-       DECLARE_GLOBAL_DATA_PTR;
+       mc9328sid = SIDR;
 
-       volatile unsigned int  tmp;
+       GPCR = 0x000003AB;      /* I/O pad driving strength     */
 
-       mc9328sid       = SIDR;
-
-       GPCR            = 0x000003AB;           /* I/O pad driving strength     */
-
-/*     MX1_CS1U        = 0x00000A00;   */      /* SRAM initialization          */
+       /*      MX1_CS1U        = 0x00000A00;   *//* SRAM initialization          */
 /*     MX1_CS1L        = 0x11110601;   */
 
-       MPCTL0          = 0x04632410;   /* setting for 150 MHz MCU PLL CLK      */
+       MPCTL0 = 0x04632410;    /* setting for 150 MHz MCU PLL CLK      */
 
 /* set FCLK divider 1 (i.e. FCLK to MCU PLL CLK) and
  * BCLK divider to 2 (i.e. BCLK to 48 MHz)
  */
-       CSCR    = 0xAF000403;
+       CSCR = 0xAF000403;
 
-       CSCR    |= 0x00200000;          /* Trigger the restart bit(bit 21)      */
-       CSCR    &= 0xFFFF7FFF;          /* Program PRESC bit(bit 15) to 0 to divide-by-1 */
+       CSCR |= 0x00200000;     /* Trigger the restart bit(bit 21)      */
+       CSCR &= 0xFFFF7FFF;     /* Program PRESC bit(bit 15) to 0 to divide-by-1 */
 
 /* setup cs4 for cs8900 ethernet */
 
-       CS4U    = 0x00000F00;   /* Initialize CS4 for CS8900 ethernet   */
-       CS4L    = 0x00001501;
+       CS4U = 0x00000F00;      /* Initialize CS4 for CS8900 ethernet   */
+       CS4L = 0x00001501;
 
-       GIUS(0) &= 0xFF3FFFFF;
-       GPR(0)  &= 0xFF3FFFFF;
+       GIUS (0) &= 0xFF3FFFFF;
+       GPR (0) &= 0xFF3FFFFF;
 
-       tmp = *(unsigned int *)(0x1500000C);
-       tmp = *(unsigned int *)(0x1500000C);
+       tmp = *(unsigned int *) (0x1500000C);
+       tmp = *(unsigned int *) (0x1500000C);
 
-       SetAsynchMode();
+       SetAsynchMode ();
 
        gd->bd->bi_arch_number = MACH_TYPE_MX1ADS;
 
-       gd->bd->bi_boot_params = 0x08000100;    /* adress of boot parameters    */
+       gd->bd->bi_boot_params = 0x08000100;    /* adress of boot parameters    */
 
-       icache_enable();
-       dcache_enable();
+       icache_enable ();
+       dcache_enable ();
 
 /* set PERCLKs                         */
-       PCDR = 0x00000055;      /* set PERCLKS                          */
+       PCDR = 0x00000055;      /* set PERCLKS                          */
 
 /* PERCLK3 is only used by SSI so the SSI driver can set it any value it likes
  * PERCLK1 and PERCLK2 are shared so DO NOT change it in any other place
@@ -135,34 +132,38 @@ int board_init (void) {
        return 0;
 }
 
-int board_late_init(void) {
-
-       setenv("stdout", "serial");
-       setenv("stderr", "serial");
-
-       switch  (mc9328sid) {
-               case 0x0005901d :
-                       printf ("MX1ADS board with MC9328 MX1 (0L44N), Silicon ID 0x%08x \n\n",mc9328sid);
-                       break;
-               case 0x04d4c01d :
-                       printf ("MX1ADS board with MC9328 MXL (1L45N), Silicon ID 0x%08x \n\n",mc9328sid);
-                       break;
-               case 0x00d4c01d :
-                       printf ("MX1ADS board with MC9328 MXL (2L45N), Silicon ID 0x%08x \n\n",mc9328sid);
-                       break;
-
-               default :
-                       printf ("MX1ADS board with UNKNOWN MC9328 cpu, Silicon ID 0x%08x \n",mc9328sid);
-                       break;
+int board_late_init (void)
+{
+
+       setenv ("stdout", "serial");
+       setenv ("stderr", "serial");
+
+       switch (mc9328sid) {
+       case 0x0005901d:
+               printf ("MX1ADS board with MC9328 MX1 (0L44N), Silicon ID 0x%08x \n\n",
+                       mc9328sid);
+               break;
+       case 0x04d4c01d:
+               printf ("MX1ADS board with MC9328 MXL (1L45N), Silicon ID 0x%08x \n\n",
+                       mc9328sid);
+               break;
+       case 0x00d4c01d:
+               printf ("MX1ADS board with MC9328 MXL (2L45N), Silicon ID 0x%08x \n\n",
+                       mc9328sid);
+               break;
+
+       default:
+               printf ("MX1ADS board with UNKNOWN MC9328 cpu, Silicon ID 0x%08x \n",
+                       mc9328sid);
+               break;
        }
        return 0;
 }
 
-int dram_init (void) {
-       DECLARE_GLOBAL_DATA_PTR;
-
+int dram_init (void)
+{
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-       gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
+       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
        return 0;
 }
index 9e7a06c0df7c41fc46d802c678188ae20e41699a..1c026f0f7ace635f1d81008f7ce6c7d4baa1a2fd 100644 (file)
  */
 
 #include <common.h>
-
 #include <asm/arch/imx-regs.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define SHOW_BOOT_PROGRESS(arg)        show_boot_progress(arg)
 
 extern void imx_gpio_mode(int gpio_mode);
@@ -79,8 +80,6 @@ static void logo_init(void)
 int
 board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_arch_number = MACH_TYPE_MX1FS2;
        gd->bd->bi_boot_params = 0x08000100;
 serial_init();
@@ -91,8 +90,6 @@ serial_init();
 int
 dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #if ( CONFIG_NR_DRAM_BANKS > 0 )
        gd->bd->bi_dram[0].start = MX1FS2_SDRAM_1;
        gd->bd->bi_dram[0].size = MX1FS2_SDRAM_1_SIZE;
index ce2f83bc794527cdc5d8f026baf8cd00320a3ec2..8d7c1726577b85dc6220ae1558c074f1321499b8 100644 (file)
@@ -32,6 +32,8 @@
 #include <common.h>
 #include <mpc8xx.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifndef CFG_OR_TIMING_FLASH_AT_50MHZ
 #define CFG_OR_TIMING_FLASH_AT_50MHZ (OR_ACS_DIV1  | OR_TRLX | OR_CSNT_SAM | \
                                      OR_SCY_2_CLK | OR_EHTR | OR_BI)
@@ -95,8 +97,6 @@ unsigned long flash_init (void)
 #ifdef CFG_OR_TIMING_FLASH_AT_50MHZ
        int scy, trlx, flash_or_timing, clk_diff;
 
-       DECLARE_GLOBAL_DATA_PTR;
-
        scy = (CFG_OR_TIMING_FLASH_AT_50MHZ & OR_SCY_MSK) >> 4;
        if (CFG_OR_TIMING_FLASH_AT_50MHZ & OR_TRLX) {
                trlx = OR_TRLX;
index 62615e5c56e79909d5f5d0ac81f0a2d60b9593b4..4b7eba125e7e0afcc9e09f1db8aa5d9e2baa8aaa 100644 (file)
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number of NetStar board */
        /* TODO: use define from asm/mach-types.h */
        gd->bd->bi_arch_number = 692;
@@ -38,8 +38,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index ea00d5af2593683d0c8174504cd2092a4d295e09..1dd348a0c3045eb89fefeb5f53757f46138f2e26 100644 (file)
@@ -41,6 +41,8 @@
 # include <./ns9750_bbus.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void flash__init( void );
 void ether__init( void );
 
@@ -60,8 +62,6 @@ static inline void delay( unsigned long loops )
 
 int board_init( void )
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Active BBUS modules */
        *get_bbus_reg_addr( NS9750_BBUS_MASTER_RESET ) = 0;
 
@@ -114,8 +114,6 @@ void ether__init (void)
 ******************************/
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 65d45c197f0053cc6ad9c4c1d4ca036a818f9167..4a426ec4980326ed96df67b9811df5963fb9a91d 100644 (file)
 #include <malloc.h>
 #include <mpc8xx.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 static long int dram_size (long int, long int *, long int);
 
-/* ------------------------------------------------------------------------- */
-
 #define        _NOT_USED_      0xFFFFFFFF
 
 const uint sdram_table[] = {
@@ -366,8 +364,6 @@ u_long *my_sernum;
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char tmp[50];
        u_char *e = gd->bd->bi_enetaddr;
 
@@ -387,8 +383,6 @@ int misc_init_r (void)
 
 void load_sernum_ethaddr (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i;
        bd_t *bd = gd->bd;
 
index f037f42d4198a1bc7549d80b5941f8351feb5c05..894120951021397f61f8813d5d0f6698b1f0eb13 100644 (file)
@@ -31,6 +31,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static void flash__init (void);
 static void ether__init (void);
 
@@ -47,8 +49,6 @@ static inline void delay (unsigned long loops)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number of OMAP 1510-Board */
        gd->bd->bi_arch_number = MACH_TYPE_OMAP_INNOVATOR;
 
@@ -122,8 +122,6 @@ static void ether__init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 78425181e894f7d0c21d1492f5bf21068bb70f03..8dbe686a8913214bfc0d7b9fa8602d0f51b72b6e 100644 (file)
@@ -36,6 +36,8 @@
 #include <./configs/omap1510.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_CS_AUTOBOOT
 unsigned long omap_flash_base;
 #endif
@@ -60,8 +62,6 @@ static inline void delay (unsigned long loops)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (machine_is_omap_h2())
                gd->bd->bi_arch_number = MACH_TYPE_OMAP_H2;
        else if (machine_is_omap_innovator())
@@ -153,8 +153,6 @@ void ether__init (void)
 ******************************/
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 2387176ebce54b1edbf38f44d81bfa49976ed192..f7f75e0fe1a2a3162f1a98ff4d8274572553efbb 100644 (file)
@@ -36,7 +36,9 @@
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 #endif
 
- void wait_for_command_complete(unsigned int wd_base);
+DECLARE_GLOBAL_DATA_PTR;
+
+void wait_for_command_complete(unsigned int wd_base);
 
 /*******************************************************
  * Routine: delay
@@ -54,8 +56,6 @@ static inline void delay (unsigned long loops)
  *****************************************/
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRM, finish GPMC */
 
        gd->bd->bi_arch_number = MACH_TYPE_OMAP_H4;             /* board id for linux */
@@ -195,7 +195,6 @@ void ether_init (void)
  **********************************************/
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned int size0=0,size1=0;
        u32 mtype, btype, rev, cpu;
        u8 chg_on = 0x5; /* enable charge of back up battery */
index 1faa084f94ef84bb50b7f73231cbfcab434f7842..e9e6b0e794dc54c8f5b924677f3982782c1334ce 100644 (file)
@@ -38,6 +38,8 @@
 #include <./configs/omap1510.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void flash__init (void);
 void ether__init (void);
 void set_muxconf_regs (void);
@@ -58,8 +60,6 @@ static inline void delay (unsigned long loops)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_arch_number = MACH_TYPE_OMAP_OSK;
 
        /* adress of boot parameters */
@@ -136,8 +136,6 @@ void ether__init (void)
 ******************************/
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 256c6a665d8eb41a2c36b9c16f9b21f75696778d..309d667585abfd3cadc0559b6d0d0ca8a79f9aa1 100644 (file)
@@ -34,6 +34,8 @@
 #include <./configs/omap730.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int test_boot_mode(void);
 void spin_up_leds(void);
 void flash__init (void);
@@ -84,8 +86,6 @@ void toggle_backup_led(void)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number of OMAP 730 P2 Board - Same as the Innovator! */
        gd->bd->bi_arch_number = MACH_TYPE_OMAP_PERSEUS2;
 
@@ -180,8 +180,6 @@ void ether__init (void)
 ******************************/
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index fa7ff0215c01bb7a2fdaa14ecb8a6e8e019cb3ce..6cc3cc5a3e48e7e45da7404541a150b82d1598db 100644 (file)
@@ -26,6 +26,8 @@
 #include <pci.h>
 #include <i2c.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard (void)
 {
        puts (  "Board: OXC8240\n" );
@@ -184,8 +186,6 @@ int misc_init_r (void)
 
 #ifdef CFG_OXC_GENERATE_IP
        {
-               DECLARE_GLOBAL_DATA_PTR;
-
                char str[32];
                unsigned long ip = CFG_OXC_IPMASK;
                bd_t *bd = gd->bd;
index 579bfc702744978cf5af2b80772bcbe741c2d1d9..5f89d9b125e105d71aa2e968cba8459cc28f2983 100644 (file)
@@ -29,6 +29,8 @@
 #include "hardware.h"
 #include "pcippc2.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
   /* 8 data, 1 stop, no parity
    */
 #define LCRVAL         0x03
@@ -92,8 +94,6 @@ int fpga_serial_tstc (void)
 
 void fpga_serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int clock_divisor = 115200 / gd->baudrate;
 
        fpga_serial_wait ();
index 231b50576b38c9e7d6888e9528028d65d7339357..a216c55bc6ad149be937e92d0fb4a9a92b0933e3 100644 (file)
@@ -34,6 +34,8 @@
 #include "sconsole.h"
 #include "fpga_serial.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_WATCHDOG)
 
 static int pcippc2_wdt_init_done = 0;
@@ -108,8 +110,6 @@ int board_early_init_f (void)
 
 void after_reloc (ulong dest_addr)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Jump to the main U-Boot board init code
         */
        board_init_r ((gd_t *)gd, dest_addr);
index a9f2b298116a8d68f9fbda2ac6f85e0c427d10de..3b190699f08557a9f79c40a658fb7969ec1b7a92 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "sconsole.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void   (*sconsole_putc) (char) = 0;
 void   (*sconsole_puts) (const char *) = 0;
 int    (*sconsole_getc) (void) = 0;
@@ -34,8 +36,6 @@ void  (*sconsole_setbrg) (void) = 0;
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        sconsole_buffer_t *sb = SCONSOLE_BUFFER;
 
        sb->pos  = 0;
@@ -104,8 +104,6 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (sconsole_setbrg) {
                (*sconsole_setbrg) ();
        } else {
index ce9245cd4e31744459a28b4b660ea9887f507a57..dc6fac46d344defa18eaaecef29fd7c7c297bc1b 100644 (file)
@@ -28,8 +28,7 @@
 #include <common.h>
 #include <asm-arm/mach-types.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -37,8 +36,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -61,8 +58,6 @@ int board_late_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index d4cc5cb56170131aa137a8b300c6bda3b71d597d..65c529192a649782bd9f3715476a9ba1ec670b1c 100644 (file)
@@ -34,6 +34,8 @@
 #include "mt48lc16m16a2-75.h"
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifndef CFG_RAMBOOT
 static void sdram_start (int hi_addr)
 {
@@ -281,7 +283,6 @@ extern flash_info_t flash_info[];   /* info for FLASH chips */
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        /* adjust flash start */
        gd->bd->bi_flashstart = flash_info[0].start[0];
        return (0);
index 377aaa8bca3a48dda99a4a98413ba35931e1df66..b2f348d4d6d5b24d101d831a1f279c0a34bb5c22 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "pn62.h"
 
+DECLARE_GLOBAL_DATA_PTR;
 
 static int get_serial_number (char *string, int size);
 static int get_mac_address (int id, u8 * mac, char *string, int size);
@@ -122,8 +123,6 @@ void pci_init_board (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char str[20];
        u8 mac[6];
 
index d42a643c2f0d2de21a0a9123c88a40b9bdde8b19..2f28e9d87a3477f3f8b9b2d716b4a575dff8da42 100644 (file)
@@ -29,6 +29,8 @@
 
 #include "p3p440.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void set_led(int color)
 {
        switch (color) {
@@ -141,8 +143,6 @@ int checkboard(void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*
         * Adjust flash start and offset to detected values
         */
@@ -206,8 +206,6 @@ int pci_pre_init(struct pci_controller *hose)
 #if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
 void pci_target_init(struct pci_controller *hose)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*--------------------------------------------------------------------------+
         * Disable everything
         *--------------------------------------------------------------------------*/
index d5b993ae5518341bad1a1e8f2ba6e0eba3853cc0..5765c5532a4d59cb2958bce95ecc888efdae3b0a 100644 (file)
@@ -33,8 +33,7 @@
 #include <common.h>
 #include <command.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -42,8 +41,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -86,8 +83,6 @@ int board_late_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index 2861bc3b166325274d121054e561e6e78ac28d11..afa6e113d828f771780159949b3f78ed623f145c 100644 (file)
@@ -170,14 +170,14 @@ static long int dram_size (long int mamr_value, long int *base,
        memctl->memc_mamr = mamr_value;
 
        for (cnt = maxsize / sizeof (long); cnt > 0; cnt >>= 1) {
-               addr = base + cnt;      /* pointer arith! */
+               addr = (volatile ulong *)(base + cnt);  /* pointer arith! */
 
                save[i++] = *addr;
                *addr = ~cnt;
        }
 
        /* write 0 to base address */
-       addr = base;
+       addr = (volatile ulong *)base;
        save[i] = *addr;
        *addr = 0;
 
@@ -194,7 +194,7 @@ static long int dram_size (long int mamr_value, long int *base,
        }
 
        for (cnt = 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
-               addr = base + cnt;      /* pointer arith! */
+               addr = (volatile ulong *)(base + cnt);  /* pointer arith! */
 
                val = *addr;
                *addr = save[--i];
index c27929dcd3c93f59aef9299f890b5339b1af44f5..6d530f6b431cf9d16fc023e2365ba23a74244e06 100644 (file)
@@ -33,6 +33,8 @@
 #include <devices.h>
 #include <lcd.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define        SMC_INDEX       0
 #define PROFF_SMC      PROFF_SMC1
 #define CPM_CR_CH_SMC  CPM_CR_CH_SMC1
@@ -46,8 +48,6 @@
 
 void smc1_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *im = (immap_t *)CFG_IMMR;
        volatile cpm8xx_t *cp = &(im->im_cpm);
 
index ea4c65d6b34fb007b7a6a42c7611b4cea0f95eea..edb775df2ea057ea30a4726bfd396b66d80ea778 100644 (file)
@@ -30,6 +30,8 @@
 
 #include "clkinit.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int Daq64xSampling = 0;
 
 
@@ -257,7 +259,6 @@ void Daq_BRG_Set_ExtClk(uint brg, uint extc)
 
 uint Daq_BRG_Rate(uint brg)
 {
-     DECLARE_GLOBAL_DATA_PTR;
      volatile immap_t *immr = (immap_t *)CFG_IMMR;
      uint *brg_ptr;
      uint brg_cnt;
@@ -295,7 +296,6 @@ uint Daq_Get_SampleRate(void)
 
 void Daq_Init_Clocks(int sample_rate, int sample_64x)
 {
-    DECLARE_GLOBAL_DATA_PTR;
     volatile ioport_t *iopa = ioport_addr((immap_t *)CFG_IMMR, 0 /* port A */);
     uint mclk_divisor; /* MCLK divisor */
     int  flag;         /* Interrupt state */
index 353041667f2333be6eaaedc2a535077247b9fa12..781647251683d574e6f4b17c1692c76e03eacea1 100644 (file)
@@ -29,6 +29,8 @@
 #include "ppc440gx_i2c.h"
 #include "sb_common.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 long int fixed_sdram (void);
 
 /*************************************************************************
@@ -203,7 +205,7 @@ long int initdram (int board_type)
        long dram_size = 0;
 
 #if defined(CONFIG_SPD_EEPROM)
-       dram_size = spd_sdram (0);
+       dram_size = spd_sdram ();
 #else
        dram_size = fixed_sdram ();
 #endif
@@ -341,8 +343,6 @@ int pci_pre_init(struct pci_controller * hose )
 #if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
 void pci_target_init(struct pci_controller * hose )
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*--------------------------------------------------------------------------+
         * Disable everything
         *--------------------------------------------------------------------------*/
index cad58731d3e812ee02495c1a767c7b9fedfb049c..0ae6d0ba4558a175379887d2165d821e065d6d57 100644 (file)
@@ -98,7 +98,7 @@ int checkboard (void)
 
 long int initdram (int board_type)
 {
-       return  spd_sdram (0);
+       return  spd_sdram ();
 }
 
 /* ------------------------------------------------------------------------- */
index a6d3babe92942ec87dfaf625c80327c15d75726d..8a52f67418090a4899f53de22ede19966386cb41 100644 (file)
 #include <asm/processor.h>
 #include <pci.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define BOARD_REV_REG 0xFE80002B
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char  revision = *(volatile char *)(BOARD_REV_REG);
        char  buf[32];
 
index cd523248268556ef0f7bbbea46cac1d91a89c846..b6add59bb482dd14363eea6f3030c325854bdb1b 100644 (file)
@@ -30,6 +30,8 @@
 #include <asm/ic/ali512x.h>
 #include <spi.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef SC520_CDP_DEBUG
 
 #ifdef SC520_CDP_DEBUG
@@ -481,8 +483,6 @@ int pci_enable_legacy_video_ports(struct pci_controller *hose)
 
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        init_sc520();
        bus_init();
        irq_init();
index e7a7d5188cfdc7fb079de7ce06906a49ce5effaa..ed226fd6423ee68d7deb1a14ef844cd2f7a948bb 100644 (file)
@@ -29,9 +29,7 @@
 #include <asm/pci.h>
 #include <asm/ic/sc520.h>
 
-
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Theory:
@@ -483,8 +481,6 @@ int pci_enable_legacy_video_ports(struct pci_controller *hose)
 
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        init_sc520();
        bus_init();
        irq_init();
index 3ed8753e210e8851dab89af06aad92a57ee30cb7..3f6831be5e50ab8b4062150c791b59e075dd6dc2 100644 (file)
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
 # define SHOW_BOOT_PROGRESS(arg)        show_boot_progress(arg)
 #else
 # define SHOW_BOOT_PROGRESS(arg)
 #endif
 
-int board_init( void ){
-  DECLARE_GLOBAL_DATA_PTR;
-
-  gd->bd->bi_arch_number = MACH_TYPE_SCB9328;
-  gd->bd->bi_boot_params = 0x08000100;
+int board_init (void)
+{
+       gd->bd->bi_arch_number = MACH_TYPE_SCB9328;
+       gd->bd->bi_boot_params = 0x08000100;
 
-  return 0;
+       return 0;
 }
 
-int dram_init( void ){
-  DECLARE_GLOBAL_DATA_PTR;
-
+int dram_init (void)
+{
 #if ( CONFIG_NR_DRAM_BANKS > 0 )
-  gd->bd->bi_dram[0].start = SCB9328_SDRAM_1;
-  gd->bd->bi_dram[0].size  = SCB9328_SDRAM_1_SIZE;
+       gd->bd->bi_dram[0].start = SCB9328_SDRAM_1;
+       gd->bd->bi_dram[0].size = SCB9328_SDRAM_1_SIZE;
 #endif
 #if ( CONFIG_NR_DRAM_BANKS > 1 )
-  gd->bd->bi_dram[1].start = SCB9328_SDRAM_2;
-  gd->bd->bi_dram[1].size  = SCB9328_SDRAM_2_SIZE;
+       gd->bd->bi_dram[1].start = SCB9328_SDRAM_2;
+       gd->bd->bi_dram[1].size = SCB9328_SDRAM_2_SIZE;
 #endif
 #if ( CONFIG_NR_DRAM_BANKS > 2 )
-  gd->bd->bi_dram[2].start = SCB9328_SDRAM_3;
-  gd->bd->bi_dram[2].size  = SCB9328_SDRAM_3_SIZE;
+       gd->bd->bi_dram[2].start = SCB9328_SDRAM_3;
+       gd->bd->bi_dram[2].size = SCB9328_SDRAM_3_SIZE;
 #endif
 #if ( CONFIG_NR_DRAM_BANKS > 3 )
-  gd->bd->bi_dram[3].start = SCB9328_SDRAM_4;
-  gd->bd->bi_dram[3].size  = SCB9328_SDRAM_4_SIZE;
+       gd->bd->bi_dram[3].start = SCB9328_SDRAM_4;
+       gd->bd->bi_dram[3].size = SCB9328_SDRAM_4_SIZE;
 #endif
-
-  return 0;
+       return 0;
 }
 
 /**
index 0d9f146d5224ffe59a080d6a585266bb5a03ea79..8cd1fc34c63b5f235ed34cfc25948aa039ee38ae 100644 (file)
@@ -24,8 +24,7 @@
 
 #include <common.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -33,8 +32,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* but if we use InfernoLoader, we must do some inits here */
 
@@ -75,7 +72,6 @@ int dram_init (void)
 {
 #if defined(PHYS_SDRAM_1) || defined(PHYS_SDRAM_2) || \
     defined(PHYS_SDRAM_3) || defined(PHYS_SDRAM_4)
-       DECLARE_GLOBAL_DATA_PTR;
        bd_t *bd = gd->bd;
 #endif
 
index d20688d5687133d8677c784f0e95070eebb96a92..8783aafe9a124a16797f4275747572409f97f974 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "scm.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static void config_scoh_cs(void);
 extern int  fpga_init(void);
 
@@ -300,8 +302,6 @@ static long int try_init (volatile memctl8260_t * memctl, ulong sdmr,
  */
 int power_on_reset (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Test Reset Status Register */
        return gd->reset_status & RSR_CSRS ? 0 : 1;
 }
index a25dffdad527d7dc13950513bd035be012464767..a4cb4dcf09772230823daa27fa798362f5db3a5a 100644 (file)
@@ -38,6 +38,8 @@
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define ORMASK(size) ((-size) & OR_AM_MSK)
 
 static long ram_size(ulong *, long);
@@ -256,8 +258,6 @@ int board_postclk_init (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t     *immap = (immap_t *)CFG_IMMR;
        volatile memctl8xx_t *memctl = &immap->im_memctl;
        char* s;
index cb70218434be15a05a4340a31660d5ef10516d6a..4d1f1a63cd3a711833bc79d9e795ca4095260ea2 100644 (file)
@@ -28,7 +28,7 @@
 #include <common.h>
 #include <s3c2400.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_MODEM_SUPPORT
 static int key_pressed(void);
@@ -45,7 +45,6 @@ extern int do_mdm_init; /* defined in common/main.c */
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
        S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
 
@@ -94,8 +93,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 9623aeff32b8881929f3ceee7c98bad103a71bd1..802348d23693f8ef25a4fe1299f3908848eb2df3 100644 (file)
@@ -28,7 +28,7 @@
 #include <common.h>
 #include <s3c2410.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 #define FCLK_SPEED 1
 
@@ -67,7 +67,6 @@ static inline void delay (unsigned long loops)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
        S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
 
@@ -117,8 +116,6 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index 3fe0134d6816842d28eb93516d7efbff14888116..7e3af20eab2a554d87e8f79070039ff076d2ffe1 100644 (file)
@@ -29,6 +29,8 @@
 #include <asm/mem_init.h>
 #include "stamp.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define STATUS_LED_OFF 0
 #define STATUS_LED_ON  1
 
@@ -49,7 +51,6 @@ int checkboard (void)
 
 long int initdram (int board_type)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef DEBUG
        printf ("SDRAM attributes:\n");
        printf ("  tRCD:%d Cycles; tRP:%d Cycles; tRAS:%d Cycles; tWR:%d Cycles; "
index e45f6ae4f3466eb7e273fa65b83efa8c0dc04874..aaef76e713decc903155aa4c558f256fe111b9a1 100644 (file)
@@ -27,6 +27,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static void flash__init (void);
 static void ether__init (void);
 
@@ -43,8 +45,6 @@ static inline void delay (unsigned long loops)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number of SX1 Board */
        gd->bd->bi_arch_number = MACH_TYPE_SX1;
 
@@ -116,8 +116,6 @@ static void ether__init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index dada6739b6ca7e433eee80f866b9c4fdc9a2b397..b5c12e3e240edbcc20b628fdf3ca77202e65e896 100644 (file)
@@ -32,6 +32,8 @@
 #include <asm-ppc/mmu.h>
 #include <pci.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define IOSYNC                 asm("eieio")
 #define ISYNC                  asm("isync")
 #define SYNC                   asm("sync")
@@ -142,7 +144,6 @@ int checkboard (void)
        puts("Board: TQM834x\n");
 
 #ifdef CONFIG_PCI
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t * immr;
        u32 w, f;
 
index c03b60d11a7ab01652413dcdfe4c81407c307052..69b91017fee339f14497bc37a7a84dfa2847a735 100644 (file)
@@ -36,6 +36,8 @@
 #include <spd.h>
 #include <flash.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern flash_info_t flash_info[];      /* FLASH chips info */
 
 void local_bus_init (void);
@@ -257,7 +259,6 @@ int checkboard (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t    *immap = (immap_t *)CFG_IMMR;
        volatile ccsr_lbc_t *memctl = &immap->im_lbc;
 
index 97bb5c3ee499ad9647a35331b73b7be060da9ddb..ab57ee5c6196b0932d4bf9c972d25cabb8d42350 100644 (file)
@@ -31,6 +31,8 @@
 
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M)
 # ifndef CFG_OR_TIMING_FLASH_AT_50MHZ
 #  define CFG_OR_TIMING_FLASH_AT_50MHZ (OR_ACS_DIV1  | OR_TRLX | OR_CSNT_SAM | \
@@ -63,8 +65,6 @@ unsigned long flash_init (void)
 #ifdef CFG_OR_TIMING_FLASH_AT_50MHZ
        int scy, trlx, flash_or_timing, clk_diff;
 
-       DECLARE_GLOBAL_DATA_PTR;
-
        scy = (CFG_OR_TIMING_FLASH_AT_50MHZ & OR_SCY_MSK) >> 4;
        if (CFG_OR_TIMING_FLASH_AT_50MHZ & OR_TRLX) {
                trlx = OR_TRLX;
index 017bdf9442a8871ebfa737ff0faa9445c33c5e74..520bea873fdf74b1fce470d8a0abaef58bf1ae8d 100644 (file)
 #include <ps2mult.h>
 #endif
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 static long int dram_size (long int, long int *, long int);
 
-/* ------------------------------------------------------------------------- */
-
 #define        _NOT_USED_      0xFFFFFFFF
 
 const uint sdram_table[] =
@@ -104,8 +102,6 @@ const uint sdram_table[] =
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char *s = getenv ("serial#");
 
        puts ("Board: ");
index 91044130988475c42ec0705b77481fbbeeed0fbc..4097892b9efbdff1df8d6865bebf0bff44f62a6d 100644 (file)
@@ -454,10 +454,11 @@ int memory_post_tests (unsigned long start, unsigned long size)
 }
 
 #if 0
+DECLARE_GLOBAL_DATA_PTR;
+
 int memory_post_test (int flags)
 {
        int ret = 0;
-       DECLARE_GLOBAL_DATA_PTR;
        bd_t *bd = gd->bd;
        unsigned long memsize = (bd->bi_memsize >= 256 << 20 ?
                                 256 << 20 : bd->bi_memsize) - (1 << 20);
index e8dfd2ceb0b1476dbff743506865e03b885bc664..868a899ee90e0002f204b68a306a26407837a222 100644 (file)
@@ -28,7 +28,7 @@
 #include <s3c2400.h>
 #include <command.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CFG_BRIGHTNESS
 static void spi_init(void);
@@ -52,8 +52,6 @@ extern int do_mdm_init; /* defined in common/main.c */
 #define KBD_MDELAY     5000
 static void udelay_no_timer (int usec)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i;
        int delay = usec * 3;
 
@@ -70,7 +68,6 @@ int board_init ()
 #if defined(CONFIG_VFD)
        extern int vfd_init_clocks(void);
 #endif
-       DECLARE_GLOBAL_DATA_PTR;
        S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
        S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
 
@@ -141,8 +138,6 @@ int board_init ()
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        return 0;
index f510ee55b07d169acfef2d68e370a2cc7513c376..cea8b0b665ee318133773a6a403a66e8df289265 100644 (file)
@@ -39,6 +39,8 @@
 #include <devices.h>
 #include <s3c2400.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_VFD
 
 /************************************************************************/
@@ -86,7 +88,6 @@ unsigned char bit_vfd_table[112][18][2][4][2];
  */
 void init_grid_ctrl(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong adr, grid_cycle;
        unsigned int bit, display;
        unsigned char temp, bit_nr;
@@ -172,7 +173,6 @@ void init_grid_ctrl(void)
  */
 void create_vfd_table(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned long vfd_table[112][18][2][4][2];
        unsigned int x, y, color, display, entry, pixel;
        unsigned int x_abcdef = 0;
@@ -280,7 +280,6 @@ void set_vfd_pixel(unsigned char x, unsigned char y,
                   unsigned char color, unsigned char display,
                   unsigned char value)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong adr;
        unsigned char bit_nr, temp;
 
@@ -435,8 +434,6 @@ int drv_vfd_init(void)
        static int vfd_init_done = 0;
        int vfd_inv_data = 0;
 
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (vfd_init_done != 0)
                return (0);
        vfd_init_done = 1;
index 0274027096fda0951ddfe38599baecee089a0d35..9d1a25ec8a09ec11a5a9c8c029d1816d00d352ba 100644 (file)
@@ -35,6 +35,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void flash__init (void);
 void ether__init (void);
 void peripheral_power_enable (void);
@@ -61,9 +63,6 @@ static inline void delay (unsigned long loops)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
-
        /*
         * set clock frequency:
         *      VERSATILE_REFCLK is 32KHz
index 7a2d243ef88f3855b40debc1cec2f9cae3102a0b..04093d172c6bf83f3294e1245fd6cdc95bdfa1e7 100644 (file)
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        *((volatile unsigned char *) VOICEBLUE_LED_REG) = 0xaa;
 
        /* arch number of VoiceBlue board */
@@ -39,8 +39,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        *((volatile unsigned short *) VOICEBLUE_LED_REG) = 0xff;
 
        /* Take the Ethernet controller out of reset and wait
index 56cb855af0190e05474efd32493f043abf8bea72..fe4b6a91d20797bc48a7ef5e5da07a5153e43024 100644 (file)
 #include <common.h>
 #include <asm/arch/pxa-regs.h>
 
-int board_init( void ){
-  DECLARE_GLOBAL_DATA_PTR;
+DECLARE_GLOBAL_DATA_PTR;
 
-  gd->bd->bi_arch_number = MACH_TYPE_WEP_EP250;
-  gd->bd->bi_boot_params = 0xa0000000;
+int board_init (void)
+{
+       gd->bd->bi_arch_number = MACH_TYPE_WEP_EP250;
+       gd->bd->bi_boot_params = 0xa0000000;
 /*
  * Setup GPIO stuff to get serial working
  */
 #if defined( CONFIG_FFUART )
-  GPDR1   = 0x80;
-  GAFR1_L = 0x8010;
+       GPDR1 = 0x80;
+       GAFR1_L = 0x8010;
 #elif defined( CONFIG_BTUART )
-  GPDR1   = 0x800;
-  GAFR1_L = 0x900000;
+       GPDR1 = 0x800;
+       GAFR1_L = 0x900000;
 #endif
-  PSSR    = 0x20;
+       PSSR = 0x20;
 
-  return 0;
+       return 0;
 }
 
-int dram_init( void ){
-  DECLARE_GLOBAL_DATA_PTR;
-
+int dram_init (void)
+{
 #if ( CONFIG_NR_DRAM_BANKS > 0 )
-  gd->bd->bi_dram[0].start = WEP_SDRAM_1;
-  gd->bd->bi_dram[0].size  = WEP_SDRAM_1_SIZE;
+       gd->bd->bi_dram[0].start = WEP_SDRAM_1;
+       gd->bd->bi_dram[0].size = WEP_SDRAM_1_SIZE;
 #endif
 #if ( CONFIG_NR_DRAM_BANKS > 1 )
-  gd->bd->bi_dram[1].start = WEP_SDRAM_2;
-  gd->bd->bi_dram[1].size  = WEP_SDRAM_2_SIZE;
+       gd->bd->bi_dram[1].start = WEP_SDRAM_2;
+       gd->bd->bi_dram[1].size = WEP_SDRAM_2_SIZE;
 #endif
 #if ( CONFIG_NR_DRAM_BANKS > 2 )
-  gd->bd->bi_dram[2].start = WEP_SDRAM_3;
-  gd->bd->bi_dram[2].size  = WEP_SDRAM_3_SIZE;
+       gd->bd->bi_dram[2].start = WEP_SDRAM_3;
+       gd->bd->bi_dram[2].size = WEP_SDRAM_3_SIZE;
 #endif
 #if ( CONFIG_NR_DRAM_BANKS > 3 )
-  gd->bd->bi_dram[3].start = WEP_SDRAM_4;
-  gd->bd->bi_dram[3].size  = WEP_SDRAM_4_SIZE;
+       gd->bd->bi_dram[3].start = WEP_SDRAM_4;
+       gd->bd->bi_dram[3].size = WEP_SDRAM_4_SIZE;
 #endif
 
-  return 0;
+       return 0;
 }
index 26fb312fd0a5c7ab77e7df1b6eeac01fda02b94e..9baa457c046f52dae5e22abedfd08ac45cd990d8 100644 (file)
@@ -30,8 +30,7 @@
 
 #include <common.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -39,8 +38,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -63,8 +60,6 @@ int board_late_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        /*      gd->bd->bi_dram[1].start = PHYS_SDRAM_2;*/
index 19bcc6ff33400f284ed56fd367fd9c37de694319..c204b88e415bae025f8829025b4af8e642355624 100644 (file)
@@ -43,6 +43,8 @@
 #include <configs/ml300.h>
 #include "xparameters.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define USE_CHAN1 \
        ((defined XPAR_UARTNS550_0_BASEADDR) && (defined CFG_INIT_CHAN1))
 #define USE_CHAN2 \
@@ -64,7 +66,6 @@ int
 serial_init(void)
 {
 #if USE_CHAN1
-       DECLARE_GLOBAL_DATA_PTR;
        int clock_divisor;
 
        clock_divisor = XPAR_UARTNS550_0_CLOCK_FREQ_HZ / 16 / gd->baudrate;
@@ -103,7 +104,6 @@ void
 serial_setbrg(void)
 {
 #if USE_CHAN1
-       DECLARE_GLOBAL_DATA_PTR;
        int clock_divisor;
 
        clock_divisor = XPAR_UARTNS550_0_CLOCK_FREQ_HZ / 16 / gd->baudrate;
index ef5e9da0e3e8c12acfb810dc0c19f9050ebe4b8b..528d3239ce4306ca05f29825d2d231301679e1ee 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/arch/pxa-regs.h>
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 /* local prototypes */
@@ -61,7 +63,6 @@ int
 board_init (void)
 /**********************************************************/
 {
-       DECLARE_GLOBAL_DATA_PTR;
        /* arch number of MicroSys XM250 */
        gd->bd->bi_arch_number = MACH_TYPE_XM250;
 
@@ -76,8 +77,6 @@ int
 dram_init (void)
 /**********************************************************/
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index bb36c965236344f42c44ef65f2f62043059f6d77..a569b534727a87a7e2eb055962061cc1530f5540 100644 (file)
@@ -26,6 +26,8 @@
 #include <spd_sdram.h>
 #include <i2c.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define BOOT_SMALL_FLASH       32      /* 00100000 */
 #define FLASH_ONBD_N           2       /* 00000010 */
 #define FLASH_SRAM_SEL         1       /* 00000001 */
@@ -107,7 +109,7 @@ long int initdram (int board_type)
        long dram_size = 0;
 
 #if defined(CONFIG_SPD_EEPROM)
-       dram_size = spd_sdram (0);
+       dram_size = spd_sdram ();
 #else
        dram_size = fixed_sdram ();
 #endif
@@ -238,8 +240,6 @@ int pci_pre_init(struct pci_controller * hose )
 #if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
 void pci_target_init(struct pci_controller * hose )
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*--------------------------------------------------------------------------+
         * Disable everything
         *--------------------------------------------------------------------------*/
index a9919dbaa651b6ccdea677c6d06344e6262bff0b..23d56c43ac90377fc5408dea25b07cb8ac253a7b 100644 (file)
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Miscelaneous platform dependent initialisations
  */
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -56,8 +56,6 @@ int board_post_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
index e618ab96a1d4cc24d244c803c586126060e909bc..58291706c0d91b044cdaaee362f92a7a206e035e 100644 (file)
@@ -27,8 +27,7 @@
 
 #include <common.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -36,8 +35,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
@@ -60,8 +57,6 @@ int board_late_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
index 40e28dd9d23b4e14774b536bdd854e671f431ffd..04fa4facae1bacd6c4d733574aad56072f1962c6 100644 (file)
@@ -28,6 +28,7 @@
 #include <command.h>
 #include <net.h>               /* for print_IPaddr */
 
+DECLARE_GLOBAL_DATA_PTR;
 
 #if (CONFIG_COMMANDS & CFG_CMD_BDI)
 static void print_num(const char *, ulong);
@@ -39,8 +40,6 @@ static void print_str(const char *, const char *);
 
 int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i;
        bd_t *bd = gd->bd;
        char buf[32];
@@ -127,8 +126,6 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i;
        bd_t *bd = gd->bd;
 
@@ -153,8 +150,6 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i;
        bd_t *bd = gd->bd;
 
@@ -187,8 +182,6 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i;
        bd_t *bd = gd->bd;
 
@@ -215,8 +208,6 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i;
        bd_t *bd = gd->bd;
 
index cdb379de21656afa8f4011d9df4a397fe906fdda..48086a62809d34ba4e6aaf824b95b48e0c26a2af 100644 (file)
 #include <bedbug/regs.h>
 #include <bedbug/ppc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
 
 #ifndef MAX
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
 
-extern void show_regs __P((struct pt_regs*));
-extern int  run_command __P((const char*, int));
+extern void show_regs __P ((struct pt_regs *));
+extern int run_command __P ((const char *, int));
 extern char console_buffer[];
 
-ulong        dis_last_addr = 0;        /* Last address disassembled   */
-ulong        dis_last_len = 20;        /* Default disassembler length */
-CPU_DEBUG_CTX bug_ctx;                  /* Bedbug context structure    */
-
+ulong dis_last_addr = 0;       /* Last address disassembled   */
+ulong dis_last_len = 20;       /* Default disassembler length */
+CPU_DEBUG_CTX bug_ctx;         /* Bedbug context structure    */
 \f
+
 /* ======================================================================
  * U-Boot's puts function does not append a newline, so the bedbug stuff
  * will use this for the output of the dis/assembler.
  * ====================================================================== */
 
-int bedbug_puts(const char *str)
+int bedbug_puts (const char *str)
 {
-  /* -------------------------------------------------- */
+       /* -------------------------------------------------- */
 
-  printf( "%s\r\n", str );
-  return 0;
-} /* bedbug_puts */
+       printf ("%s\r\n", str);
+       return 0;
+}                              /* bedbug_puts */
+\f
 
 
-\f
 /* ======================================================================
  * Initialize the bug_ctx structure used by the bedbug debugger.  This is
  * specific to the CPU since each has different debug registers and
  * settings.
  * ====================================================================== */
 
-void bedbug_init( void )
+void bedbug_init (void)
 {
-  /* -------------------------------------------------- */
+       /* -------------------------------------------------- */
 
 #if defined(CONFIG_4xx)
-  void bedbug405_init( void );
-  bedbug405_init();
+       void bedbug405_init (void);
+
+       bedbug405_init ();
 #elif defined(CONFIG_8xx)
-  void bedbug860_init( void );
-  bedbug860_init();
+       void bedbug860_init (void);
+
+       bedbug860_init ();
 #endif
 
 #if defined(CONFIG_MPC824X) || defined(CONFIG_MPC8260)
-  /* Processors that are 603e core based */
-  void bedbug603e_init( void );
+       /* Processors that are 603e core based */
+       void bedbug603e_init (void);
 
-  bedbug603e_init();
+       bedbug603e_init ();
 #endif
 
-  return;
-} /* bedbug_init */
+       return;
+}                              /* bedbug_init */
+\f
 
 
-\f
 /* ======================================================================
  * Entry point from the interpreter to the disassembler.  Repeated calls
  * will resume from the last disassembled address.
  * ====================================================================== */
-int do_bedbug_dis (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-  ulong        addr;   /* Address to start disassembly from    */
-  ulong        len;    /* # of instructions to disassemble     */
-  /* -------------------------------------------------- */
-
-  /* Setup to go from the last address if none is given */
-  addr = dis_last_addr;
-  len  = dis_last_len;
-
-  if (argc < 2)
-  {
-    printf ("Usage:\n%s\n", cmdtp->usage);
-    return 1;
-  }
-
-  if(( flag & CMD_FLAG_REPEAT ) == 0 )
-  {
-    /* New command */
-    addr = simple_strtoul( argv[1], NULL, 16 );
-
-    /* If an extra param is given then it is the length */
-    if( argc > 2 )
-      len = simple_strtoul( argv[2], NULL, 16 );
-  }
-
-  /* Run the disassembler */
-  disppc( (unsigned char *)addr, 0, len, bedbug_puts, F_RADHEX );
-
-  dis_last_addr = addr + (len * 4);
-  dis_last_len = len;
-  return 0;
-} /* do_bedbug_dis */
-U_BOOT_CMD(
-       ds,      3,      1,      do_bedbug_dis,
-       "ds      - disassemble memory\n",
-       "ds <address> [# instructions]\n"
-);
+       ulong addr;             /* Address to start disassembly from    */
+       ulong len;              /* # of instructions to disassemble     */
+
+       /* -------------------------------------------------- */
+
+       /* Setup to go from the last address if none is given */
+       addr = dis_last_addr;
+       len = dis_last_len;
+
+       if (argc < 2) {
+               printf ("Usage:\n%s\n", cmdtp->usage);
+               return 1;
+       }
+
+       if ((flag & CMD_FLAG_REPEAT) == 0) {
+               /* New command */
+               addr = simple_strtoul (argv[1], NULL, 16);
+
+               /* If an extra param is given then it is the length */
+               if (argc > 2)
+                       len = simple_strtoul (argv[2], NULL, 16);
+       }
+
+       /* Run the disassembler */
+       disppc ((unsigned char *) addr, 0, len, bedbug_puts, F_RADHEX);
+
+       dis_last_addr = addr + (len * 4);
+       dis_last_len = len;
+       return 0;
+}                              /* do_bedbug_dis */
+
+U_BOOT_CMD (ds, 3, 1, do_bedbug_dis,
+           "ds      - disassemble memory\n",
+           "ds <address> [# instructions]\n");
 \f
 /* ======================================================================
  * Entry point from the interpreter to the assembler.  Assembles
  * instructions in consecutive memory locations until a '.' (period) is
  * entered on a line by itself.
  * ====================================================================== */
-int do_bedbug_asm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-  long         mem_addr;               /* Address to assemble into     */
-  unsigned long instr;                  /* Machine code for text        */
-  char         prompt[ 15 ];           /* Prompt string for user input */
-  int          asm_err;                /* Error code from the assembler*/
-  /* -------------------------------------------------- */
-   int          rcode = 0;
-
-  if (argc < 2)
-  {
-    printf ("Usage:\n%s\n", cmdtp->usage);
-    return 1;
-  }
-
-  printf( "\nEnter '.' when done\n" );
-  mem_addr = simple_strtoul( argv[ 1 ], NULL, 16 );
-
-  while( 1 )
-  {
-    putc( '\n' );
-    disppc( (unsigned char *)mem_addr, 0, 1, bedbug_puts, F_RADHEX );
-
-    sprintf( prompt, "%08lx:    ", mem_addr );
-    readline( prompt );
-
-    if( console_buffer[ 0 ] && strcmp( console_buffer, "." ))
-    {
-      if(( instr = asmppc( mem_addr, console_buffer, &asm_err )) != 0 )
-      {
-       *(unsigned long *)mem_addr = instr;
-       mem_addr += 4;
-      }
-      else
-      {
-       printf( "*** Error: %s ***\n", asm_error_str( asm_err ));
-       rcode = 1;
-      }
-    }
-    else
-    {
-      break;
-    }
-  }
-  return rcode;
-} /* do_bedbug_asm */
-U_BOOT_CMD(
-       as,      2,      0,      do_bedbug_asm,
-       "as      - assemble memory\n",
-       "as <address>\n"
-);
+       long mem_addr;          /* Address to assemble into     */
+       unsigned long instr;    /* Machine code for text        */
+       char prompt[15];        /* Prompt string for user input */
+       int asm_err;            /* Error code from the assembler */
+
+       /* -------------------------------------------------- */
+       int rcode = 0;
+
+       if (argc < 2) {
+               printf ("Usage:\n%s\n", cmdtp->usage);
+               return 1;
+       }
+
+       printf ("\nEnter '.' when done\n");
+       mem_addr = simple_strtoul (argv[1], NULL, 16);
+
+       while (1) {
+               putc ('\n');
+               disppc ((unsigned char *) mem_addr, 0, 1, bedbug_puts,
+                       F_RADHEX);
+
+               sprintf (prompt, "%08lx:    ", mem_addr);
+               readline (prompt);
+
+               if (console_buffer[0] && strcmp (console_buffer, ".")) {
+                       if ((instr =
+                            asmppc (mem_addr, console_buffer,
+                                    &asm_err)) != 0) {
+                               *(unsigned long *) mem_addr = instr;
+                               mem_addr += 4;
+                       } else {
+                               printf ("*** Error: %s ***\n",
+                                       asm_error_str (asm_err));
+                               rcode = 1;
+                       }
+               } else {
+                       break;
+               }
+       }
+       return rcode;
+}                              /* do_bedbug_asm */
+
+U_BOOT_CMD (as, 2, 0, do_bedbug_asm,
+           "as      - assemble memory\n", "as <address>\n");
 \f
 /* ======================================================================
  * Used to set a break point from the interpreter.  Simply calls into the
  * CPU-specific break point set routine.
  * ====================================================================== */
 
-int do_bedbug_break (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-  /* -------------------------------------------------- */
-  if( bug_ctx.do_break )
-    (*bug_ctx.do_break)( cmdtp, flag, argc, argv );
-    return 0;
-
-} /* do_bedbug_break */
-U_BOOT_CMD(
-       break,      3,      0,      do_bedbug_break,
-       "break   - set or clear a breakpoint\n",
-       " - Set or clear a breakpoint\n"
-       "break <address> - Break at an address\n"
-       "break off <bp#> - Disable breakpoint.\n"
-       "break show      - List breakpoints.\n"
-);
+       /* -------------------------------------------------- */
+       if (bug_ctx.do_break)
+               (*bug_ctx.do_break) (cmdtp, flag, argc, argv);
+       return 0;
+
+}                              /* do_bedbug_break */
+
+U_BOOT_CMD (break, 3, 0, do_bedbug_break,
+           "break   - set or clear a breakpoint\n",
+           " - Set or clear a breakpoint\n"
+           "break <address> - Break at an address\n"
+           "break off <bp#> - Disable breakpoint.\n"
+           "break show      - List breakpoints.\n");
 \f
 /* ======================================================================
  * Called from the debug interrupt routine.  Simply calls the CPU-specific
@@ -200,16 +196,16 @@ U_BOOT_CMD(
 
 void do_bedbug_breakpoint (struct pt_regs *regs)
 {
-  /* -------------------------------------------------- */
+       /* -------------------------------------------------- */
 
-  if( bug_ctx.break_isr )
-    (*bug_ctx.break_isr)( regs );
+       if (bug_ctx.break_isr)
+               (*bug_ctx.break_isr) (regs);
 
-  return;
-} /* do_bedbug_breakpoint */
+       return;
+}                              /* do_bedbug_breakpoint */
+\f
 
 
-\f
 /* ======================================================================
  * Called from the CPU-specific breakpoint handling routine.  Enter a
  * mini main loop until the stopped flag is cleared from the breakpoint
@@ -218,81 +214,77 @@ void do_bedbug_breakpoint (struct pt_regs *regs)
  * This handles the parts of the debugger that are common to all CPU's.
  * ====================================================================== */
 
-void bedbug_main_loop( unsigned long addr, struct pt_regs *regs )
+void bedbug_main_loop (unsigned long addr, struct pt_regs *regs)
 {
-  int          len;                    /* Length of command line */
-  int           flag;                   /* Command flags          */
-  int           rc = 0;                 /* Result from run_command*/
-  char          prompt_str[ 20 ];       /* Prompt string          */
-  static char   lastcommand[ CFG_CBSIZE ] = {0}; /* previous command */
-  /* -------------------------------------------------- */
+       int len;                /* Length of command line */
+       int flag;               /* Command flags          */
+       int rc = 0;             /* Result from run_command */
+       char prompt_str[20];    /* Prompt string          */
+       static char lastcommand[CFG_CBSIZE] = { 0 };    /* previous command */
+       /* -------------------------------------------------- */
 
-  if( bug_ctx.clear )
-    (*bug_ctx.clear)( bug_ctx.current_bp );
+       if (bug_ctx.clear)
+               (*bug_ctx.clear) (bug_ctx.current_bp);
 
-  printf( "Breakpoint %d: ", bug_ctx.current_bp );
-  disppc( (unsigned char *)addr, 0, 1, bedbug_puts, F_RADHEX );
+       printf ("Breakpoint %d: ", bug_ctx.current_bp);
+       disppc ((unsigned char *) addr, 0, 1, bedbug_puts, F_RADHEX);
 
-  bug_ctx.stopped = 1;
-  bug_ctx.regs = regs;
+       bug_ctx.stopped = 1;
+       bug_ctx.regs = regs;
 
-  sprintf( prompt_str, "BEDBUG.%d =>", bug_ctx.current_bp );
+       sprintf (prompt_str, "BEDBUG.%d =>", bug_ctx.current_bp);
 
-  /* A miniature main loop */
-  while( bug_ctx.stopped )
-  {
-    len = readline( prompt_str );
+       /* A miniature main loop */
+       while (bug_ctx.stopped) {
+               len = readline (prompt_str);
 
-    flag = 0;  /* assume no special flags for now */
+               flag = 0;       /* assume no special flags for now */
 
-    if (len > 0)
-      strcpy( lastcommand, console_buffer );
-    else if( len == 0 )
-      flag |= CMD_FLAG_REPEAT;
+               if (len > 0)
+                       strcpy (lastcommand, console_buffer);
+               else if (len == 0)
+                       flag |= CMD_FLAG_REPEAT;
 
-    if (len == -1)
-      printf ("<INTERRUPT>\n");
-    else
-      rc = run_command( lastcommand, flag );
+               if (len == -1)
+                       printf ("<INTERRUPT>\n");
+               else
+                       rc = run_command (lastcommand, flag);
 
-    if (rc <= 0) {
-      /* invalid command or not repeatable, forget it */
-      lastcommand[0] = 0;
-    }
-  }
+               if (rc <= 0) {
+                       /* invalid command or not repeatable, forget it */
+                       lastcommand[0] = 0;
+               }
+       }
 
-  bug_ctx.regs = NULL;
-  bug_ctx.current_bp = 0;
+       bug_ctx.regs = NULL;
+       bug_ctx.current_bp = 0;
 
-  return;
-} /* bedbug_main_loop */
+       return;
+}                              /* bedbug_main_loop */
+\f
 
 
-\f
 /* ======================================================================
  * Interpreter command to continue from a breakpoint.  Just clears the
  * stopped flag in the context so that the breakpoint routine will
  * return.
  * ====================================================================== */
-int do_bedbug_continue (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-
+int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-  /* -------------------------------------------------- */
-
-  if( ! bug_ctx.stopped )
-  {
-    printf( "Not at a breakpoint\n" );
-    return 1;
-  }
-
-  bug_ctx.stopped = 0;
-  return 0;
-} /* do_bedbug_continue */
-U_BOOT_CMD(
-       continue,      1,      0,      do_bedbug_continue,
-       "continue- continue from a breakpoint\n",
-       " - continue from a breakpoint.\n"
-);
+       /* -------------------------------------------------- */
+
+       if (!bug_ctx.stopped) {
+               printf ("Not at a breakpoint\n");
+               return 1;
+       }
+
+       bug_ctx.stopped = 0;
+       return 0;
+}                              /* do_bedbug_continue */
+
+U_BOOT_CMD (continue, 1, 0, do_bedbug_continue,
+           "continue- continue from a breakpoint\n",
+           " - continue from a breakpoint.\n");
 \f
 /* ======================================================================
  * Interpreter command to continue to the next instruction, stepping into
@@ -300,31 +292,30 @@ U_BOOT_CMD(
  * the address passes control to the CPU-specific set breakpoint routine
  * for the current breakpoint number.
  * ====================================================================== */
-int do_bedbug_step (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-  unsigned long addr;   /* Address to stop at */
-  /* -------------------------------------------------- */
-
-  if( ! bug_ctx.stopped )
-  {
-    printf( "Not at a breakpoint\n" );
-    return 1;
-  }
-
-  if( !find_next_address( (unsigned char *)&addr, FALSE, bug_ctx.regs ))
-    return 1;
-
-  if( bug_ctx.set )
-    (*bug_ctx.set)( bug_ctx.current_bp, addr );
-
-  bug_ctx.stopped = 0;
-  return 0;
-} /* do_bedbug_step */
-U_BOOT_CMD(
-       step,      1,      1,      do_bedbug_step,
-       "step    - single step execution.\n",
-       " - single step execution.\n"
-);
+       unsigned long addr;     /* Address to stop at */
+
+       /* -------------------------------------------------- */
+
+       if (!bug_ctx.stopped) {
+               printf ("Not at a breakpoint\n");
+               return 1;
+       }
+
+       if (!find_next_address ((unsigned char *) &addr, FALSE, bug_ctx.regs))
+               return 1;
+
+       if (bug_ctx.set)
+               (*bug_ctx.set) (bug_ctx.current_bp, addr);
+
+       bug_ctx.stopped = 0;
+       return 0;
+}                              /* do_bedbug_step */
+
+U_BOOT_CMD (step, 1, 1, do_bedbug_step,
+           "step    - single step execution.\n",
+           " - single step execution.\n");
 \f
 /* ======================================================================
  * Interpreter command to continue to the next instruction, stepping over
@@ -332,105 +323,97 @@ U_BOOT_CMD(
  * the address passes control to the CPU-specific set breakpoint routine
  * for the current breakpoint number.
  * ====================================================================== */
-int do_bedbug_next (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-  unsigned long addr;   /* Address to stop at */
-  /* -------------------------------------------------- */
-
-  if( ! bug_ctx.stopped )
-  {
-    printf( "Not at a breakpoint\n" );
-    return 1;
-  }
-
-  if( !find_next_address( (unsigned char *)&addr, TRUE, bug_ctx.regs ))
-    return 1;
-
-  if( bug_ctx.set )
-    (*bug_ctx.set)( bug_ctx.current_bp, addr );
-
-  bug_ctx.stopped = 0;
-  return 0;
-} /* do_bedbug_next */
-U_BOOT_CMD(
-       next,      1,      1,      do_bedbug_next,
-       "next    - single step execution, stepping over subroutines.\n",
-       " - single step execution, stepping over subroutines.\n"
-);
+       unsigned long addr;     /* Address to stop at */
+
+       /* -------------------------------------------------- */
+
+       if (!bug_ctx.stopped) {
+               printf ("Not at a breakpoint\n");
+               return 1;
+       }
+
+       if (!find_next_address ((unsigned char *) &addr, TRUE, bug_ctx.regs))
+               return 1;
+
+       if (bug_ctx.set)
+               (*bug_ctx.set) (bug_ctx.current_bp, addr);
+
+       bug_ctx.stopped = 0;
+       return 0;
+}                              /* do_bedbug_next */
+
+U_BOOT_CMD (next, 1, 1, do_bedbug_next,
+           "next    - single step execution, stepping over subroutines.\n",
+           " - single step execution, stepping over subroutines.\n");
 \f
 /* ======================================================================
  * Interpreter command to print the current stack.  This assumes an EABI
  * architecture, so it starts with GPR R1 and works back up the stack.
  * ====================================================================== */
-int do_bedbug_stack (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
-  unsigned long sp;             /* Stack pointer                */
-  unsigned long func;           /* LR from stack                */
-  int           depth;          /* Stack iteration level        */
-  int           skip = 1;       /* Flag to skip the first entry */
-  unsigned long top;            /* Top of memory address        */
-  /* -------------------------------------------------- */
-
-  if( ! bug_ctx.stopped )
-  {
-    printf( "Not at a breakpoint\n" );
-    return 1;
-  }
-
-  top = gd->bd->bi_memstart + gd->bd->bi_memsize;
-  depth = 0;
-
-  printf( "Depth     PC\n" );
-  printf( "-----  --------\n" );
-  printf( "%5d  %08lx\n", depth++, bug_ctx.regs->nip );
-
-  sp = bug_ctx.regs->gpr[ 1 ];
-  func = *(unsigned long *)(sp+4);
-
-  while(( func < top ) && ( sp < top ))
-  {
-    if( !skip )
-      printf( "%5d  %08lx\n", depth++, func );
-    else
-      --skip;
-
-    sp = *(unsigned long *)sp;
-    func = *(unsigned long *)(sp+4);
-  }
-  return 0;
-} /* do_bedbug_stack */
-U_BOOT_CMD(
-       where,     1,      1,      do_bedbug_stack,
-       "where   - Print the running stack.\n",
-       " - Print the running stack.\n"
-);
+       unsigned long sp;       /* Stack pointer                */
+       unsigned long func;     /* LR from stack                */
+       int depth;              /* Stack iteration level        */
+       int skip = 1;           /* Flag to skip the first entry */
+       unsigned long top;      /* Top of memory address        */
+
+       /* -------------------------------------------------- */
+
+       if (!bug_ctx.stopped) {
+               printf ("Not at a breakpoint\n");
+               return 1;
+       }
+
+       top = gd->bd->bi_memstart + gd->bd->bi_memsize;
+       depth = 0;
+
+       printf ("Depth     PC\n");
+       printf ("-----  --------\n");
+       printf ("%5d  %08lx\n", depth++, bug_ctx.regs->nip);
+
+       sp = bug_ctx.regs->gpr[1];
+       func = *(unsigned long *) (sp + 4);
+
+       while ((func < top) && (sp < top)) {
+               if (!skip)
+                       printf ("%5d  %08lx\n", depth++, func);
+               else
+                       --skip;
+
+               sp = *(unsigned long *) sp;
+               func = *(unsigned long *) (sp + 4);
+       }
+       return 0;
+}                              /* do_bedbug_stack */
+
+U_BOOT_CMD (where, 1, 1, do_bedbug_stack,
+           "where   - Print the running stack.\n",
+           " - Print the running stack.\n");
 \f
 /* ======================================================================
  * Interpreter command to dump the registers.  Calls the CPU-specific
  * show registers routine.
  * ====================================================================== */
-int do_bedbug_rdump (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-  /* -------------------------------------------------- */
-
-  if( ! bug_ctx.stopped )
-  {
-    printf( "Not at a breakpoint\n" );
-    return 1;
-  }
-
-  show_regs( bug_ctx.regs );
-  return 0;
-} /* do_bedbug_rdump */
-U_BOOT_CMD(
-       rdump,     1,      1,      do_bedbug_rdump,
-       "rdump   - Show registers.\n",
-       " - Show registers.\n"
-);
+       /* -------------------------------------------------- */
+
+       if (!bug_ctx.stopped) {
+               printf ("Not at a breakpoint\n");
+               return 1;
+       }
+
+       show_regs (bug_ctx.regs);
+       return 0;
+}                              /* do_bedbug_rdump */
+
+U_BOOT_CMD (rdump, 1, 1, do_bedbug_rdump,
+           "rdump   - Show registers.\n", " - Show registers.\n");
 /* ====================================================================== */
-#endif /* CFG_CMD_BEDBUG */
+#endif /* CFG_CMD_BEDBUG */
 
 
 /*
index 5b58d4e2f1ff1528ba397a10b068f805b0d37e79..e68f16f9da022aa805d5e5f79fec0fa7f9f229d2 100644 (file)
 #include <command.h>
 #include <net.h>
 
-
-/* -------------------------------------------------------------------- */
+#if defined(CONFIG_I386)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
 
 int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-#if defined(CONFIG_I386)
-       DECLARE_GLOBAL_DATA_PTR;
-#endif
        ulong   addr, rc;
        int     rcode = 0;
 
index aeb7842aefa6872c4f926bc8a62e6b094914651c..fdf7180a19a87d4974b3b1a4cc131dba4ba432ba 100644 (file)
@@ -38,6 +38,8 @@
 #include <ft_build.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
  /*cmd_boot.c*/
  extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
@@ -469,7 +471,6 @@ U_BOOT_CMD(
 static void
 fixup_silent_linux ()
 {
-       DECLARE_GLOBAL_DATA_PTR;
        char buf[256], *start, *end;
        char *cmdline = getenv ("bootargs");
 
@@ -512,8 +513,6 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
                ulong   *len_ptr,
                int     verify)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong   sp;
        ulong   len, checksum;
        ulong   initrd_start, initrd_end;
@@ -856,8 +855,6 @@ do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
                ulong   *len_ptr,
                int     verify)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        image_header_t *hdr = &header;
 
        void    (*loader)(bd_t *, image_header_t *, char *, char *);
@@ -941,7 +938,6 @@ do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
                ulong   *len_ptr,
                int     verify)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong top;
        char *s, *cmdline;
        char **fwenv, **ss;
@@ -1370,7 +1366,6 @@ static void
 do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                ulong addr, ulong *len_ptr, int verify)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        image_header_t *hdr = &header;
        void    (*entry_point)(bd_t *);
 
index a569d78cadc3f911e9ebd4cf5714f3565d8b0736..84932f75680893512e4cdf84d94b298ab0a8af25 100644 (file)
@@ -28,6 +28,8 @@
 #include <command.h>
 #include <rtc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if (CONFIG_COMMANDS & CFG_CMD_DATE)
 
 const char *weekdays[] = {
@@ -40,7 +42,6 @@ int mk_date (char *, struct rtc_time *);
 
 int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
        struct rtc_time tm;
        int rcode = 0;
 
index eccf2e9e7b1aaf45ed3bb9393335c758a124e8c2..1d92bb37d3f9b4c1b435faa5b2651abcc7d88fb9 100644 (file)
@@ -19,6 +19,9 @@
 #include <net.h>
 #include <elf.h>
 
+#if defined(CONFIG_WALNUT) || defined(CFG_VXWORKS_MAC_PTR)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
 
 #if (CONFIG_COMMANDS & CFG_CMD_ELF)
 
@@ -78,11 +81,6 @@ int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  * ====================================================================== */
 int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-#if defined(CONFIG_WALNUT)     || \
-    defined(CFG_VXWORKS_MAC_PTR)
-       DECLARE_GLOBAL_DATA_PTR;
-#endif
-
        unsigned long addr;             /* Address of image            */
        unsigned long bootaddr;         /* Address to put the bootline */
        char *bootline;                 /* Text of the bootline        */
index b67d35a5a4e89191f5c41aedbdccedf81706bf4c..41621ba982b029564a8e1311997e5a78a5400145 100644 (file)
@@ -60,6 +60,10 @@ unsigned long mips_io_port_base = 0;
 # define SHOW_BOOT_PROGRESS(arg)
 #endif
 
+#ifdef CONFIG_IDE_8xx_DIRECT
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 #ifdef __PPC__
 # define EIEIO         __asm__ volatile ("eieio")
 # define SYNC          __asm__ volatile ("sync")
@@ -498,7 +502,6 @@ void ide_init (void)
 {
 
 #ifdef CONFIG_IDE_8xx_DIRECT
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        volatile pcmconf8xx_t *pcmp = &(immr->im_pcmcia);
 #endif
index 559d7b4c300dacfd2826f146c0a33447203f6387..fa79b45a3cc6182e5dbaf21185c07712691b72bf 100644 (file)
 #include <asm/iopin_8260.h>
 #endif
 
+#if defined(CONFIG_8xx) || defined(CONFIG_8260)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 static void
 unimplemented ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -450,10 +454,8 @@ static void prbrg (int n, uint val)
        uint div16 = (val & CPM_BRG_DIV16) != 0;
 
 #if defined(CONFIG_8xx)
-       DECLARE_GLOBAL_DATA_PTR;
        ulong clock = gd->cpu_clk;
 #elif defined(CONFIG_8260)
-       DECLARE_GLOBAL_DATA_PTR;
        ulong clock = gd->brg_clk;
 #endif
 
index 749849711a007fcfc6817ddca3144e2e0c0dcfb2..b18709a47f594bedabe827c104c88791250a33d6 100644 (file)
@@ -30,6 +30,7 @@
 #include <net.h>
 #include <exports.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 #if (CONFIG_COMMANDS & CFG_CMD_LOADS)
 static ulong load_serial (ulong offset);
@@ -53,7 +54,6 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        char *env_echo;
        int rcode = 0;
 #ifdef CFG_LOADS_BAUD_CHANGE
-       DECLARE_GLOBAL_DATA_PTR;
        int load_baudrate, current_baudrate;
 
        load_baudrate = current_baudrate = gd->baudrate;
@@ -213,7 +213,6 @@ load_serial (ulong offset)
 static int
 read_record (char *buf, ulong len)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        char *p;
        char c;
 
@@ -256,7 +255,6 @@ int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        ulong offset = 0;
        ulong size   = 0;
 #ifdef CFG_LOADS_BAUD_CHANGE
-       DECLARE_GLOBAL_DATA_PTR;
        int save_baudrate, current_baudrate;
 
        save_baudrate = current_baudrate = gd->baudrate;
@@ -433,8 +431,6 @@ char his_quote;      /* quote chars he'll use */
 
 int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong offset = 0;
        ulong addr;
        int load_baudrate, current_baudrate;
index efc9689c298b55675bde676c5708bb66917c9b3d..042a403026f00fa04b5cadd571ee3246b301d522 100644 (file)
@@ -46,6 +46,8 @@
 #include <post.h>
 #include <logbuff.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_LOGBUFFER)
 
 /* Local prototypes */
@@ -73,7 +75,6 @@ static unsigned long *ext_logged_chars;
    in linux/kernel/printk */
 void logbuff_init_ptrs (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned long *ext_tag;
        unsigned long post_word;
        char *s;
@@ -139,8 +140,6 @@ static void logbuff_puts (const char *s)
 
 void logbuff_log(char *msg)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if ((gd->post_log_word & LOGBUFF_INITIALIZED)) {
                logbuff_printk (msg);
        } else {
index ecf1db489a478799be5bcb08b6099d33ed58b974..6257fbd23e6d0703213bcc59b14a487bf52f4707 100644 (file)
@@ -50,6 +50,8 @@
 #include <net.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if !defined(CFG_ENV_IS_IN_NVRAM)      && \
     !defined(CFG_ENV_IS_IN_EEPROM)     && \
     !defined(CFG_ENV_IS_IN_FLASH)      && \
@@ -152,8 +154,6 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 int _do_setenv (int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int   i, len, oldval;
        int   console = -1;
        uchar *env, *nxt = NULL;
index 3c535d23d6d5ea592d982e57b41303c019a470f2..e9f23bec1820f178e3f4a67e3241182a0c65dc9d 100644 (file)
@@ -27,6 +27,8 @@
 #include <console.h>
 #include <exports.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_AMIGAONEG3SE
 int console_changed = 0;
 #endif
@@ -48,7 +50,6 @@ extern int overwrite_console (void);
 
 static int console_setfile (int file, device_t * dev)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int error = 0;
 
        if (dev == NULL)
@@ -161,8 +162,6 @@ void fprintf (int file, const char *fmt, ...)
 
 int getc (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (gd->flags & GD_FLG_DEVINIT) {
                /* Get from the standard input */
                return fgetc (stdin);
@@ -174,8 +173,6 @@ int getc (void)
 
 int tstc (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (gd->flags & GD_FLG_DEVINIT) {
                /* Test the standard input */
                return ftstc (stdin);
@@ -187,8 +184,6 @@ int tstc (void)
 
 void putc (const char c)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_SILENT_CONSOLE
        if (gd->flags & GD_FLG_SILENT)
                return;
@@ -205,8 +200,6 @@ void putc (const char c)
 
 void puts (const char *s)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_SILENT_CONSOLE
        if (gd->flags & GD_FLG_SILENT)
                return;
@@ -258,8 +251,6 @@ static int ctrlc_disabled = 0;      /* see disable_ctrl() */
 static int ctrlc_was_pressed = 0;
 int ctrlc (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (!ctrlc_disabled && gd->have_console) {
                if (tstc ()) {
                        switch (getc ()) {
@@ -370,8 +361,6 @@ int console_assign (int file, char *devname)
 /* Called before relocation - use serial functions */
 int console_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->have_console = 1;
 
 #ifdef CONFIG_SILENT_CONSOLE
@@ -407,7 +396,6 @@ device_t *search_device (int flags, char *name)
 /* Called after the relocation - use desired console functions */
 int console_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        char *stdinname, *stdoutname, *stderrname;
        device_t *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
 #ifdef CFG_CONSOLE_ENV_OVERWRITE
@@ -499,8 +487,6 @@ int console_init_r (void)
 /* Called after the relocation - use desired console functions */
 int console_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        device_t *inputdev = NULL, *outputdev = NULL;
        int i, items = ListNumItems (devlist);
 
index bd4dfa024a94460415f5948cc6947215367e54b3..ddf8f8ee2d9f8d9c220cb73198ee93a0b5335c87 100644 (file)
@@ -34,6 +34,8 @@
 #include <i2c.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 list_t devlist = 0;
 device_t *stdio_devices[] = { NULL, NULL, NULL };
 char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
@@ -160,8 +162,6 @@ int device_deregister(char *devname)
 int devices_init (void)
 {
 #ifndef CONFIG_ARM     /* already relocated for current ARM implementation */
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong relocation_offset = gd->reloc_off;
        int i;
 
index 0c0487228e500aaadb021352ad8eb9027949e897..20c206913c63d2fcd1588fc0f0ae3baaae10940a 100644 (file)
@@ -949,6 +949,8 @@ void malloc_stats();
 #endif /* 0 */                 /* Moved to malloc.h */
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
   Emulation of sbrk for WIN32
   All code within the ifdef WIN32 is untested by me.
@@ -1493,8 +1495,6 @@ static mbinptr av_[NAV * 2 + 2] = {
 
 void malloc_bin_reloc (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long *p = (unsigned long *)(&av_[2]);
        int i;
        for (i=2; i<(sizeof(av_)/sizeof(mbinptr)); ++i) {
index 3201135ea2eddbe7b46c427c7f1deef21d9d7d32..eb33422af4b9c664da8928c1e2d61d986067d338 100644 (file)
@@ -37,6 +37,8 @@
 # define SHOW_BOOT_PROGRESS(arg)
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_AMIGAONEG3SE
        extern void enable_nvram(void);
        extern void disable_nvram(void);
@@ -150,7 +152,6 @@ void env_crc_update (void)
 
 static uchar env_get_char_init (int index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        uchar c;
 
        /* if crc was bad, use the default environment */
@@ -167,7 +168,6 @@ static uchar env_get_char_init (int index)
 #ifdef CONFIG_AMIGAONEG3SE
 uchar env_get_char_memory (int index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        uchar retval;
        enable_nvram();
        if (gd->env_valid) {
@@ -181,8 +181,6 @@ uchar env_get_char_memory (int index)
 #else
 uchar env_get_char_memory (int index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (gd->env_valid) {
                return ( *((uchar *)(gd->env_addr + index)) );
        } else {
@@ -193,8 +191,6 @@ uchar env_get_char_memory (int index)
 
 uchar *env_get_addr (int index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (gd->env_valid) {
                return ( ((uchar *)(gd->env_addr + index)) );
        } else {
@@ -204,8 +200,6 @@ uchar *env_get_addr (int index)
 
 void env_relocate (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        DEBUGF ("%s[%d] offset = 0x%lx\n", __FUNCTION__,__LINE__,
                gd->reloc_off);
 
index 8834da032bdd82f5b78acf51d772e9972057a1a4..93fff29b05a4a6dda262fddbee115467495eae0a 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/stddef.h>
 #include <dataflash.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 env_t *env_ptr = NULL;
 
 char * env_name_spec = "dataflash";
@@ -68,8 +70,6 @@ int i;
  */
 int env_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong crc, len, new;
        unsigned off;
        uchar buf[64];
index 50c623e37e32b89b4bbe9f4bab1ba95f3017b059..2adc129c67799cee1ecbf7124862d4b4a1d9a1d0 100644 (file)
@@ -32,6 +32,8 @@
 #include <environment.h>
 #include <linux/stddef.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 env_t *env_ptr = NULL;
 
 char * env_name_spec = "EEPROM";
@@ -75,8 +77,6 @@ int saveenv(void)
  */
 int env_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong crc, len, new;
        unsigned off;
        uchar buf[64];
index a2ea9c41406842d7acbc404aef25538f19d75df7..1674b30e118d57c60d1a44684138555417fe34b6 100644 (file)
@@ -35,6 +35,8 @@
 #include <linux/stddef.h>
 #include <malloc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if ((CONFIG_COMMANDS&(CFG_CMD_ENV|CFG_CMD_FLASH)) == (CFG_CMD_ENV|CFG_CMD_FLASH))
 #define CMD_SAVEENV
 #elif defined(CFG_ENV_ADDR_REDUND)
@@ -89,8 +91,6 @@ extern int default_environment_size;
 
 uchar env_get_char_spec (int index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return ( *((uchar *)(gd->env_addr + index)) );
 }
 
@@ -98,7 +98,6 @@ uchar env_get_char_spec (int index)
 
 int  env_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int crc1_ok = 0, crc2_ok = 0;
 
        uchar flag1 = flash_addr->flags;
@@ -260,7 +259,6 @@ Done:
 
 int  env_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_OMAP2420H4
        int flash_probe(void);
 
@@ -358,8 +356,6 @@ void env_relocate_spec (void)
 {
 #if !defined(ENV_IS_EMBEDDED) || defined(CFG_ENV_ADDR_REDUND)
 #ifdef CFG_ENV_ADDR_REDUND
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (gd->env_addr != (ulong)&(flash_addr->data)) {
                env_t * etmp = flash_addr;
                ulong ltmp = end_addr;
index a6af74a75cf7c50225f41934ccf0c4b9aa72b98e..0a05b09a7a8515622edee793710b16a7f323e536 100644 (file)
@@ -78,11 +78,10 @@ env_t *env_ptr = 0;
 /* local functions */
 static void use_default(void);
 
+DECLARE_GLOBAL_DATA_PTR;
 
 uchar env_get_char_spec (int index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return ( *((uchar *)(gd->env_addr + index)) );
 }
 
@@ -95,8 +94,6 @@ uchar env_get_char_spec (int index)
  */
 int env_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->env_addr  = (ulong)&default_environment[0];
        gd->env_valid = 1;
 
@@ -114,8 +111,6 @@ int saveenv(void)
        ulong total;
        int ret = 0;
 
-       DECLARE_GLOBAL_DATA_PTR;
-
        env_ptr->flags++;
        total = CFG_ENV_SIZE;
 
@@ -174,8 +169,6 @@ void env_relocate_spec (void)
        int crc1_ok = 0, crc2_ok = 0;
        env_t *tmp_env1, *tmp_env2;
 
-       DECLARE_GLOBAL_DATA_PTR;
-
        total = CFG_ENV_SIZE;
 
        tmp_env1 = (env_t *) malloc(CFG_ENV_SIZE);
@@ -245,8 +238,6 @@ void env_relocate_spec (void)
 
 static void use_default()
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        puts ("*** Warning - bad CRC or NAND, using default environment\n\n");
 
        if (default_environment_size > CFG_ENV_SIZE){
index ee4237c7e906889fe6833baab2d8425a04b6d79d..17ecc775ff9bf0686a74b9926ee6c6438956dda8 100644 (file)
@@ -32,6 +32,8 @@
 #include <environment.h>
 #include <linux/stddef.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 env_t *env_ptr = NULL;
 
 extern uchar default_environment[];
@@ -44,8 +46,6 @@ void env_relocate_spec (void)
 
 uchar env_get_char_spec (int index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return ( *((uchar *)(gd->env_addr + index)) );
 }
 
@@ -56,8 +56,6 @@ uchar env_get_char_spec (int index)
  */
 int  env_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->env_addr  = (ulong)&default_environment[0];
        gd->env_valid = 0;
 
index a406e427a24e871f9ace82901483b434afd58272..7c18896cb04fa88b42ec92275547eacfa1d18406 100644 (file)
@@ -42,6 +42,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CFG_ENV_IS_IN_NVRAM /* Environment is in NVRAM */
 
 #include <command.h>
@@ -74,7 +76,6 @@ uchar env_get_char_spec (int index)
 
        return c;
 #else
-       DECLARE_GLOBAL_DATA_PTR;
        uchar retval;
        enable_nvram();
        retval = *((uchar *)(gd->env_addr + index));
@@ -92,8 +93,6 @@ uchar env_get_char_spec (int index)
 
        return c;
 #else
-       DECLARE_GLOBAL_DATA_PTR;
-
        return *((uchar *)(gd->env_addr + index));
 #endif
 }
@@ -135,7 +134,6 @@ int saveenv (void)
  */
 int env_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_AMIGAONEG3SE
        enable_nvram();
 #endif
index 9858217ae0c3db1b0e28df5be9b41a995b39f52a..ef253381697bad29490770936869e62e082fb237 100644 (file)
@@ -1,6 +1,8 @@
 #include <common.h>
 #include <exports.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static void dummy(void)
 {
 }
@@ -12,7 +14,6 @@ unsigned long get_version(void)
 
 void jumptable_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int i;
 
        gd->jt = (void **) malloc (XF_MAX * sizeof (void *));
index bb5041a08d872d93b04077fab9edadbd02fca12c..feb5627ff2eef282b16312cbccca13b208b7ed96 100644 (file)
@@ -138,6 +138,8 @@ extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);      /
 #endif
 
 #ifdef __U_BOOT__
+DECLARE_GLOBAL_DATA_PTR;
+
 #define EXIT_SUCCESS 0
 #define EOF -1
 #define syntax() syntax_err()
@@ -3272,7 +3274,6 @@ int parse_file_outer(void)
 #ifdef __U_BOOT__
 static void u_boot_hush_reloc(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned long addr;
        struct reserved_combo *r;
 
index e64972fd813a6e10ade52623140df65fa234249c..0be1912a359e56dfb1b1f63139e8633764793902 100644 (file)
@@ -50,7 +50,6 @@
 #include <lcdvideo.h>
 #endif
 
-
 #ifdef CONFIG_LCD
 
 /************************************************************************/
@@ -68,6 +67,8 @@
 # endif
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 ulong lcd_setmem (ulong addr);
 
 static void lcd_drawchars (ushort x, ushort y, uchar *str, int count);
@@ -339,8 +340,6 @@ static void test_pattern (void)
 
 int drv_lcd_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        device_t lcddev;
        int rc;
 
@@ -682,8 +681,6 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 static void *lcd_logo (void)
 {
 #ifdef CONFIG_LCD_INFO
-       DECLARE_GLOBAL_DATA_PTR;
-
        char info[80];
        char temp[32];
 #endif /* CONFIG_LCD_INFO */
index ed1b595b844d4c0012e6c5768778dde9580b967e..76a271b966d76a82140572c5108dcb726631a117 100644 (file)
 #if defined(CONFIG_LYNXKDI)
 #include <lynxkdi.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_MPC8260) || defined(CONFIG_440EP) || defined(CONFIG_440GR)
 void lynxkdi_boot ( image_header_t *hdr )
 {
        void (*lynxkdi)(void) = (void(*)(void)) ntohl(hdr->ih_ep);
        lynxos_bootparms_t *parms = (lynxos_bootparms_t *)0x0020;
        bd_t *kbd;
-       DECLARE_GLOBAL_DATA_PTR;
        u32 *psz = (u32 *)(ntohl(hdr->ih_load) + 0x0204);
 
        memset( parms, 0, sizeof(*parms));
index 445cb18491b0688eaad32a774583a5203ac1c21b..758ef8d32b2ba15d025bbf311d539c0b82e4fd6a 100644 (file)
 
 #include <post.h>
 
+#ifdef CONFIG_SILENT_CONSOLE
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 #if defined(CONFIG_BOOT_RETRY_TIME) && defined(CONFIG_RESET_TO_RETRY)
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);              /* for do_reset() prototype */
 #endif
@@ -105,14 +109,10 @@ static __inline__ int abortboot(int bootdelay)
        u_int i;
 
 #ifdef CONFIG_SILENT_CONSOLE
-       {
-               DECLARE_GLOBAL_DATA_PTR;
-
-               if (gd->flags & GD_FLG_SILENT) {
-                       /* Restore serial console */
-                       console_assign (stdout, "serial");
-                       console_assign (stderr, "serial");
-               }
+       if (gd->flags & GD_FLG_SILENT) {
+               /* Restore serial console */
+               console_assign (stdout, "serial");
+               console_assign (stderr, "serial");
        }
 #endif
 
@@ -195,17 +195,13 @@ static __inline__ int abortboot(int bootdelay)
 #  endif
 
 #ifdef CONFIG_SILENT_CONSOLE
-       {
-               DECLARE_GLOBAL_DATA_PTR;
-
-               if (abort) {
-                       /* permanently enable normal console output */
-                       gd->flags &= ~(GD_FLG_SILENT);
-               } else if (gd->flags & GD_FLG_SILENT) {
-                       /* Restore silent console */
-                       console_assign (stdout, "nulldev");
-                       console_assign (stderr, "nulldev");
-               }
+       if (abort) {
+               /* permanently enable normal console output */
+               gd->flags &= ~(GD_FLG_SILENT);
+       } else if (gd->flags & GD_FLG_SILENT) {
+               /* Restore silent console */
+               console_assign (stdout, "nulldev");
+               console_assign (stderr, "nulldev");
        }
 #endif
 
@@ -223,14 +219,10 @@ static __inline__ int abortboot(int bootdelay)
        int abort = 0;
 
 #ifdef CONFIG_SILENT_CONSOLE
-       {
-               DECLARE_GLOBAL_DATA_PTR;
-
-               if (gd->flags & GD_FLG_SILENT) {
-                       /* Restore serial console */
-                       console_assign (stdout, "serial");
-                       console_assign (stderr, "serial");
-               }
+       if (gd->flags & GD_FLG_SILENT) {
+               /* Restore serial console */
+               console_assign (stdout, "serial");
+               console_assign (stderr, "serial");
        }
 #endif
 
@@ -279,17 +271,13 @@ static __inline__ int abortboot(int bootdelay)
        putc ('\n');
 
 #ifdef CONFIG_SILENT_CONSOLE
-       {
-               DECLARE_GLOBAL_DATA_PTR;
-
-               if (abort) {
-                       /* permanently enable normal console output */
-                       gd->flags &= ~(GD_FLG_SILENT);
-               } else if (gd->flags & GD_FLG_SILENT) {
-                       /* Restore silent console */
-                       console_assign (stdout, "nulldev");
-                       console_assign (stderr, "nulldev");
-               }
+       if (abort) {
+               /* permanently enable normal console output */
+               gd->flags &= ~(GD_FLG_SILENT);
+       } else if (gd->flags & GD_FLG_SILENT) {
+               /* Restore silent console */
+               console_assign (stdout, "nulldev");
+               console_assign (stderr, "nulldev");
        }
 #endif
 
index 22d8fd0584febae96c2083a7bc6dc6d489488d4c..2acbd08b16d2c09c4f70c63e9894867ed0feba9c 100644 (file)
@@ -25,6 +25,8 @@
 #include <serial.h>
 #include <devices.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_SERIAL_MULTI)
 
 static struct serial_device *serial_devices = NULL;
@@ -49,8 +51,6 @@ struct serial_device *default_serial_console (void)
 
 static int serial_register (struct serial_device *dev)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        dev->init += gd->reloc_off;
        dev->setbrg += gd->reloc_off;
        dev->getc += gd->reloc_off;
@@ -131,8 +131,6 @@ void serial_reinit_all (void)
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (!(gd->flags & GD_FLG_RELOC) || !serial_current) {
                struct serial_device *dev = default_serial_console ();
 
@@ -144,8 +142,6 @@ int serial_init (void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (!(gd->flags & GD_FLG_RELOC) || !serial_current) {
                struct serial_device *dev = default_serial_console ();
 
@@ -158,8 +154,6 @@ void serial_setbrg (void)
 
 int serial_getc (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (!(gd->flags & GD_FLG_RELOC) || !serial_current) {
                struct serial_device *dev = default_serial_console ();
 
@@ -171,8 +165,6 @@ int serial_getc (void)
 
 int serial_tstc (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (!(gd->flags & GD_FLG_RELOC) || !serial_current) {
                struct serial_device *dev = default_serial_console ();
 
@@ -184,8 +176,6 @@ int serial_tstc (void)
 
 void serial_putc (const char c)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (!(gd->flags & GD_FLG_RELOC) || !serial_current) {
                struct serial_device *dev = default_serial_console ();
 
@@ -198,8 +188,6 @@ void serial_putc (const char c)
 
 void serial_puts (const char *s)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (!(gd->flags & GD_FLG_RELOC) || !serial_current) {
                struct serial_device *dev = default_serial_console ();
 
index b3642dafc24564b44b151db1e4f0cffd50b3473e..bffcd4405ec5bbe5d550ec471f6e5f4657bd33fa 100644 (file)
 
 /* #define     DEBUG_I2C       */
 
+#ifdef DEBUG_I2C
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 
 /*-----------------------------------------------------------------------
  * Definitions
@@ -53,7 +57,6 @@
 
 #ifdef DEBUG_I2C
 #define PRINTD(fmt,args...)    do {    \
-       DECLARE_GLOBAL_DATA_PTR;        \
        if (gd->have_console)           \
                printf (fmt ,##args);   \
        } while (0)
index 629ed66b07ec8769c2b96242475f75ec6c3d9994..706c880db1ea3a19f9edeada2ad14fe9a8269c09 100644 (file)
@@ -49,6 +49,8 @@
 #include "../board/MAI/AmigaOneG3SE/memio.h"
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 cpu_t
 get_cpu_type(void)
 {
@@ -111,8 +113,6 @@ get_cpu_type(void)
 #if !defined(CONFIG_BAB7xx)
 int checkcpu (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uint type   = get_cpu_type();
        uint pvr    = get_pvr();
        ulong clock = gd->cpu_clk;
@@ -258,8 +258,6 @@ do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 #ifdef CONFIG_AMIGAONEG3SE
 unsigned long get_tbclk(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return (gd->bus_clk / 4);
 }
 #else  /* ! CONFIG_AMIGAONEG3SE */
index f94ff78711a089f201055c59c580f874db97407e..2dc510746d69e2c678b45c6536143623138a8901 100644 (file)
@@ -29,6 +29,8 @@
 #include "../board/MAI/AmigaOneG3SE/via686.h"
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static const int hid1_multipliers_x_10[] = {
        25,     /* 0000 - 2.5x */
        75,     /* 0001 - 7.5x */
@@ -85,7 +87,6 @@ static const int hid1_fx_multipliers_x_10[] = {
 
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong clock = 0;
 
        /* calculate the clock frequency based upon the CPU type */
index ac5f8bfeb50df7d20593ccd472ab7fb57792d51d..50c5eeb4835802635bf1e0eec0fe880e2bfe0171 100644 (file)
 #include <command.h>
 #include <asm/processor.h>
 
+#ifdef CONFIG_AMIGAONEG3SE
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
@@ -58,9 +62,6 @@ extern unsigned long search_exception_table(unsigned long);
 void
 print_backtrace(unsigned long *sp)
 {
-#ifdef CONFIG_AMIGAONEG3SE
-       DECLARE_GLOBAL_DATA_PTR;
-#endif
        int cnt = 0;
        unsigned long i;
 
index 85a48491b35b7f68b9e09ec866989dd810bf3eb7..fa78eaa7f06816373982b6577ef935a306a28e4e 100644 (file)
 #include <asm/arch/omap2420.h>
 #endif
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /* read co-processor 15, register #1 (control register) */
 static unsigned long read_p15_c1 (void)
 {
@@ -88,8 +92,6 @@ int cpu_init (void)
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index 0f9997950875551e445faacf1a49da1bcdaa410f..054bab98112f194c62da23741887e0e1b9bfd502 100644 (file)
 
 #include <clps7111.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned int reg = 0;
 
        switch (gd->baudrate) {
index 5ad98f06fdb8c0b29bdf6d4c8fcf988aa6df94f6..bc6bf30b69e920e2aac5d47b3c8e8282efbfac42 100644 (file)
@@ -34,6 +34,8 @@
 
 #include <asm/hardware.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define PORTA  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTA))
 #if !defined(CONFIG_NETARM_NS7520)
 #define PORTB  (*(volatile unsigned int *)(NETARM_GEN_MODULE_BASE + NETARM_GEN_PORTB))
@@ -67,9 +69,6 @@ extern void _netarm_led_FAIL1(void);
  */
 void serial_setbrg (void)
 {
-       /* get the gd pointer */
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* set 0 ... make sure pins are configured for serial */
 #if !defined(CONFIG_NETARM_NS7520)
        PORTA = PORTB =
index a281932b77d05500358cb20172e5539c6d88d93d..d5634454927591eb4b3e52a4d9499b8988fff7ec 100644 (file)
@@ -33,6 +33,8 @@
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if !defined(CONFIG_DBGU) && !defined(CONFIG_USART0) && !defined(CONFIG_USART1)
 #error must define one of CONFIG_DBGU or CONFIG_USART0 or CONFIG_USART1
 #endif
@@ -50,7 +52,6 @@ AT91PS_USART us = (AT91PS_USART) AT91C_BASE_US1;
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int baudrate;
 
        if ((baudrate = gd->baudrate) <= 0)
index 2f7963dcf6640ccc275d92d9784fda91c20eed52..f93bf57e2b47fe6a79be27372e039d726e0ed5ef 100644 (file)
 #include <command.h>
 #include <arm920t.h>
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /* read co-processor 15, register #1 (control register) */
 static unsigned long read_p15_c1 (void)
 {
@@ -91,8 +95,6 @@ int cpu_init (void)
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index 0dd91e7dd0eed14a31cd4bfa317f1727e6f3897e..aacd1be630b1800303f1b4cae793bd0bb9b58ef8 100644 (file)
@@ -25,6 +25,8 @@
 #error "Bad: you didn't configure serial ..."
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  *     Define the UART hardware register access structure.
  */
@@ -54,7 +56,6 @@ int serial_console = 1;
 
 void serial_setbrg(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile struct ks8695uart *uartp = KS8695_UART_ADDR;
 
        /* Set to global baud rate and 8 data bits, no parity, 1 stop bit*/
index 83274432e4b1c72e4e553786be2328b098e94d9f..36851ad5ca86dcb95833ceb509b24d56bfebc4e5 100644 (file)
@@ -27,6 +27,8 @@
 #include <s3c2410.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_SERIAL1
 #define UART_NR        S3C24X0_UART0
 
@@ -48,7 +50,6 @@
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        S3C24X0_UART * const uart = S3C24X0_GetBase_UART(UART_NR);
        int i;
        unsigned int reg = 0;
index c1c6b03e4245dfe872b024cf82487435fbd7fcab..d85b7fad39ed378cb73fc71edfe90d7eab282af6 100644 (file)
 #include <command.h>
 #include <arm925t.h>
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /* read co-processor 15, register #1 (control register) */
 static unsigned long read_p15_c1 (void)
 {
@@ -91,8 +95,6 @@ int cpu_init (void)
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index f57c5a5d89513098a39a86044cf2ab987388bbae..722732e589b4d225a3e38aaae3514de4aec3753e 100644 (file)
 #include <command.h>
 #include <arm926ejs.h>
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /* read co-processor 15, register #1 (control register) */
 static unsigned long read_p15_c1 (void)
 {
@@ -91,8 +95,6 @@ int cpu_init (void)
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index ba0a4e496e2e194c1b43d7b83ac0982416f2393f..4c63a8dd87fefd0d77edc50f460a550d43bc0d0f 100644 (file)
 #include <command.h>
 #include <arm946es.h>
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /* read co-processor 15, register #1 (control register) */
 static unsigned long read_p15_c1 (void)
 {
@@ -91,8 +95,6 @@ int cpu_init (void)
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index d03b09dad81fb0f57ec0b3cf66a9661794cd8001..e2309f8898babbf28d874e0acf4f0ff65f8bd0af 100644 (file)
 #include <common.h>
 #include <command.h>
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 int cpu_init (void)
 {
        /*
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index 84ae9d9cde69cb58e754c3e945c060fbca3c44f3..7b43ffd18816db04644a2f9cace6a932f3b554c4 100644 (file)
@@ -51,6 +51,8 @@
 #include <asm/uaccess.h>
 #include "bf533_serial.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 unsigned long pll_div_fact;
 
 void calc_baud(void)
@@ -72,7 +74,6 @@ void calc_baud(void)
 void serial_setbrg(void)
 {
        int i;
-       DECLARE_GLOBAL_DATA_PTR;
 
        calc_baud();
 
index 689e775c938160a7747d2b51f3d1adb37275ad33..c83f0bb6cf3cfc2cf1e6d6f0f84533c824c15228 100644 (file)
@@ -36,6 +36,8 @@
 #include <asm/pci.h>
 #include <asm/ic/sc520.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * utility functions for boards based on the AMD sc520
  *
@@ -93,8 +95,6 @@ u32 read_mmcr_long(u16 mmcr)
 
 void init_sc520(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Set the UARTxCTL register at it's slower,
         * baud clock giving us a 1.8432 MHz reference
         */
@@ -139,7 +139,6 @@ void init_sc520(void)
 
 unsigned long init_sc520_dram(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        bd_t *bd = gd->bd;
 
        u32 dram_present=0;
index db13008ba5b4adf5220576dfde94ee6e97ede36f..e7299a7ebb0ea1d44955edcfa591633690935e6d 100644 (file)
@@ -55,6 +55,8 @@
 #include <malloc.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define UART_RBR    0x00
 #define UART_THR    0x00
 #define UART_IER    0x01
@@ -126,13 +128,9 @@ static int serial_div(int baudrate)
 
 int serial_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile char val;
-
        int bdiv = serial_div(gd->baudrate);
 
-
        outb(0x80, UART0_BASE + UART_LCR);      /* set DLAB bit */
        outb(bdiv, UART0_BASE + UART_DLL);      /* set baudrate divisor */
        outb(bdiv >> 8, UART0_BASE + UART_DLM);/* set baudrate divisor */
@@ -150,8 +148,6 @@ int serial_init(void)
 
 void serial_setbrg(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned short bdiv;
 
        bdiv = serial_div(gd->baudrate);
@@ -410,8 +406,6 @@ int serial_buffered_tstc(void)
 #if (CONFIG_KGDB_SER_INDEX & 2)
 void kgdb_serial_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile char val;
        bdiv = serial_div (CONFIG_KGDB_BAUDRATE);
 
index 9383473141a536b2d78a523f7a694d914db36b1d..2a2bd504dc468869ee32a018c4935ff98005a5f7 100644 (file)
 #include <command.h>
 #include <asm/arch/ixp425.h>
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 int cpu_init (void)
 {
        /*
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index aea0cf86966dba31f4ad4bc46a400649bfea255e..2015958571423aa5705e46b8525bcc2309b841c1 100644 (file)
 #include <common.h>
 #include <asm/arch/ixp425.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned int quot = 0;
        int uart = CFG_IXP425_CONSOLE;
 
index 718f253471d40e30935b994b631eececc4e6e523..578eb73e8e014e74c54ca7c25d8417fe5e7853cc 100644 (file)
 #include <command.h>
 #include <arm920t.h>
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /* read co-processor 15, register #1 (control register) */
 static unsigned long read_p15_c1 (void)
 {
@@ -90,8 +94,6 @@ int cpu_init (void)
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index ff5b2d8c084cc21f9689760ef9b6ea2947e66fce..2132c052a4e1a3b372751a91c1793fa2ba51dc80 100644 (file)
@@ -21,6 +21,8 @@
 #include <common.h>
 #include <lh7a40x.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_CONSOLE_UART1)
 # define UART_CONSOLE 1
 #elif defined(CONFIG_CONSOLE_UART2)
@@ -33,7 +35,6 @@
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        lh7a40x_uart_t* uart = LH7A40X_UART_PTR(UART_CONSOLE);
        int i;
        unsigned int reg = 0;
index c7309220f10b40a63867be88640c1bf455a51080..79628d03e60c41fb124e44188cbc2768407b320e 100644 (file)
@@ -38,6 +38,8 @@
 #include <asm/m5249.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_M5249
 #define DoubleClock(a) ((double)(CFG_CLK/2) / 32.0 / (double)(a))
 #else
@@ -134,12 +136,10 @@ int rs_get_char(void)
 }
 
 void serial_setbrg(void) {
-       DECLARE_GLOBAL_DATA_PTR;
        rs_serial_setbaudrate(0,gd->bd->bi_baudrate);
 }
 
 int serial_init(void) {
-       DECLARE_GLOBAL_DATA_PTR;
        rs_serial_init(0,gd->baudrate);
        return 0;
 }
index 519c99258132f97e192c6df8eb4308781ff0dcb6..ac860b2c673c31fce5c6e31631d0b7876ca241e9 100644 (file)
 #include <common.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * get_clocks() fills in gd->cpu_clock and gd->bus_clk
  */
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->cpu_clk = CFG_CLK;
 #ifdef CONFIG_M5249
        gd->bus_clk = gd->cpu_clk / 2;
index 0c22a31f0de433b44d69814c79321a8e2e78c1cc..4bef90c48ad97755ce644736a31d1054df0baf6f 100644 (file)
@@ -34,6 +34,7 @@
 #include <command.h>
 #include <mpc5xx.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 #if (defined(CONFIG_MPC555))
 #  define      ID_STR  "MPC555/556"
@@ -62,8 +63,6 @@ static int check_cpu_version (long clock, uint pvr, uint immr)
  */
 int checkcpu (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong clock = gd->cpu_clk;
        uint immr = get_immr (0);       /* Return full IMMR contents */
        uint pvr = get_pvr ();          /* Retrieve PVR register */
@@ -104,7 +103,6 @@ void reset_5xx_watchdog (volatile immap_t * immr)
  */
 unsigned long get_tbclk (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t *immr = (volatile immap_t *) CFG_IMMR;
        ulong oscclk, factor;
 
index 48687829e5aaa067e21115f84914c51bd6992c7a..ac5556f05cd5837f86acda0bdf8bf534c34e0dfb 100644 (file)
@@ -34,6 +34,7 @@
 #include <command.h>
 #include <mpc5xx.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Local function prototypes
@@ -128,7 +129,6 @@ int serial_tstc()
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        short scxbr;
 
index f6097f5c1347265dfa0373b21b6f8e46b4a731a9..6a1fa155e298ab24db7322eb605007e54d35213a 100644 (file)
 #include <mpc5xx.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Get cpu and bus clock
  */
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t *immr = (immap_t *) CFG_IMMR;
 
 #ifndef        CONFIG_5xx_GCLK_FREQ
index 2d695d12eb1025e337d07e96de9219cf0e61632b..563d5af3138c6a7aeefa9e81ba3eb720bf74d6fb 100644 (file)
 #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;
index 3df005009ebca12113549a355db5c983e2d11f91..4a370ffea94c568f66c8527fc8693b01f823ebb7 100644 (file)
@@ -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 */
index 2e8e54958f131bf18d111c5a8bec1f3ca3fe8f50..19737ce868dd32a84b266ce04416fdd86ced1674 100644 (file)
@@ -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 */
 
index 044db46f6fb43676627c835ba844871a6e5a89d7..0f02e78a3bd3e25d04459b50c0b36c5d0e79cdc1 100644 (file)
@@ -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) {
index 1af794c6ecac6ae8bdeb1ee8bbf4d7e688306ca6..29b99f6b15ddada936f3b3226dfdddf0e2d5098d 100644 (file)
@@ -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;
index 91e1def98cb3c33670126932230839446732680c..cacb9f057335c855145d185dab1e0cf7e3a9811e 100644 (file)
@@ -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;
 
index 4f4e814e94d64b3b18a070a819d4df1c982135b8..7847adcefa40f4258e0e846ff7ed4d1f143b38d6 100644 (file)
@@ -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);
index 0cfe8089b8a8abb101cce2875f396a369a6f2183..be274cde9e0dc31200bb19dad9fbf755fda2a3cb 100644 (file)
 #include <mpc8220.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkcpu (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong clock = gd->cpu_clk;
        char buf[32];
 
@@ -81,8 +81,6 @@ int 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;
index 8c358a870cef1250c39ec8a5487859c71a2af182..3cf5f66a13006554524e95601569d557489a8803 100644 (file)
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <mpc8220.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Breath some life into the CPU...
  *
@@ -32,8 +34,6 @@
  */
 void cpu_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile flexbus8220_t *flexbus = (volatile flexbus8220_t *) MMAP_FB;
        volatile pcfg8220_t *portcfg = (volatile pcfg8220_t *) MMAP_PCFG;
        volatile xlbarb8220_t *xlbarb = (volatile xlbarb8220_t *) MMAP_XLBARB;
index 1d0d384722e8c0aaea87ee7b4a39ba91f2039ad4..08e3172f2bf2a140e1c36f4672c7265d5f7f95f1 100644 (file)
@@ -32,6 +32,8 @@ characteristics to initialize the dram on MPC8220
 #include "i2cCore.h"
 #include "dramSetup.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define SPD_SIZE       CFG_SDRAM_SPD_SIZE
 #define DRAM_SPD       (CFG_SDRAM_SPD_I2C_ADDR)<<1     /* on Board SPD eeprom */
 #define TOTAL_BANK     CFG_SDRAM_TOTAL_BANKS
@@ -91,8 +93,6 @@ int spd_readbyte (volatile i2c8220_t * pi2c, u8 * readb, int *index)
 
 int readSpdData (u8 * spdData)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile i2c8220_t *pi2cReg;
        volatile pcfg8220_t *pcfg;
        u8 slvAdr = DRAM_SPD;
@@ -403,8 +403,6 @@ u8 checkMuxSetting (u8 rows, u8 columns)
 
 u32 dramSetup (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        draminfo_t DramInfo[TOTAL_BANK];
        draminfo_t *pDramInfo;
        u32 size, temp, cfg_value, mode_value, refresh;
index 62f7c0f5d330df815284ca99031017880c66273c..d67936dc31c2f3b7a11242f506823015d134115b 100644 (file)
@@ -23,6 +23,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_HARD_I2C
 
 #include <mpc8220.h>
@@ -235,7 +237,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) {
index 8346efe12e9f1ac58a7f08814fe13c1e62867f07..200a762711ec25c40a94eca8a1f1ea07835d5121 100644 (file)
@@ -25,6 +25,8 @@
 #include <mpc8220.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 typedef struct pllmultiplier {
        u8 hid1;
        int multi;
@@ -39,8 +41,6 @@ typedef struct pllmultiplier {
 
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        pllcfg_t bus2core[] = {
                {0x02, 2, 8},   /* 1 */
                {0x01, 2, 4},
@@ -109,8 +109,6 @@ int get_clocks (void)
 
 int prt_mpc8220_clks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        printf ("       Bus %ld MHz, CPU %ld MHz, PCI %ld MHz, VCO %ld MHz\n",
                gd->bus_clk / 1000000, gd->cpu_clk / 1000000,
                gd->pci_clk / 1000000, gd->vco_clk / 1000000);
index 5f54aac16ef3d88c5d4f1d9c50047ac8919e2b67..0c4b536b48e7a09bdce55741abf20ba20b339a5a 100644 (file)
 #include <common.h>
 #include <mpc8220.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define PSC_BASE   MMAP_PSC1
 
 #if defined(CONFIG_PSC_CONSOLE)
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile psc8220_t *psc = (psc8220_t *) PSC_BASE;
        u32 counter;
 
@@ -106,8 +107,6 @@ int serial_tstc (void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile psc8220_t *psc = (psc8220_t *) PSC_BASE;
        u32 counter;
 
index 312dfe22966abf1e7cbf39d25194285494f0c438..0a45cc8419f610544969abd7600d85f033d09c8e 100644 (file)
 #include <common.h>
 #include <command.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkcpu (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned int pvr = get_pvr ();
        unsigned int version = pvr >> 16;
        unsigned char revision;
index a37a087af12ab2bb1131e8c38ff60470b43c372d..fdcb9723cbd8817675d700e266a8812e50a5b6b9 100644 (file)
@@ -29,6 +29,8 @@
 #include <mpc824x.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 /* NOTE: This describes the proper use of this file.
  *
@@ -107,8 +109,6 @@ short pllratio_to_factor[] = {
 /* compute the CPU and memory bus clock frequencies */
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uint hid1 = mfspr(HID1);
        hid1 = (hid1 >> (32-5)) & 0x1f;
        gd->cpu_clk = (pllratio_to_factor[hid1] * get_bus_freq(0) + 5)
index e5c5fcf27b97df40f76af5cd5496fa645d42ef88..8777e773698c0addaf5681e98f603f22c2e99b13 100644 (file)
 #include <common.h>
 #include <asm/cpm_8260.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void
 m8260_cpm_reset(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        volatile ulong count;
 
@@ -54,8 +54,6 @@ m8260_cpm_reset(void)
 uint
 m8260_cpm_dpalloc(uint size, uint align)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        uint    retloc;
        uint    align_mask, off;
@@ -112,8 +110,6 @@ m8260_cpm_hostalloc(uint size, uint align)
 void
 m8260_cpm_setbrg(uint brg, uint rate)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        volatile uint   *bp;
        uint cd = BRG_UART_CLK / rate;
@@ -137,8 +133,6 @@ m8260_cpm_setbrg(uint brg, uint rate)
 void
 m8260_cpm_fastbrg(uint brg, uint rate, int div16)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        volatile uint   *bp;
 
index 5d979330a3da7fd9713a0f4166188788e85b2b77..4f23012b729420ba74ce64dc4cb65d24cb73385e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2000-2003
+ * (C) Copyright 2000-2006
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
 #include <asm/processor.h>
 #include <asm/cpm_8260.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkcpu (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
        ulong clock = gd->cpu_clk;
        uint pvr = get_pvr ();
@@ -264,8 +264,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;
index babcce4e9b104c6604843a3d28e0fc01acd38721..640026be5ac5d3c7aeec413de63f2a6ca87c4f9c 100644 (file)
@@ -26,6 +26,8 @@
 #include <asm/cpm_8260.h>
 #include <ioports.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static void config_8260_ioports (volatile immap_t * immr)
 {
        int portnum;
@@ -97,7 +99,6 @@ static void config_8260_ioports (volatile immap_t * immr)
  */
 void cpu_init_f (volatile immap_t * immr)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #if !defined(CONFIG_COGENT)            /* done in start.S for the cogent */
        uint sccr;
 #endif
@@ -222,8 +223,6 @@ void cpu_init_f (volatile immap_t * immr)
  */
 int cpu_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *) gd->bd->bi_immr_base;
 
        immr->im_cpm.cp_rccr = CFG_RCCR;
@@ -236,8 +235,6 @@ int cpu_init_r (void)
  */
 int prt_8260_rsr (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        static struct {
                ulong mask;
                char *desc;
index ed3515fcf316bde3fd9bba21d398512ff518de9f..584c40f17a174ace235fe4178787013589e98e17 100644 (file)
@@ -51,6 +51,8 @@
 #include <miiphy.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_ETHER_ON_FCC) && (CONFIG_COMMANDS & CFG_CMD_NET) && \
        defined(CONFIG_NET_MULTI)
 
@@ -644,8 +646,6 @@ swap16 (unsigned short x)
 void
 eth_loopback_test (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        volatile cpm8260_t *cp = &(immr->im_cpm);
        int c, nclosed;
index ea97ab85fbc091944b6c4a7707dfa253778751d5..34bd3897f6d8fe302614dd002426345d37bac081 100644 (file)
@@ -34,6 +34,8 @@
 /* define to enable debug messages */
 #undef  DEBUG_I2C
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* uSec to wait between polls of the i2c */
 #define DELAY_US       100
 /* uSec to wait for the CPM to start processing the buffer */
@@ -213,8 +215,6 @@ static int i2c_setrate(int hz, int speed)
 
 void i2c_init(int speed, int slaveadd)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immap = (immap_t *)CFG_IMMR ;
        volatile cpm8260_t *cp = (cpm8260_t *)&immap->im_cpm;
        volatile i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c;
index b2e4d839245813d9b8a4759ff70578ed724eb10e..56e9a721373f3245b3409d9ef001575e14e756e2 100644 (file)
@@ -29,6 +29,8 @@
 #include <mpc8260_irq.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /****************************************************************************/
 
 struct irq_action {
@@ -140,8 +142,6 @@ static int m8260_get_irq (struct pt_regs *regs)
 
 int interrupt_init_cpu (unsigned *decrementer_count)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *) CFG_IMMR;
 
        *decrementer_count = (gd->bus_clk / 4) / CFG_HZ;
index 44576deb61d8a8ed84b8271a3640380473210d75..ea5514fb123414df4dea295c41fde13d98b84b45 100644 (file)
 #include <mpc8260.h>
 #include <asm/m8260_pci.h>
 #include <asm/io.h>
+
+#if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /*
  *   Local->PCI map (from CPU)                            controlled by
  *   MPC826x master window
@@ -234,9 +239,6 @@ static inline void pci_outl (u32 addr, u32 data)
 
 void pci_mpc8250_init (struct pci_controller *hose)
 {
-#if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272
-       DECLARE_GLOBAL_DATA_PTR;
-#endif
        u16 tempShort;
 
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
index 32016f2f9108f9c45c0e2aef7b17441124d52720..3a6eaf0a6775647c5334181aa56645acf66883e3 100644 (file)
@@ -32,6 +32,8 @@
 #include <mpc8260.h>
 #include <asm/cpm_8260.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_CONS_ON_SCC)
 
 #if CONFIG_CONS_INDEX == 1     /* Console on SCC1 */
@@ -181,8 +183,6 @@ int serial_init (void)
 void
 serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_CONS_USE_EXTC)
        m8260_cpm_extcbrg(SCC_INDEX, gd->baudrate,
                CONFIG_CONS_EXTC_RATE, CONFIG_CONS_EXTC_PINSEL);
index b486f8385e3cd38d0d1046f261556d78c8d024fd..f3dffeb11993d81c70aeccb0199b841a75d3613a 100644 (file)
@@ -34,6 +34,8 @@
 #include <mpc8260.h>
 #include <asm/cpm_8260.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_CONS_ON_SMC)
 
 #if CONFIG_CONS_INDEX == 1     /* Console on SMC1 */
@@ -170,8 +172,6 @@ int serial_init (void)
 void
 serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_CONS_USE_EXTC)
        m8260_cpm_extcbrg(brg_map[SMC_INDEX], gd->baudrate,
                CONFIG_CONS_EXTC_RATE, CONFIG_CONS_EXTC_PINSEL);
index 99afe7609f7721058c62bddbf25ed416d032c292..360404f0cfd444807fe1a98a5c4d23f72fa948d9 100644 (file)
@@ -25,6 +25,8 @@
 #include <mpc8260.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 
 /* Bus-to-Core Multiplier */
@@ -101,8 +103,6 @@ corecnf_t corecnf_tab[] = {
 
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
        ulong clkin;
        ulong sccr, dfbrg;
@@ -159,8 +159,6 @@ int get_clocks (void)
 
 int prt_8260_clks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
        ulong sccr, dfbrg;
        ulong scmr, corecnf, busdf, cpmdf, plldf, pllmf, pcidf;
index f24d3a4b1cd95eec0884111238bd2a467bf6cc35..7ca1cebc049c1286d36cf076fd4c903e06fbe2e5 100644 (file)
 #include <ft_build.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 
 int checkcpu(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong clock = gd->cpu_clk;
        u32 pvr = get_pvr();
        char buf[32];
@@ -138,8 +139,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;
index acf6862990f2b4119b318954e620bb104bba4d56..6ed0992c070bf1bb9676bc6602773399d50e73ee 100644 (file)
@@ -29,6 +29,8 @@
 #include <mpc83xx.h>
 #include <ioports.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Breathe some life into the CPU...
  *
@@ -38,8 +40,6 @@
  */
 void cpu_init_f (volatile immap_t * im)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Pointer is writable since we allocated a register for it */
        gd = (gd_t *) (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET);
 
index dfd51c15fe05bf07f6ffb7783b2fb0e035329ecc..5a0babfcbb994348087feffad744ceff0dd1a0cd 100644 (file)
@@ -35,6 +35,8 @@
 #include <mpc83xx.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 struct irq_action {
        interrupt_handler_t *handler;
        void *arg;
@@ -43,8 +45,6 @@ struct irq_action {
 
 int interrupt_init_cpu (unsigned *decrementer_count)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *) CFG_IMMRBAR;
 
        *decrementer_count = (gd->bus_clk / 4) / CFG_HZ;
index 1368fc3feaf5be720e5c852aa31d8c502fd6a285..ad6b3f669fb38c77cda40e491c66e3370f0e5c5b 100644 (file)
@@ -32,6 +32,8 @@
 #include <mpc83xx.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ----------------------------------------------------------------- */
 
 typedef enum {
@@ -92,7 +94,6 @@ corecnf_t corecnf_tab[] = {
  */
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t *im = (immap_t *)CFG_IMMRBAR;
        u32 pci_sync_in;
        u8  spmf;
@@ -342,14 +343,11 @@ int get_clocks (void)
  *********************************************/
 ulong get_bus_freq (ulong dummy)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        return gd->csb_clk;
 }
 
 int print_clock_conf (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        printf("Clock configuration:\n");
        printf("  Coherent System Bus: %4d MHz\n",gd->csb_clk/1000000);
        printf("  Core:                %4d MHz\n",gd->core_clk/1000000);
index c7a56386e8e1e8a8f7658dd58d13c06df65c6bf3..44345afbfaa447aba717f585124aa9ca2cdab075 100644 (file)
@@ -40,6 +40,8 @@
 #include <asm/processor.h>
 #include <asm/mpc8349_pci.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Returns 0 if exception not found and fixup otherwise.  */
 extern unsigned long search_exception_table(unsigned long);
 
@@ -52,7 +54,6 @@ extern unsigned long search_exception_table(unsigned long);
 void
 print_backtrace(unsigned long *sp)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int cnt = 0;
        unsigned long i;
 
index aa8a5a57ba82ce7d1e141e51f47360020427ce9d..3504d50caed847a93224080de67c9b40cecbaa2b 100644 (file)
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <asm/cpm_85xx.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_CPM2)
 /*
  * because we have stack and init data in dual port ram
@@ -35,8 +37,6 @@
 void
 m8560_cpm_reset(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        volatile ulong count;
 
@@ -64,8 +64,6 @@ m8560_cpm_reset(void)
 uint
 m8560_cpm_dpalloc(uint size, uint align)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        uint    retloc;
        uint    align_mask, off;
@@ -122,8 +120,6 @@ m8560_cpm_hostalloc(uint size, uint align)
 void
 m8560_cpm_setbrg(uint brg, uint rate)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        volatile uint   *bp;
 
@@ -146,8 +142,6 @@ m8560_cpm_setbrg(uint brg, uint rate)
 void
 m8560_cpm_fastbrg(uint brg, uint rate, int div16)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        volatile uint   *bp;
 
index efde9cc31abe40f792672c6da10313fd4cd88679..c12b47b589d8795c657d559dd40dcb7257c25f40 100644 (file)
@@ -30,6 +30,8 @@
 #include <ioports.h>
 #include <asm/io.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_CPM2
 static void config_8560_ioports (volatile immap_t * immr)
 {
@@ -103,7 +105,6 @@ static void config_8560_ioports (volatile immap_t * immr)
 
 void cpu_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t    *immap = (immap_t *)CFG_IMMR;
        volatile ccsr_lbc_t *memctl = &immap->im_lbc;
        extern void m8560_cpm_reset (void);
index cf060d68901d5186b668f24423ab4f94cd404d4c..4e925f8bea2d6464dc2f60fd16881ec1976ff894 100644 (file)
@@ -35,6 +35,8 @@
 #include <common.h>
 #include <asm/cpm_85xx.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_CPM2)
 #if defined(CONFIG_CONS_ON_SCC)
 
@@ -186,8 +188,6 @@ int serial_init (void)
 void
 serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_CONS_USE_EXTC)
        m8560_cpm_extcbrg(SCC_INDEX, gd->baudrate,
                CONFIG_CONS_EXTC_RATE, CONFIG_CONS_EXTC_PINSEL);
index d736742f6225749515d13cbe1fb5d507dba7f778..ca81ee73521a695cf19a7ae54fa457f29c288717 100644 (file)
@@ -29,6 +29,8 @@
 #include <ppc_asm.tmpl>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* --------------------------------------------------------------- */
 
 void get_sys_info (sys_info_t * sysInfo)
@@ -80,7 +82,6 @@ void get_sys_info (sys_info_t * sysInfo)
 
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        sys_info_t sys_info;
 #if defined(CONFIG_CPM2)
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
index a87eed2ad100fb937850196470b326b95f4b99fe..904f0523396d631a0aa8de698da0b4b6d1ba0cfc 100644 (file)
@@ -39,6 +39,8 @@
 #include <command.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
@@ -83,7 +85,6 @@ extern void do_bedbug_breakpoint(struct pt_regs *);
 void
 print_backtrace(unsigned long *sp)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int cnt = 0;
        unsigned long i;
 
index 75740e07f2bd00ef78071c6d5568bf7e89748f13..07c763cfde9061b76829ef976e902f1c8e4c657b 100644 (file)
 #include <common.h>
 #include <commproc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CFG_ALLOC_DPRAM
 
 int dpram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Reclaim the DP memory for our use. */
        gd->dp_alloc_base = CPM_DATAONLY_BASE;
        gd->dp_alloc_top  = CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE;
@@ -43,7 +43,6 @@ int dpram_init (void)
  */
 uint dpram_alloc (uint size)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        uint addr = gd->dp_alloc_base;
 
        if ((gd->dp_alloc_base + size) >= gd->dp_alloc_top)
@@ -56,8 +55,6 @@ uint dpram_alloc (uint size)
 
 uint dpram_base (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return gd->dp_alloc_base;
 }
 
@@ -67,8 +64,6 @@ uint dpram_base (void)
  */
 uint dpram_alloc_align (uint size, uint align)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uint addr, mask = align - 1;
 
        addr = (gd->dp_alloc_base + mask) & ~mask;
@@ -83,8 +78,6 @@ uint dpram_alloc_align (uint size, uint align)
 
 uint dpram_base_align (uint align)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uint mask = align - 1;
 
        return (gd->dp_alloc_base + mask) & ~mask;
index c4a0cba13a6e1a41ac1f0653d7185af9c81d466f..97112f03daf168b7a311d1af7a91a34a05c08ce4 100644 (file)
@@ -39,6 +39,8 @@
 #include <mpc8xx.h>
 #include <asm/cache.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static char *cpu_warning = "\n         " \
        "*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***";
 
@@ -349,8 +351,6 @@ static int check_CPU (long clock, uint pvr, uint immr)
 
 int checkcpu (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong clock = gd->cpu_clk;
        uint immr = get_immr (0);       /* Return full IMMR contents */
        uint pvr = get_pvr ();
@@ -539,8 +539,6 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  */
 unsigned long get_tbclk (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uint immr = get_immr (0);       /* Return full IMMR contents */
        volatile immap_t *immap = (volatile immap_t *)(immr & 0xFFFF0000);
        ulong oscclk, factor, pll;
index b2c59c6f57b6dc857fde02288764a65b37f9cc2c..1a7111fb2a69462a7a340631ff7d3462dc59eb0a 100644 (file)
 #include <mpc8xx.h>
 #include <commproc.h>
 
+#if defined(CFG_RTCSC) || defined(CFG_RMDS)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 #if defined(CFG_I2C_UCODE_PATCH) || defined(CFG_SPI_UCODE_PATCH)
 void cpm_load_patch (volatile immap_t * immr);
 #endif
@@ -259,8 +263,6 @@ void cpu_init_f (volatile immap_t * immr)
 int cpu_init_r (void)
 {
 #if defined(CFG_RTCSC) || defined(CFG_RMDS)
-       DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd = gd->bd;
        volatile immap_t *immr = (volatile immap_t *) (bd->bi_immr_base);
 #endif
index d2f5d888440b215ec67e9709d09d6ac27d38af54..6006478f97ca9926c24e8a2a94ab6e3ab8cc8225 100644 (file)
@@ -27,6 +27,8 @@
 #include <net.h>
 #include <command.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef ET_DEBUG
 
 #if (CONFIG_COMMANDS & CFG_CMD_NET) && \
@@ -371,7 +373,6 @@ static inline void fec_half_duplex(struct eth_device *dev)
 
 static void fec_pin_init(int fecidx)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        bd_t           *bd = gd->bd;
        volatile immap_t *immr = (immap_t *) CFG_IMMR;
        volatile fec_t *fecp;
index 682db53edb10d9807e015f03b717682087fe308b..6c59374e3fbbaad843d2d39b41ff8f37418f5637 100644 (file)
@@ -37,6 +37,8 @@
 #include <watchdog.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* define to enable debug messages */
 #undef DEBUG_I2C
 
@@ -205,8 +207,6 @@ i2c_setrate (int hz, int speed)
 void
 i2c_init(int speed, int slaveaddr)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immap = (immap_t *)CFG_IMMR ;
        volatile cpm8xx_t *cp = (cpm8xx_t *)&immap->im_cpm;
        volatile i2c8xx_t *i2c  = (i2c8xx_t *)&immap->im_i2c;
@@ -615,8 +615,6 @@ int i2c_probe(uchar chip)
 
 int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        i2c_state_t state;
        uchar xaddr[4];
        int rc;
@@ -671,8 +669,6 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
 
 int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        i2c_state_t state;
        uchar xaddr[4];
        int rc;
index fa0405f198da8e69165cc24323e4fcde22f35c74..26a82cc2405399c19bbdd691ac5955f3f02ce4b6 100644 (file)
@@ -27,6 +27,8 @@
 #include <serial.h>
 #include <watchdog.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if !defined(CONFIG_8xx_CONS_NONE)     /* No Console at all */
 
 #if defined(CONFIG_8xx_CONS_SMC1)      /* Console on SMC1 */
@@ -65,7 +67,6 @@
 
 static void serial_setdivisor(volatile cpm8xx_t *cp)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int divisor=(gd->cpu_clk + 8*gd->baudrate)/16/gd->baudrate;
 
        if(divisor/16>0x1000) {
@@ -268,8 +269,6 @@ smc_putc(const char c)
        volatile cpm8xx_t       *cpmp = &(im->im_cpm);
 
 #ifdef CONFIG_MODEM_SUPPORT
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (gd->be_quiet)
                return;
 #endif
@@ -553,8 +552,6 @@ scc_putc(const char c)
        volatile cpm8xx_t       *cpmp = &(im->im_cpm);
 
 #ifdef CONFIG_MODEM_SUPPORT
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (gd->be_quiet)
                return;
 #endif
@@ -649,13 +646,11 @@ struct serial_device serial_scc_device =
 #ifdef CONFIG_MODEM_SUPPORT
 void disable_putc(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        gd->be_quiet = 1;
 }
 
 void enable_putc(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        gd->be_quiet = 0;
 }
 #endif
index f03831617c1f24e316e49e182498e9c0c466e0ec..57f91c0aa049cee3efbf5459203ea49d2eab3ae2 100644 (file)
@@ -25,6 +25,8 @@
 #include <mpc8xx.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if !defined(CONFIG_8xx_CPUCLK_DEFAULT) || defined(CFG_MEASURE_CPUCLK) || defined(DEBUG)
 
 #define PITC_SHIFT 16
@@ -181,8 +183,6 @@ unsigned long measure_gclk(void)
  */
 int get_clocks (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uint immr = get_immr (0);       /* Return full IMMR contents */
        volatile immap_t *immap = (immap_t *) (immr & 0xFFFF0000);
        uint sccr = immap->im_clkrst.car_sccr;
@@ -238,8 +238,6 @@ static long init_pll_866 (long clk);
  */
 int get_clocks_866 (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *) CFG_IMMR;
        char              tmp[64];
        long              cpuclk = 0;
@@ -277,8 +275,6 @@ int get_clocks_866 (void)
  */
 int sdram_adjust_866 (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *) CFG_IMMR;
        long              mamr;
 
@@ -371,8 +367,6 @@ static long init_pll_866 (long clk)
  */
 int adjust_sdram_tbs_8xx (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *) CFG_IMMR;
        long              mamr;
        long              sccr;
index ee60477ab8f18753450a25c15860dbd763725665..918de6794353b8f6b8de4c6c6a46df2c258f6d49 100644 (file)
@@ -39,6 +39,8 @@
 
 #ifdef CONFIG_VIDEO
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /************************************************************************/
 /* ** DEBUG SETTINGS                                                   */
 /************************************************************************/
@@ -1164,7 +1166,6 @@ static void *video_logo (void)
        u16 *screen = video_fb_address, width = VIDEO_COLS;
 #ifdef VIDEO_INFO
 # ifndef CONFIG_FADS
-       DECLARE_GLOBAL_DATA_PTR;
        char temp[32];
 # endif
        char info[80];
@@ -1282,8 +1283,6 @@ static int video_init (void *videobase)
 
 int drv_video_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int error, devices = 1;
 
        device_t videodev;
index 4bdda25007aa92f20e506e2f97b709603ad0eb6c..5ecdc6d7ea128ef8e831d8032656518d559496d2 100644 (file)
@@ -26,6 +26,8 @@
 #include <watchdog.h>
 #include <nios-io.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*------------------------------------------------------------------
  * JTAG acts as the serial port
  *-----------------------------------------------------------------*/
@@ -83,7 +85,6 @@ int serial_init (void) { return (0);}
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned div;
 
        div = (CONFIG_SYS_CLK_FREQ/gd->baudrate)-1;
index 2d08c93d09f9867530984dcb1107eff73f920238..3d766037a14f9e33447176e339529aa1f10abb55 100644 (file)
@@ -27,6 +27,8 @@
 #include <nios2.h>
 #include <nios2-io.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*------------------------------------------------------------------
  * JTAG acts as the serial port
  *-----------------------------------------------------------------*/
@@ -93,7 +95,6 @@ int serial_init (void) { return (0);}
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned div;
 
        div = (CONFIG_SYS_CLK_FREQ/gd->baudrate)-1;
index 947b85e28a63872b6ef886188395c99cefa30097..fad895b3191d0445320584a7b62ce15e164cc0b4 100644 (file)
@@ -77,6 +77,8 @@
 #include <asm/processor.h>
 #include <pci.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_405GP) || defined(CONFIG_405EP)
 
 #ifdef CONFIG_PCI
@@ -92,8 +94,6 @@ ushort pmc405_pci_subsys_deviceid(void);
  *-----------------------------------------------------------------------------*/
 void pci_405gp_init(struct pci_controller *hose)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int i, reg_num = 0;
        bd_t *bd = gd->bd;
 
index a26533c59c7e553e94143138f30cc623f2a6abe0..0cd72b00a18ea9aacb9ff4f2671cdaacb869a473 100644 (file)
 #include <asm/cache.h>
 #include <ppc4xx.h>
 
+#if !defined(CONFIG_405)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 
 #if defined(CONFIG_440)
 #define FREQ_EBC               (sys_info.freqEPB)
@@ -116,7 +120,6 @@ static int do_chip_reset(unsigned long sys0, unsigned long sys1);
 int checkcpu (void)
 {
 #if !defined(CONFIG_405)       /* not used on Xilinx 405 FPGA implementations */
-       DECLARE_GLOBAL_DATA_PTR;
        uint pvr = get_pvr();
        ulong clock = gd->cpu_clk;
        char buf[32];
index 79cfba3a4511d1892c967e012ba5b352b5878a55..1a139d739eccee84e937ed6df81004967f8cd3ec 100644 (file)
 #include <asm/processor.h>
 #include <ppc4xx.h>
 
+#if defined(CONFIG_405GP)  || defined(CONFIG_405EP)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 
 #define mtebc(reg, data)  mtdcr(ebccfga,reg);mtdcr(ebccfgd,data)
 
@@ -209,8 +213,6 @@ cpu_init_f (void)
 int cpu_init_r (void)
 {
 #if defined(CONFIG_405GP)  || defined(CONFIG_405EP)
-       DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd = gd->bd;
        unsigned long reg;
 #if defined(CONFIG_405GP)
index be94b571ff20ba2f0ab7586237cd7d5769c58bc7..7db1cd8046b3c29d7fd5693faaa35208c0242072 100644 (file)
@@ -16,6 +16,8 @@
 
 #ifdef CONFIG_HARD_I2C
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define IIC_OK         0
 #define IIC_NOK                1
 #define IIC_NOK_LA     2               /* Lost arbitration */
@@ -350,7 +352,6 @@ int i2c_read (uchar chip, uint addr, int alen, uchar * buffer, int len)
 {
        uchar xaddr[4];
        int ret;
-       DECLARE_GLOBAL_DATA_PTR;
 
        if ( alen > 4 ) {
                printf ("I2C read: addr len %d not supported\n", alen);
index 1d8dc7c221deb4be50465424e94f46cc29a00875..3aae4ce8b997e6be4b0ddd40d7c49f3db89101fc 100644 (file)
@@ -36,6 +36,8 @@
 #include <commproc.h>
 #include "vecnum.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /****************************************************************************/
 
 /*
@@ -96,8 +98,6 @@ static __inline__ void set_evpr(unsigned long val)
 
 int interrupt_init_cpu (unsigned *decrementer_count)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int vec;
        unsigned long val;
 
index e7f6bcbe1e8bed440382e9556d272ba3c7eda1c0..83c947998ed51f81370f21558940dcc92e4a7003 100644 (file)
@@ -59,6 +59,8 @@
 #include <malloc.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*****************************************************************************/
 #ifdef CONFIG_IOP480
 
 
 int serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile char val;
        unsigned short br_reg;
 
@@ -185,8 +185,6 @@ int serial_init (void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned short br_reg;
 
        br_reg = ((((CONFIG_CPUCLOCK * 1000000) / 16) / gd->baudrate) - 1);
@@ -431,8 +429,6 @@ int serial_init_dev (unsigned long dev_base)
 int serial_init(void)
 #endif
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long reg;
        unsigned long udiv;
        unsigned short bdiv;
@@ -520,8 +516,6 @@ int serial_init_dev (unsigned long dev_base)
 int serial_init (void)
 #endif
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long reg;
        unsigned long tmp;
        unsigned long clk;
@@ -597,8 +591,6 @@ void serial_setbrg_dev (unsigned long dev_base)
 void serial_setbrg (void)
 #endif
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned long tmp;
        unsigned long clk;
        unsigned long udiv;
@@ -880,8 +872,6 @@ int serial_buffered_tstc (void)
 #if (CONFIG_KGDB_SER_INDEX & 2)
 void kgdb_serial_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile char val;
        unsigned short br_reg;
 
index 553c491e245bab4a6527ac8fab12f3ec29b3f2a6..02b43832f24a2b39eddedb3b17fd7b1b1a9c5a5f 100644 (file)
@@ -26,7 +26,7 @@
 #include <ppc4xx.h>
 #include <asm/processor.h>
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 #define ONE_BILLION        1000000000
 
@@ -522,8 +522,6 @@ ulong get_PCI_freq (void)
 int get_clocks (void)
 {
 #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) || defined(CONFIG_405) || defined(CONFIG_405EP)
-       DECLARE_GLOBAL_DATA_PTR;
-
        sys_info_t sys_info;
 
        get_sys_info (&sys_info);
@@ -533,8 +531,6 @@ int get_clocks (void)
 #endif /* defined(CONFIG_405GP) || defined(CONFIG_405CR) */
 
 #ifdef CONFIG_IOP480
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->cpu_clk = 66000000;
        gd->bus_clk = 66000000;
 #endif
index b33d674110ef4735ccf8651aa75a36d9d630345a..0ee8180361f5f43e5fcbb066d52d6e87e211a9e1 100644 (file)
 #include <command.h>
 #include <asm/arch/pxa-regs.h>
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 int cpu_init (void)
 {
        /*
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index 9bf2a7cf4f836a3d46109532c856a117b6c3d168..cb3a4789901a47baaaa57ed54e88f9dfac3e61e5 100644 (file)
 #include <watchdog.h>
 #include <asm/arch/pxa-regs.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned int quot = 0;
 
        if (gd->baudrate == 1200)
index 70b4ee811c5136e1d393e709acac954268b99952..95d0266c6c675cba1a31f98e8c007d9cae21fa37 100644 (file)
@@ -37,6 +37,8 @@
 #include <common.h>
 #include <asm/hardware.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* flush serial input queue. returns 0 on success or negative error
  * number otherwise
  */
@@ -68,8 +70,6 @@ static int serial_flush_output(void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        u32 divisor = 0;
 
        /* get correct divisor */
index 17e5b0d1956888684800661433f60734614be909..f1bd6440933b4bc5edd72f32e08e1312628c4b07 100644 (file)
 #include <common.h>
 #include <command.h>
 
+#ifdef CONFIG_USE_IRQ
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 int cpu_init (void)
 {
        /*
         * setup up stacks if necessary
         */
 #ifdef CONFIG_USE_IRQ
-       DECLARE_GLOBAL_DATA_PTR;
-
        IRQ_STACK_START = _armboot_start - CFG_MALLOC_LEN - CFG_GBL_DATA_SIZE - 4;
        FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
 #endif
index a598489df7af6db786b16f1c5039fd11d7b943b3..5d1887580d7f8ed55c75af8c1b994531f33ab9dd 100644 (file)
 #include <common.h>
 #include <SA-1100.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned int reg = 0;
 
        if (gd->baudrate == 1200)
index 9a0a24f3ac4bd8fb402723e00295fd12d220991a..69089f92cec913b1ab6d0c33f94273d8cc10badf 100644 (file)
@@ -29,6 +29,8 @@
 #include <devices.h>
 #include <net.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static char input_buffer[512];
 static int input_size = 0;             /* char count in input buffer */
 static int input_offset = 0;           /* offset to valid chars in input buffer */
@@ -105,8 +107,6 @@ int nc_input_packet (uchar * pkt, unsigned dest, unsigned src, unsigned len)
 
 static void nc_send_packet (const char *buf, int len)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        struct eth_device *eth;
        int inited = 0;
        uchar *pkt;
index aced3dae8e26ebcdb59a9065c2e076a587cef047..8dff36774500a343f72efb4a9ba6224bc094076b 100644 (file)
@@ -33,6 +33,8 @@
 #include "ns9750_bbus.h"       /* for GPIOs */
 #include "ns9750_ser.h"                /* for serial configuration */
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define CONSOLE CONFIG_CONS_INDEX
 
 static unsigned int calcBitrateRegister( void );
@@ -183,8 +185,6 @@ void serial_setbrg( void )
 
 static unsigned int calcBitrateRegister( void )
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return ( NS9750_SER_BITRATE_EBIT |
                 NS9750_SER_BITRATE_CLKMUX_BCLK |
                 NS9750_SER_BITRATE_TMODE |
@@ -204,8 +204,6 @@ static unsigned int calcBitrateRegister( void )
 
 static unsigned int calcRxCharGapRegister( void )
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return NS9750_SER_RX_CHAR_TIMER_TRUN;
 }
 
index e2a38dc3dccd923c1c807e48d5a8e25048b99f42..724fa4058278b63fbfe59192814cdd70bdc983cb 100644 (file)
@@ -21,6 +21,8 @@
 #include <asm/atomic.h>
 #include <ps2mult.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* #define     DEBUG */
 
 #define PS2SER_BAUD    57600
@@ -61,8 +63,6 @@ static int    ps2buf_out_idx;
 #ifdef CONFIG_MPC5xxx
 int ps2ser_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
        unsigned long baseclk;
        int div;
index 44b96a9c5e7a377c3b2de711534cdc8a9bf7236f..ddcd591f84a3b0bd08c12bf890cf89b750d850d5 100644 (file)
@@ -50,6 +50,8 @@
 #include <asm/hardware.h>
 #include "s3c4510b_uart.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static UART    *uart;
 
 /* flush serial input queue. returns 0 on success or negative error
@@ -82,8 +84,6 @@ static int serial_flush_output(void)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        UART_LINE_CTRL ulctrl;
        UART_CTRL      uctrl;
        UART_BAUD_DIV  ubd;
index 057a1ab0174ec9566bdc630f549b086fb0d4d1d7..228781b46a63409c2565e3751f2c0c8022644c96 100644 (file)
@@ -30,6 +30,8 @@
 #include <ns87308.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if !defined(CONFIG_CONS_INDEX)
 #error "No console index specified."
 #elif (CONFIG_CONS_INDEX < 1) || (CONFIG_CONS_INDEX > 4)
@@ -77,7 +79,6 @@ static NS16550_t serial_ports[4] = {
 
 static int calc_divisor (NS16550_t port)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_OMAP1510
        /* If can't cleanly clock 115200 set div to 1 */
        if ((CFG_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) {
index bbe212b81f79e3e2e6f465087e0d46aa7388cbb9..35c5596985bbf6ee05cf01f0c1ba4bb734c22531 100644 (file)
@@ -28,6 +28,8 @@
 
 #ifdef CONFIG_MAX3100_SERIAL
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /**************************************************************/
 
 /* convienient macros */
@@ -217,7 +219,6 @@ int serial_init(void)
 {
        unsigned int wconf, rconf;
        int i;
-       DECLARE_GLOBAL_DATA_PTR;
 
        wconf = 0;
 
index 4c5e1b5d3a1325deed2634806f968543079c4cc3..7ec565ca67bf9b3a8c226888c4122b485c72517e 100644 (file)
@@ -23,6 +23,8 @@
 #include "tsec.h"
 #include "miiphy.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define TX_BUF_CNT             2
 
 static uint rxIdx;     /* index of the current RX buffer */
@@ -1082,7 +1084,6 @@ static void relocate_cmds(void)
        struct phy_cmd **cmdlistptr;
        struct phy_cmd *cmd;
        int i,j,k;
-       DECLARE_GLOBAL_DATA_PTR;
 
        for(i=0; phy_info[i]; i++) {
                /* First thing's first: relocate the pointers to the
index 3a269c9082a588732605340ea16a42fec0293d4b..3ff28041f81267bdf548a2a4b7fd062e8e59de5a 100644 (file)
@@ -30,6 +30,8 @@
 #include <common.h>
 #include <exports.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define STANDALONE
 
 #ifndef STANDALONE                     /* Linked into/Part of  PPCBoot */
@@ -346,8 +348,6 @@ static uint dpbase = 0;
 
 uint dpalloc (uint size, uint align)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile immap_t *immr = (immap_t *) CFG_IMMR;
        uint retloc;
        uint align_mask, off;
index 037fdfdb3a811885987ffdb76c2dba285a046a60..13ec06f02c44453b991329e49b97f052b47d204f 100644 (file)
@@ -26,6 +26,8 @@
 #include <mpc8xx_irq.h>
 #include <exports.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef DEBUG
 
 #define        TIMER_PERIOD    1000000         /* 1 second clock */
@@ -115,8 +117,6 @@ static char *usage = "\n[q, b, e, ?] ";
 
 int timer (int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        cpmtimer8xx_t *cpmtimerp;       /* Pointer to the CPM Timer structure   */
        tid_8xx_cpmtimer_t hw;
        tid_8xx_cpmtimer_t *hwp = &hw;
index dba2ff70852f591b3b5fa3d20897b1efd2d8d342..56b7fca83331ec84e68c2af5a4868ebe7a539cd7 100644 (file)
@@ -30,6 +30,8 @@
 #include <dataflash.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*cmd_boot.c*/
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
@@ -77,8 +79,6 @@ extern image_header_t header; /* from cmd_bootm.c */
 void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                     ulong addr, ulong *len_ptr, int verify)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong len = 0, checksum;
        ulong initrd_start, initrd_end;
        ulong data;
index 55d13fad8cc99cea6664f6b07b32a0c0c5d536e5..d9dc2b6d0cf9a254bf422b7375cfe256c65eae2f 100644 (file)
@@ -35,6 +35,8 @@
 #include "blackfin_board.h"
 #include "../drivers/smc91111.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern flash_info_t flash_info[];
 
 
@@ -76,8 +78,6 @@ static void display_flash_config(ulong size)
 
 static int init_baudrate(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uchar tmp[64];
        int i = getenv_r("baudrate", tmp, sizeof(tmp));
        gd->bd->bi_baudrate = gd->baudrate = (i > 0)
@@ -89,7 +89,6 @@ static int init_baudrate(void)
 #ifdef DEBUG
 static void display_global_data(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        bd_t *bd;
        bd = gd->bd;
        printf("--flags:%x\n", gd->flags);
@@ -136,7 +135,6 @@ static void display_global_data(void)
 
 void board_init_f(ulong bootflag)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong addr;
        bd_t *bd;
 
@@ -173,7 +171,6 @@ void board_init_f(ulong bootflag)
 
 void board_init_r(gd_t * id, ulong dest_addr)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong size;
        extern void malloc_bin_reloc(void);
        char *s, *e;
index bc9781550dc60dfac3871c20a930f27120bbac2c..75f04a01fe637cc3aac4e79b203802c28a30fd91 100644 (file)
@@ -36,6 +36,8 @@
 #include <asm/realmode.h>
 #include <asm/io.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define NUMVECTS       256
 
 #define BIOS_DATA        ((char*)0x400)
@@ -136,7 +138,6 @@ static void setvector(int vector, u16 segment, void *handler)
 
 int bios_setup(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        static int done=0;
        int vector;
        struct pci_controller *pri_hose;
index e90eb6e569b8374c35731ac1ed40f368d568aa09..4175fdb1c49a01c44471fc54ef0d8c96106f36b8 100644 (file)
@@ -38,6 +38,8 @@
 #include <ide.h>
 #include <asm/u-boot-i386.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern long _i386boot_start;
 extern long _i386boot_end;
 extern long _i386boot_romdata_start;
@@ -80,8 +82,6 @@ static ulong mem_malloc_brk = 0;
 
 static int mem_malloc_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* start malloc area right after the stack */
        mem_malloc_start = i386boot_bss_start +
                i386boot_bss_size + CFG_STACK_SIZE;
@@ -130,8 +130,6 @@ char *strmhz (char *buf, long hz)
  */
 static int init_baudrate (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char tmp[64];   /* long enough for environment variables */
        int i = getenv_r("baudrate", tmp, 64);
 
@@ -167,7 +165,6 @@ static int display_banner (void)
  */
 static int display_dram_config (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int i;
 
        puts ("DRAM Configuration:\n");
@@ -233,7 +230,6 @@ gd_t *global_data;
 
 void start_i386boot (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        char *s;
        int i;
        ulong size;
index 6b3edd61bb323b57e1fb9e0e3920871967e76a8c..e25833b32bef47308e5a605c6a6648fa303d0e79 100644 (file)
@@ -60,6 +60,8 @@
 #include <i2c.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static char *failed = "*** failed ***\n";
 
 #ifdef CONFIG_PCU_E
@@ -111,8 +113,6 @@ static      ulong   mem_malloc_brk   = 0;
  */
 static void mem_malloc_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
 
        mem_malloc_end = dest_addr;
@@ -177,8 +177,6 @@ typedef int (init_fnc_t) (void);
 
 static int init_baudrate (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uchar tmp[64];  /* long enough for environment variables */
        int i = getenv_r ("baudrate", tmp, sizeof (tmp));
 
@@ -192,8 +190,6 @@ static int init_baudrate (void)
 
 static int init_func_ram (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int board_type = 0;     /* use dummy arg */
        puts ("DRAM:  ");
 
@@ -263,8 +259,6 @@ init_fnc_t *init_sequence[] = {
 void
 board_init_f (ulong bootflag)
 {
-    DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd;
        ulong len, addr, addr_sp;
        gd_t *id;
@@ -414,7 +408,6 @@ board_init_f (ulong bootflag)
  */
 void board_init_r (gd_t *id, ulong dest_addr)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        cmd_tbl_t *cmdtp;
        char *s, *e;
        bd_t *bd;
index a32de1a907ef6e8f02dc41a4587d4315e4b23f4f..f87f56ea8f2ef9b96ec7581a2b042a8330253cd8 100644 (file)
@@ -27,6 +27,8 @@
 #include <zlib.h>
 #include <asm/byteorder.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define PHYSADDR(x) x
 
 #define LINUX_MAX_ENVS         256
@@ -56,8 +58,6 @@ static void linux_env_set (char *env_name, char *env_val);
 void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
                     ulong addr, ulong * len_ptr, int verify)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong len = 0, checksum;
        ulong initrd_start, initrd_end;
        ulong data;
index bc987a338088546c17685a231c9398f2965dbfd4..026d247e54ad8a36a1b5ebf53ab6a5539583b8b5 100644 (file)
@@ -28,6 +28,8 @@
 #include <version.h>
 #include <watchdog.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 const char version_string[] =
        U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
 
@@ -72,8 +74,6 @@ init_fnc_t *init_sequence[] = {
 
 void board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd;
        init_fnc_t **init_fnc_ptr;
 
index 12e84359c92a14e08fac8a5bfd9f34f81a8d8b35..952d5a90ee9635650697ca594293f83354c6a0be 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/byteorder.h>
 #include <asm/addrspace.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define        LINUX_MAX_ENVS          256
 #define        LINUX_MAX_ARGS          256
 
@@ -56,8 +58,6 @@ static void linux_env_set (char * env_name, char * env_val);
 void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
                     ulong addr, ulong * len_ptr, int verify)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        ulong len = 0, checksum;
        ulong initrd_start, initrd_end;
        ulong data;
index e6cda521ed1743c7aa1b41a4e8c8334da85b7303..0a0d2e38fdacb72e7c070ac896c703712f7f6871 100644 (file)
@@ -32,6 +32,7 @@
 #include <status_led.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * All attempts to come up with a "common" initialization sequence
@@ -106,8 +107,6 @@ init_fnc_t *init_sequence[] = {
 /***********************************************************************/
 void board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd;
        init_fnc_t **init_fnc_ptr;
        char *s, *e;
index 0e0b04244967a19d1fad4d65b05eee043f4143ef..cd23037771407993b92229166ed83efc66504702 100644 (file)
@@ -32,6 +32,7 @@
 #include <status_led.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * All attempts to come up with a "common" initialization sequence
@@ -106,8 +107,6 @@ init_fnc_t *init_sequence[] = {
 /***********************************************************************/
 void board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd;
        init_fnc_t **init_fnc_ptr;
        char *s, *e;
index e569e97db99e6cfe5f0d582874962ecaddd5ac41..e68cf1fe734672178aef41b1b7298be87507700e 100644 (file)
@@ -90,6 +90,7 @@ extern flash_info_t flash_info[];
 #endif
 
 #include <environment.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CFG_ENV_IS_EMBEDDED)
index 506203761f43bb54d4115f3715b50b807a35b423..1d1c98f3c20204c74ef3173b50537e21af8c60cd 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -92,6 +92,8 @@
 
 #if (CONFIG_COMMANDS & CFG_CMD_NET)
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define ARP_TIMEOUT            5               /* Seconds before trying ARP again */
 #ifndef        CONFIG_NET_RETRY_COUNT
 # define ARP_TIMEOUT_COUNT     5               /* # of timeouts before giving up  */
@@ -266,8 +268,6 @@ void ArpTimeoutCheck(void)
 int
 NetLoop(proto_t protocol)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd = gd->bd;
 
 #ifdef CONFIG_NET_MULTI
@@ -572,9 +572,6 @@ startAgainHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
 
 void NetStartAgain (void)
 {
-#ifdef CONFIG_NET_MULTI
-       DECLARE_GLOBAL_DATA_PTR;
-#endif
        char *nretry;
        int noretry = 0, once = 0;
 
index 660620e8f6282f7d04f4f6ac649ad61aa8d6a25d..8c87b5927e125c18c7f6c9d453d4ee450be0d2df 100644 (file)
@@ -51,6 +51,8 @@
 #include <net.h>
 #include <serial.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define MIN_PACKET_LENGTH      64
 #define MAX_PACKET_LENGTH      256
 #define TEST_NUM               1
@@ -109,7 +111,6 @@ static RTXBD *rtx;
 
 static void scc_init (int scc_index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        bd_t *bd = gd->bd;
 
        static int proff[] =
index a10bc502d33e7ecce1befb347356bc1b5e9aa230..a2c088bad8d5f3cf274b4e62085e9b664f96cedd 100644 (file)
 
 #if CONFIG_POST & CFG_POST_MEMORY
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Define INJECT_*_ERRORS for testing error detection in the presence of
  * _good_ hardware.
@@ -455,7 +457,6 @@ static int memory_post_tests (unsigned long start, unsigned long size)
 int memory_post_test (int flags)
 {
        int ret = 0;
-       DECLARE_GLOBAL_DATA_PTR;
        bd_t *bd = gd->bd;
        unsigned long memsize = (bd->bi_memsize >= 256 << 20 ?
                                 256 << 20 : bd->bi_memsize) - (1 << 20);
index b3df91aa5c0c67bf723151adb9013ef980d7757b..e1066da6bd1e9b5ec7237e7f3e2eeb2f7346e2d8 100644 (file)
 
 #ifdef CONFIG_POST
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define POST_MAX_NUMBER                32
 
 #define BOOTMODE_MAGIC 0xDEAD0000
 
 int post_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int res = 0;
        unsigned int i;
 
@@ -62,7 +62,6 @@ int post_init_f (void)
 
 void post_bootmode_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int bootmode = post_bootmode_get (0);
        int newword;
 
@@ -110,20 +109,17 @@ int post_bootmode_get (unsigned int *last_test)
 /* POST tests run before relocation only mark status bits .... */
 static void post_log_mark_start ( unsigned long testid )
 {
-       DECLARE_GLOBAL_DATA_PTR;
        gd->post_log_word |= (testid)<<16;
 }
 
 static void post_log_mark_succ ( unsigned long testid )
 {
-       DECLARE_GLOBAL_DATA_PTR;
        gd->post_log_word |= testid;
 }
 
 /* ... and the messages are output once we are relocated */
 void post_output_backlog ( void )
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int j;
 
        for (j = 0; j < post_list_size; j++) {
@@ -379,8 +375,6 @@ int post_log (char *format, ...)
 
 void post_reloc (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned int i;
 
        /*
index 72fcac3850809489431e052d22c3f6dd122d1e62..f61d598244ccb025f1bbe2f7a86812cc97872d3f 100644 (file)
@@ -52,6 +52,8 @@
 
 #if CONFIG_POST & CFG_POST_SYSMON
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static int sysmon_temp_invalid = 0;
 
 /* #define DEBUG */
@@ -159,8 +161,6 @@ int sysmon_init_f (void)
 
 void sysmon_reloc (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        sysmon_t ** l;
        sysmon_table_t * t;
 
@@ -281,8 +281,6 @@ static void sysmon_ccfl_enable (sysmon_table_t * this)
 
 int sysmon_post_test (int flags)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        int res = 0;
        sysmon_table_t * t;
        uint val;
index 23bf036ba48534604bddb536a0f894f25da7c3c1..fd97e3899e9e1187aaff700cec7c97d06c89d4ee 100644 (file)
@@ -50,6 +50,8 @@
 #include <command.h>
 #include <serial.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define CTLR_SMC 0
 #define CTLR_SCC 1
 
@@ -82,8 +84,6 @@ static int proff_scc[] =
 
 static void smc_init (int smc_index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        static int cpm_cr_ch[] = { CPM_CR_CH_SMC1, CPM_CR_CH_SMC2 };
 
        volatile immap_t *im = (immap_t *) CFG_IMMR;
@@ -288,8 +288,6 @@ static int smc_getc (int smc_index)
 
 static void scc_init (int scc_index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        static int cpm_cr_ch[] = {
                CPM_CR_CH_SCC1,
                CPM_CR_CH_SCC2,