]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Move DECLARE_GLOBAL_DATA_PTR to file scope
authorJohn Rigby <john.rigby@linaro.org>
Tue, 21 Dec 2010 01:27:51 +0000 (18:27 -0700)
committerWolfgang Denk <wd@denx.de>
Tue, 21 Dec 2010 10:33:36 +0000 (11:33 +0100)
It can be optimised out by the compiler otherwise resulting
in obscure errors like a board not booting.

This has been documented in README since 2006 when these were
first fixed up for GCC 4.x.

Signed-off-by: John Rigby <john.rigby@linaro.org>
Fix some additional places.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-By: Albert ARIBAUD <albert.aribaud@free.fr>
32 files changed:
arch/arm/cpu/armv7/mx5/speed.c
arch/blackfin/cpu/serial.c
arch/m68k/cpu/mcf52x2/cpu.c
arch/m68k/cpu/mcf547x_8x/speed.c
arch/sh/lib/board.c
board/espt/espt.c
board/isee/igep0020/igep0020.c
board/isee/igep0030/igep0030.c
board/linkstation/linkstation.c
board/logicpd/zoom1/zoom1.c
board/logicpd/zoom2/zoom2.c
board/mpr2/mpr2.c
board/ms7720se/ms7720se.c
board/ms7722se/ms7722se.c
board/ms7750se/ms7750se.c
board/overo/overo.c
board/pandora/pandora.c
board/renesas/MigoR/migo_r.c
board/renesas/ap325rxa/ap325rxa.c
board/renesas/r2dplus/r2dplus.c
board/renesas/r7780mp/r7780mp.c
board/renesas/rsk7203/rsk7203.c
board/renesas/sh7763rdp/sh7763rdp.c
board/renesas/sh7785lcr/sh7785lcr.c
board/samsung/smdk6400/smdk6400.c
board/ti/beagle/beagle.c
board/ti/evm/evm.c
board/ti/sdp3430/sdp.c
drivers/i2c/omap24xx_i2c.c
drivers/serial/s3c64xx.c
drivers/serial/serial_s5p.c
drivers/serial/serial_sh.c

index a444def7eb8d91d75bbb3f592852b00f05b36246..2187e8ee5deb5d334c0308342aa3caad98a6f78f 100644 (file)
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
 
+#ifdef CONFIG_FSL_ESDHC
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 int get_clocks(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
 #ifdef CONFIG_FSL_ESDHC
        gd->sdhc_clk = mxc_get_clock(MXC_IPG_PERCLK);
 #endif
index 901cb97a1cae8e1072302edea216fe61e7c6f3be..650202e24f907eb06400ed08fe92499d6bcb4ff9 100644 (file)
@@ -42,6 +42,8 @@
 #include <asm/blackfin.h>
 #include <asm/mach-common/bits/uart.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_UART_CONSOLE
 
 #include "serial.h"
@@ -95,7 +97,6 @@ void serial_set_baud(uint32_t baud)
  */
 void serial_setbrg(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        serial_set_baud(gd->baudrate);
 }
 
index 9fb717c2bd0c27f0707a7892dc42ee3d61e91569..fb60462c46690c57a46498902cd72b226202f372 100644 (file)
@@ -74,8 +74,7 @@ int watchdog_disable(void)
 {
        volatile wdog_t *wdt = (volatile wdog_t *)(MMAP_WDOG);
 
-       wdt->sr = 0x5555; /* reset watchdog counteDECLARE_GLOBAL_DATA_PTR;
-r */
+       wdt->sr = 0x5555; /* reset watchdog counter */
        wdt->sr = 0xAAAA;
        wdt->cr = 0;    /* disable watchdog timer */
 
index 2cee4887ac9afe5d1924ab6178b3136433374f2d..31130b54115203dfc262aafba2948ed8275934a3 100644 (file)
 
 #include <asm/immap.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->bus_clk = CONFIG_SYS_CLK;
        gd->cpu_clk = (gd->bus_clk * 2);
 
index fe53ab4de9194351a9906a91cb44780220847914..3d201b2e5c03f4b624e5b69c9b4abc585a994d8a 100644 (file)
@@ -32,6 +32,8 @@
 #include <miiphy.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern int cpu_init(void);
 extern int board_init(void);
 extern int dram_init(void);
@@ -43,8 +45,6 @@ unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
 
 static int sh_flash_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_flashsize = flash_init();
        printf("FLASH: %ldMB\n", gd->bd->bi_flashsize / (1024*1024));
 
@@ -99,7 +99,6 @@ static int sh_mem_env_init(void)
 #if defined(CONFIG_CMD_NET)
 static int sh_net_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
        return 0;
 }
@@ -139,8 +138,6 @@ init_fnc_t *init_sequence[] =
 
 void sh_generic_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        bd_t *bd;
        init_fnc_t **init_fnc_ptr;
 
index 29308587d9408b07b8772f487d46158545bd02c8..44ab635ed74de3bc2805fa240321ba4e39923ad9 100644 (file)
@@ -24,6 +24,8 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        puts("BOARD: ESPT-GIGA\n");
@@ -37,8 +39,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index 3ba541e21e6c5596142568be95f53da518a27853..36cc9248b6b7ec2e1783713b472f47d751eb0ca3 100644 (file)
@@ -32,6 +32,8 @@
 #include <asm/mach-types.h>
 #include "igep0020.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* GPMC definitions for LAN9221 chips */
 static const u32 gpmc_lan_config[] = {
     NET_LAN9221_GPMC_CONFIG1,
@@ -48,8 +50,6 @@ static const u32 gpmc_lan_config[] = {
  */
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
        /* board id for Linux */
        gd->bd->bi_arch_number = MACH_TYPE_IGEP0020;
index bb4dc3ba1743ef87dccc48f893982e9a967c48f3..6a927350b4d29b2d23604201c5e4087b5cc19fd4 100644 (file)
 #include <asm/mach-types.h>
 #include "igep0030.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
  */
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
        /* board id for Linux */
        gd->bd->bi_arch_number = MACH_TYPE_IGEP0030;
index c0d43eb332882857d7ce22b5a08f06358112ab8a..e564e505ac4bed09a64bc1da0557ad777e24fdc2 100644 (file)
 #include <pci.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern void init_AVR_DUART(void);
 
 int checkboard (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        char *p;
        bd_t *bd = gd->bd;
 
index e442d687b735f3cbfb50e6c1f8848f325cb8f950..7ef13cc623f2e549be5dcfed0f6cd4462cbd2cd7 100644 (file)
 #include <asm/mach-types.h>
 #include "zoom1.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
  */
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
        /* board id for Linux */
        gd->bd->bi_arch_number = MACH_TYPE_OMAP_LDP;
index e9f6625ce02841a14fbbc4d3449f678974812568..76793e42e74742a63c9ddd61e9a205a9ee96505e 100644 (file)
@@ -43,6 +43,8 @@
 #include "zoom2.h"
 #include "zoom2_serial.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * This the the zoom2, board specific, gpmc configuration for the
  * quad uart on the debug board.   The more general gpmc configurations
@@ -120,7 +122,6 @@ void zoom2_identify(void)
  */
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        u32 *gpmc_config;
 
        gpmc_init ();           /* in SRAM or SDRAM, finish GPMC */
index 0ec0c198b9ddc3635166009235dec4b6ada8c988..488185943f476d53cda5d58824a61589f5df20f4 100644 (file)
@@ -24,6 +24,8 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        puts("BOARD: MPR2\n");
@@ -152,8 +154,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("SDRAM: %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index f83c1208a7257c80f06984a81ac0a78a79dcc93f..ab7c338e07ef406df0637f42efbc333bf152d45c 100644 (file)
@@ -30,6 +30,8 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define LED_BASE       0xB0800000
 
 int checkboard(void)
@@ -45,8 +47,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index 4e40b17343f92e3258770fb5f3cd9ac8fbd33aca..4e67ac623f66efc142e5df72a53146dad4205524 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define LED_BASE       0xB0800000
 
 int checkboard(void)
@@ -46,8 +48,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index 02ff0a3df5411e7ad83a5a201c9802a8839c5c83..9370af382567b2f15abe5cc5058f698def31425e 100644 (file)
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        puts("BOARD: SH7750/SH7750S/SH7750R Solution Engine\n");
@@ -37,8 +39,6 @@ int board_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index f917e402b06d66d2d9a6004884019d92e78d1349..4eafdb1df392542141ca8c5901558fdebc0d0218 100644 (file)
@@ -40,6 +40,8 @@
 #include <asm/mach-types.h>
 #include "overo.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define TWL4030_I2C_BUS                        0
 #define EXPANSION_EEPROM_I2C_BUS       2
 #define EXPANSION_EEPROM_I2C_ADDRESS   0x51
@@ -87,8 +89,6 @@ static const u32 gpmc_lan_config[] = {
  */
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
        /* board id for Linux */
        gd->bd->bi_arch_number = MACH_TYPE_OVERO;
index 355e9eaa8fc7d4a730930897825322ea47b3e881..992e9f7625ece834ff1d4f1a54171133689475da 100644 (file)
@@ -37,6 +37,8 @@
 #include <asm/mach-types.h>
 #include "pandora.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define TWL4030_BB_CFG_BBCHEN          (1 << 4)
 #define TWL4030_BB_CFG_BBSEL_3200MV    (3 << 2)
 #define TWL4030_BB_CFG_BBISEL_500UA    2
@@ -47,8 +49,6 @@
  */
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
        /* board id for Linux */
        gd->bd->bi_arch_number = MACH_TYPE_OMAP3_PANDORA;
index c0f26ac1ea58dfdacd333c4e17c7b0860939b4a4..75b653f8a14c9821c30b595a0e1ded6d0ae3c0fc 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        puts("BOARD: Renesas MigoR\n");
@@ -41,8 +43,6 @@ int board_init(void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index be919f5454a10cb1667f18962c3392ba71cfe564..758e6f4a0bf65cc1d97287bcbcec2d82e9be841a 100644 (file)
@@ -23,6 +23,8 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* PRI control register */
 #define PRPRICR5       0xFF800048 /* LMB */
 #define PRPRICR5_D     0x2a
@@ -143,8 +145,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index 0c08d685949b18f4df218d602c99c59ef6986cb5..b70395dd2be8b48efaad01b91e7b73d529b620cb 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/io.h>
 #include <asm/pci.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        puts("BOARD: Renesas Solutions R2D Plus\n");
@@ -41,8 +43,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index 396e4b6db3584b9037c7e428dbbe5cfedc015991..0b800990479fdb37b6e44eed324ee4c5f24c4519 100644 (file)
@@ -26,6 +26,8 @@
 #include <netdev.h>
 #include "r7780mp.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
 #if defined(CONFIG_R7780MP)
@@ -46,8 +48,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index fbf2e23cf05cfc83262a0f3a43b5489a63bc8df9..06552c08180aaadda25572507cbbc66b03501a19 100644 (file)
@@ -26,6 +26,8 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        puts("BOARD: Renesas Technology RSK7203\n");
@@ -39,8 +41,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index 88bab70e35649ff6ead2c8fbee2d276cbc26f710..9f44b9afb86b8aa3686174903e07c3fc7d260352 100644 (file)
@@ -25,6 +25,8 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define CPU_CMDREG     0xB1000006
 #define PDCR        0xffef0006
 #define PECR        0xffef0008
@@ -64,8 +66,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index cad3905ff22b40c57e430c91a1a5007657ec65ca..904e75587924244939963fc53a58c7370ed62eca 100644 (file)
@@ -23,6 +23,8 @@
 #include <asm/pci.h>
 #include <netdev.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        puts("BOARD: Renesas Technology Corp. R0P7785LC0011RL\n");
@@ -36,8 +38,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
index 78aaa9e13a3a88847bb6b82092a2f79931b1eb92..35aa40b30df5312c2813c25c9d13d42b6646e50a 100644 (file)
@@ -32,6 +32,8 @@
 #include <netdev.h>
 #include <asm/arch/s3c6400.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* ------------------------------------------------------------------------- */
 #define CS8900_Tacs    0x0     /* 0clk         address set-up          */
 #define CS8900_Tcos    0x4     /* 4clk         chip selection set-up   */
@@ -63,8 +65,6 @@ static void cs8900_pre_init(void)
 
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        cs8900_pre_init();
 
        /* NOR-flash in SROM0 */
@@ -80,8 +80,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 d9b6f01163b609cfdbc4f6340574b04718a6566c..c066d6ef52ba6ed7cd26babba65b6ff2c3784d60 100644 (file)
@@ -51,6 +51,8 @@
 
 #define BEAGLE_NO_EEPROM               0xffffffff
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static struct {
        unsigned int device_vendor;
        unsigned char revision;
@@ -66,8 +68,6 @@ static struct {
  */
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
        /* board id for Linux */
        gd->bd->bi_arch_number = MACH_TYPE_OMAP3_BEAGLE;
index c2b63509093d977a676355f94b72464875ff1709..aaf3033b04adf3b686bb493252c0119df00a1361 100644 (file)
@@ -37,6 +37,8 @@
 #include <asm/mach-types.h>
 #include "evm.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static u32 omap3_evm_version;
 
 u32 get_omap3_evm_rev(void)
@@ -103,8 +105,6 @@ u8 omap3_evm_need_extvbus(void)
  */
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
        /* board id for Linux */
        gd->bd->bi_arch_number = MACH_TYPE_OMAP3EVM;
index 0d8e20dc7cf3b6f30c79f5399881a0ffc6a538b0..72f0984d67c5606cf74558d033366939adb65174 100644 (file)
@@ -31,6 +31,8 @@
 #include <asm/mach-types.h>
 #include "sdp.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 const omap3_sysinfo sysinfo = {
        DDR_DISCRETE,
        "OMAP3 SDP3430 board",
@@ -101,8 +103,6 @@ extern struct gpmc *gpmc_cfg;
  */
 int board_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
        /* TODO: Dynamically pop out CS mapping and program accordingly */
        /* Configure devices for default ON ON ON settings */
index fab49fd969eabb48487feb469c195612bedd2e1f..215be3419d1b58326ee5a38a16bb7261c76e2a88 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "omap24xx_i2c.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define I2C_TIMEOUT    1000
 
 static void wait_for_bb (void);
@@ -40,7 +42,6 @@ static unsigned int current_bus;
 
 void i2c_init (int speed, int slaveadd)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        int psc, fsscll, fssclh;
        int hsscll = 0, hssclh = 0;
        u32 scll, sclh;
index 6d22df7cf4ee7bdad47093e36ee227094dd68d28..a88e930945d4928945f6041bdfe61a14c70c0f70 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <asm/arch/s3c6400.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_SERIAL1
 #define UART_NR        S3C64XX_UART0
 
@@ -68,7 +70,6 @@ static const int udivslot[] = {
 
 void serial_setbrg(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        s3c64xx_uart *const uart = s3c64xx_get_base_uart(UART_NR);
        u32 pclk = get_PCLK();
        u32 baudrate = gd->baudrate;
index 36333c3d49a78d9292c8a82d8c049be679b006cd..9c1cbf4a4832ae10a1fe4601b2ef329113e87574 100644 (file)
@@ -27,6 +27,8 @@
 #include <asm/arch/clk.h>
 #include <serial.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static inline struct s5p_uart *s5p_get_base_uart(int dev_index)
 {
        u32 offset = dev_index * sizeof(struct s5p_uart);
@@ -61,7 +63,6 @@ static const int udivslot[] = {
 
 void serial_setbrg_dev(const int dev_index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
        u32 uclk = get_uart_clk(dev_index);
        u32 baudrate = gd->baudrate;
index bfdb2ce77a3b9baea4e1e4f3a1182458102f57b0..0103a291865a71d42bfc0f6903233a9fbf36745c 100644 (file)
@@ -21,6 +21,8 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_CONS_SCIF0)
 # define SCIF_BASE     SCIF0_BASE
 #elif defined(CONFIG_CONS_SCIF1)
 
 void serial_setbrg(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        writeb(SCBRR_VALUE(gd->baudrate, CONFIG_SYS_CLK_FREQ), SCBRR);
 }