Fix cases where DECLARE_GLOBAL_DATA_PTR was not declared as global
authorWolfgang Denk <wd@denx.de>
Sat, 15 Sep 2007 18:48:41 +0000 (20:48 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 15 Sep 2007 18:48:41 +0000 (20:48 +0200)
Signed-off-by: Wolfgang Denk <wd@denx.de>
30 files changed:
board/amcc/katmai/katmai.c
board/amcc/taishan/taishan.c
board/amcc/yucca/yucca.c
board/bf533-ezkit/bf533-ezkit.c
board/bf533-stamp/bf533-stamp.c
board/bf537-stamp/bf537-stamp.c
board/bf561-ezkit/bf561-ezkit.c
board/freescale/mpc8313erdb/sdram.c
board/lpc2292sodimm/lpc2292sodimm.c
board/mpc7448hpc2/mpc7448hpc2.c
board/mpc7448hpc2/tsi108_init.c
board/mpl/vcma9/cmd_vcma9.c
board/sbc2410x/sbc2410x.c
board/siemens/SMN42/smn42.c
board/tqm5200/tqm5200.c
cpu/arm720t/serial.c
cpu/bf533/serial.c
cpu/bf537/i2c.c
cpu/bf537/serial.c
cpu/bf561/serial.c
cpu/mcf532x/cpu.c
cpu/mcf532x/speed.c
cpu/mpc86xx/cpu_init.c
cpu/mpc86xx/speed.c
cpu/mpc86xx/traps.c
drivers/qe/qe.c
drivers/usbdcore_mpc8xx.c
include/configs/atstk1002.h
lib_blackfin/board.c
lib_blackfin/post.c

index afd60ec..a49066f 100644 (file)
@@ -34,6 +34,8 @@
 #undef PCIE_ENDPOINT
 /* #define PCIE_ENDPOINT 1 */
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int ppc440spe_init_pcie_rootport(int port);
 void ppc440spe_setup_pcie(struct pci_controller *hose, int port);
 
@@ -322,8 +324,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 bc976c7..f00397e 100644 (file)
@@ -32,6 +32,8 @@
 void show_reset_reg(void);
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int lcd_init(void);
 
 int board_early_init_f (void)
@@ -266,8 +268,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 397b018..d7cc384 100644 (file)
@@ -34,6 +34,8 @@
 #include "yucca.h"
 #include "../cpu/ppc4xx/440spe_pcie.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #undef PCIE_ENDPOINT
 /* #define PCIE_ENDPOINT 1 */
 
@@ -668,8 +670,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 1dd4a3f..98ed6f8 100644 (file)
@@ -30,6 +30,8 @@
 #include "psd4256.h"
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
 #if (BFIN_CPU == ADSP_BF531)
@@ -46,7 +48,6 @@ int checkboard(void)
 
 long int initdram(int board_type)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef DEBUG
        int brate;
        char *tmp = getenv("baudrate");
index b9dff99..69e425b 100644 (file)
@@ -30,6 +30,8 @@
 #include <asm/io.h>
 #include "bf533-stamp.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define STATUS_LED_OFF 0
 #define STATUS_LED_ON  1
 
@@ -55,7 +57,6 @@ int checkboard(void)
 
 long int initdram(int board_type)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef DEBUG
        printf("SDRAM attributes:\n");
        printf
index 919cef6..b3d8bda 100644 (file)
@@ -32,6 +32,8 @@
 #include <asm/io.h>
 #include "ether_bf537.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define POST_WORD_ADDR 0xFF903FFC
 
 /*
@@ -132,7 +134,6 @@ void cf_outsw(unsigned short *addr, unsigned short *sect_buf, int words)
 
 long int initdram(int board_type)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef DEBUG
        int brate;
        char *tmp = getenv("baudrate");
index 989b019..2ff44a7 100644 (file)
@@ -29,6 +29,8 @@
 #include <common.h>
 #include <asm/io.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        printf("CPU:   ADSP BF561\n");
@@ -39,7 +41,6 @@ int checkboard(void)
 
 long int initdram(int board_type)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef DEBUG
        int brate;
        char *tmp = getenv("baudrate");
index e6e8410..16ec4bb 100644 (file)
 
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifndef CFG_8313ERDB_BROKEN_PMC
 static void resume_from_sleep(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        u32 magic = *(u32 *)0;
 
        typedef void (*func_t)(void);
index d212c63..9c2d1af 100644 (file)
@@ -28,8 +28,7 @@
 #include <common.h>
 #include <clps7111.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscelaneous platform dependent initialisations
@@ -37,8 +36,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Activate LED flasher */
        IO_LEDFLSH = 0x40;
 
@@ -53,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;
 
index 63c99de..81846eb 100644 (file)
@@ -38,6 +38,8 @@ extern void ft_cpu_setup (void *blob, bd_t *bd);
 
 #undef DEBUG
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern void flush_data_cache (void);
 extern void invalidate_l1_instruction_cache (void);
 extern void tsi108_init_f (void);
@@ -46,8 +48,6 @@ int display_mem_map (void);
 
 void after_reloc (ulong dest_addr)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /*
         * Jump to the main U-Boot board init code
         */
index 8a7efef..30ae17d 100644 (file)
@@ -33,6 +33,8 @@
 #include <asm/processor.h>
 #include <tsi108.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern void mpicInit (int verbose);
 
 /*
@@ -141,7 +143,6 @@ unsigned long get_board_bus_clk (void)
 
 int board_early_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong i;
 
        gd->mem_clk = 0;
@@ -583,7 +584,6 @@ unsigned long get_l2cr (void)
 
 int misc_init_r (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef CFG_CLK_SPREAD  /* Initialize Spread-Spectrum Clock generation */
        ulong i;
 
index 44b4112..227c492 100644 (file)
@@ -40,6 +40,8 @@ static uchar cs8900_chksum(ushort data)
 
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern void print_vcma9_info(void);
 extern int vcma9_cantest(int);
 extern int vcma9_nandtest(void);
@@ -53,8 +55,6 @@ extern int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 int do_vcma9(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (strcmp(argv[1], "info") == 0)
        {
                print_vcma9_info();
index b4865e1..6c894a3 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/mtd/nand.h>
 #endif
 
-/* ------------------------------------------------------------------------- */
+DECLARE_GLOBAL_DATA_PTR;
 
 #define FCLK_SPEED 1
 
@@ -74,7 +74,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();
 
@@ -128,8 +127,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 cbfc76c..52d1d7e 100644 (file)
@@ -31,8 +31,7 @@
 #include <common.h>
 #include <clps7111.h>
 
-/* ------------------------------------------------------------------------- */
-
+DECLARE_GLOBAL_DATA_PTR;
 
 /*
  * Miscellaneous platform dependent initialisations
@@ -40,8 +39,6 @@
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* arch number MACH_TYPE_ARMADILLO - not official*/
        gd->bd->bi_arch_number = 83;
 
@@ -53,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;
 
index 21f67aa..29d6f00 100644 (file)
@@ -43,6 +43,8 @@
 #include "mt48lc16m16a2-75.h"
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_PS2MULT
 void ps2mult_early_init(void);
 #endif
@@ -477,8 +479,6 @@ int silent_boot (void)
 
 int board_early_init_f (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        if (silent_boot())
                gd->flags |= GD_FLG_SILENT;
 
index 15c54af..27eb73a 100644 (file)
@@ -129,8 +129,6 @@ serial_puts (const char *s)
 
 void serial_setbrg (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned short divisor = 0;
 
        switch (gd->baudrate) {
index 6cab5da..8ac6e3f 100644 (file)
@@ -76,7 +76,6 @@ void calc_baud(void)
 void serial_setbrg(void)
 {
        int i;
-       DECLARE_GLOBAL_DATA_PTR;
 
        calc_baud();
 
index 3b0d026..0daba63 100644 (file)
@@ -22,6 +22,8 @@
 #include <i2c.h>
 #include <asm/io.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define bfin_read16(addr) ({ unsigned __v; \
                        __asm__ __volatile__ (\
                        "%0 = w[%1] (z);\n\t"\
@@ -68,7 +70,6 @@
 
 #ifdef DEBUG_I2C
 #define PRINTD(fmt,args...)    do {    \
-       DECLARE_GLOBAL_DATA_PTR;        \
        if (gd->have_console)           \
                printf(fmt ,##args);    \
        } while (0)
index e04d08a..f7a2483 100644 (file)
@@ -52,6 +52,8 @@
 #include <asm/io.h>
 #include "serial.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 unsigned long pll_div_fact;
 
 void calc_baud(void)
@@ -74,7 +76,6 @@ void calc_baud(void)
 void serial_setbrg(void)
 {
        int i;
-       DECLARE_GLOBAL_DATA_PTR;
 
        calc_baud();
 
index 7f5c695..bc5a4f5 100644 (file)
@@ -52,6 +52,8 @@
 #include "serial.h"
 #include <asm/io.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 unsigned long pll_div_fact;
 
 void calc_baud(void)
@@ -74,7 +76,6 @@ void calc_baud(void)
 void serial_setbrg(void)
 {
        int i;
-       DECLARE_GLOBAL_DATA_PTR;
 
        calc_baud();
 
index 520f5d6..2f62e95 100644 (file)
@@ -31,6 +31,8 @@
 
 #include <asm/immap.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
 {
        volatile wdog_t *wdp = (wdog_t *) (MMAP_WDOG);
@@ -48,8 +50,6 @@ int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
 
 int checkcpu(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        volatile ccm_t *ccm = (ccm_t *) MMAP_CCM;
        u16 msk;
        u16 id = 0;
index cf72609..001b9f4 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <asm/immap.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* PLL min/max specifications */
 #define MAX_FVCO       500000  /* KHz */
 #define MAX_FSYS       80000   /* KHz */
@@ -208,8 +210,6 @@ int clock_pll(int fsys, int flags)
  */
 int get_clocks(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bus_clk = clock_pll(CFG_CLK / 1000, 0) * 1000;
        gd->cpu_clk = (gd->bus_clk * 3);
        return (0);
index c8e4666..4f8956e 100644 (file)
@@ -29,6 +29,8 @@
 #include <common.h>
 #include <mpc86xx.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Breathe some life into the CPU...
  *
@@ -38,7 +40,6 @@
 
 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;
 
index 312ca12..23161ca 100644 (file)
@@ -29,6 +29,7 @@
 #include <mpc86xx.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 
 void get_sys_info(sys_info_t *sysInfo)
 {
@@ -96,7 +97,6 @@ void get_sys_info(sys_info_t *sysInfo)
 
 int get_clocks(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        sys_info_t sys_info;
 
        get_sys_info(&sys_info);
index c84bfbf..04c2e13 100644 (file)
@@ -34,6 +34,8 @@
 #include <command.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_CMD_KGDB)
 int (*debugger_exception_handler)(struct pt_regs *) = 0;
 #endif
@@ -50,8 +52,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 0f5232a..7559e92 100644 (file)
@@ -30,6 +30,8 @@
 qe_map_t               *qe_immr = NULL;
 static qe_snum_t       snums[QE_NUM_OF_SNUM];
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void qe_issue_cmd(uint cmd, uint sbc, u8 mcn, u32 cmd_data)
 {
        u32           cecr;
@@ -51,8 +53,6 @@ void qe_issue_cmd(uint cmd, uint sbc, u8 mcn, u32 cmd_data)
 
 uint qe_muram_alloc(uint size, uint align)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        uint    retloc;
        uint    align_mask, off;
        uint    savebase;
@@ -158,8 +158,6 @@ void qe_put_snum(u8 snum)
 
 void qe_init(uint qe_base)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* Init the QE IMMR base */
        qe_immr = (qe_map_t *)qe_base;
 
@@ -204,7 +202,6 @@ void qe_assign_page(uint snum, uint para_ram_base)
 
 int qe_set_brg(uint brg, uint rate)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        volatile uint   *bp;
        u32             divisor;
        int             div16 = 0;
index e87284b..d4c4096 100644 (file)
@@ -64,6 +64,8 @@
 #include "usbdcore_mpc8xx.h"
 #include "usbdcore_ep0.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define ERR(fmt, args...)\
        serial_printf("ERROR : [%s] %s:%d: "fmt,\
                                __FILE__,__FUNCTION__,__LINE__, ##args)
@@ -1216,7 +1218,6 @@ static void mpc8xx_udc_clock_init (volatile immap_t * immr,
 #elif defined(CFG_USB_BRGCLK)
 
        /* This has been tested with brgclk == 50MHz */
-       DECLARE_GLOBAL_DATA_PTR;
        int divisor = 0;
 
        if (gd->cpu_clk < 48000000L) {
index e1d8f74..75b153e 100644 (file)
 #define CFG_LONGHELP                   1
 
 #define CFG_MEMTEST_START                                              \
-       ({ DECLARE_GLOBAL_DATA_PTR; gd->bd->bi_dram[0].start; })
+       ({ gd->bd->bi_dram[0].start; })
 #define CFG_MEMTEST_END                                                        \
        ({                                                              \
-               DECLARE_GLOBAL_DATA_PTR;                                \
                gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size;     \
        })
 #define CFG_BAUDRATE_TABLE { 115200, 38400, 19200, 9600, 2400 }
index 36a969e..7c9990f 100644 (file)
@@ -42,6 +42,8 @@
 int post_flag;
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifndef CFG_NO_FLASH
 extern flash_info_t flash_info[];
 #endif
@@ -126,8 +128,6 @@ static void display_flash_config(ulong size)
 
 static int init_baudrate(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        char tmp[64];
        int i = getenv_r("baudrate", tmp, sizeof(tmp));
        gd->bd->bi_baudrate = gd->baudrate = (i > 0)
@@ -139,7 +139,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);
@@ -256,7 +255,6 @@ void init_cplbtables(void)
 
 void board_init_f(ulong bootflag)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        ulong addr;
        bd_t *bd;
        int i;
@@ -325,7 +323,6 @@ static int init_func_i2c(void)
 
 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 7c9478d..3c4d5c5 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;
 
@@ -109,20 +108,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++) {
@@ -372,8 +368,6 @@ int post_log(char *format, ...)
 
 void post_reloc(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        unsigned int i;
 
        /*