Fix cases where DECLARE_GLOBAL_DATA_PTR was not declared as global

Signed-off-by: Wolfgang Denk <wd@denx.de>
This commit is contained in:
Wolfgang Denk 2007-09-15 20:48:41 +02:00
parent 66b3f24d66
commit 1218abf1b5
30 changed files with 51 additions and 70 deletions

View 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
*-------------------------------------------------------------------*/

View 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
*--------------------------------------------------------------------------*/

View 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
*-------------------------------------------------------------------*/

View 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");

View 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

View 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");

View 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");

View File

@ -33,10 +33,11 @@
#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);

View 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;

View 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
*/

View 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;

View 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();

View 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;

View 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;

View 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;

View 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) {

View File

@ -76,7 +76,6 @@ void calc_baud(void)
void serial_setbrg(void)
{
int i;
DECLARE_GLOBAL_DATA_PTR;
calc_baud();

View 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)

View 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();

View 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();

View 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;

View 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);

View 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;

View 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);

View 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;

View 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;

View 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) {

View File

@ -183,10 +183,9 @@
#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 }

View 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;

View File

@ -32,14 +32,14 @@
#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;
/*