From d87080b721e4f8dca977af7571c5338ae7bb8db7 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Fri, 31 Mar 2006 18:32:53 +0200 Subject: GCC-4.x fixes: clean up global data pointer initialization for all boards. --- board/mpl/common/common_util.c | 4 +++- board/mpl/common/memtst.c | 7 ++++--- board/mpl/common/pci.c | 3 +-- board/mpl/mip405/mip405.c | 8 +++----- board/mpl/pip405/pip405.c | 10 ++-------- board/mpl/vcma9/vcma9.c | 5 +---- 6 files changed, 14 insertions(+), 23 deletions(-) (limited to 'board/mpl') diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c index b331d6ec47..06d021a026 100644 --- a/board/mpl/common/common_util.c +++ b/board/mpl/common/common_util.c @@ -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; diff --git a/board/mpl/common/memtst.c b/board/mpl/common/memtst.c index 2c77d375ea..ff1190ab21 100644 --- a/board/mpl/common/memtst.c +++ b/board/mpl/common/memtst.c @@ -50,13 +50,15 @@ int testdram (void) #include #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++) { diff --git a/board/mpl/common/pci.c b/board/mpl/common/pci.c index 692930b416..bde14beeb1 100644 --- a/board/mpl/common/pci.c +++ b/board/mpl/common/pci.c @@ -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++) { diff --git a/board/mpl/mip405/mip405.c b/board/mpl/mip405/mip405.c index 9c469b09ac..34f328999d 100644 --- a/board/mpl/mip405/mip405.c +++ b/board/mpl/mip405/mip405.c @@ -70,6 +70,9 @@ #include "../common/common_util.h" #include #include + +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; diff --git a/board/mpl/pip405/pip405.c b/board/mpl/pip405/pip405.c index a398362f96..38286081ae 100644 --- a/board/mpl/pip405/pip405.c +++ b/board/mpl/pip405/pip405.c @@ -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; diff --git a/board/mpl/vcma9/vcma9.c b/board/mpl/vcma9/vcma9.c index ffdba5d990..0d2003d2fc 100644 --- a/board/mpl/vcma9/vcma9.c +++ b/board/mpl/vcma9/vcma9.c @@ -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(); -- cgit