From 2956532625cf8414ad3efb37598ba34db08d67ec Mon Sep 17 00:00:00 2001 From: John Rigby Date: Mon, 20 Dec 2010 18:27:51 -0700 Subject: Move DECLARE_GLOBAL_DATA_PTR to file scope 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 Fix some additional places. Signed-off-by: Wolfgang Denk Acked-By: Albert ARIBAUD --- board/renesas/MigoR/migo_r.c | 4 ++-- board/renesas/ap325rxa/ap325rxa.c | 4 ++-- board/renesas/r2dplus/r2dplus.c | 4 ++-- board/renesas/r7780mp/r7780mp.c | 4 ++-- board/renesas/rsk7203/rsk7203.c | 4 ++-- board/renesas/sh7763rdp/sh7763rdp.c | 4 ++-- board/renesas/sh7785lcr/sh7785lcr.c | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'board/renesas') diff --git a/board/renesas/MigoR/migo_r.c b/board/renesas/MigoR/migo_r.c index c0f26ac1ea..75b653f8a1 100644 --- a/board/renesas/MigoR/migo_r.c +++ b/board/renesas/MigoR/migo_r.c @@ -28,6 +28,8 @@ #include #include +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)); diff --git a/board/renesas/ap325rxa/ap325rxa.c b/board/renesas/ap325rxa/ap325rxa.c index be919f5454..758e6f4a0b 100644 --- a/board/renesas/ap325rxa/ap325rxa.c +++ b/board/renesas/ap325rxa/ap325rxa.c @@ -23,6 +23,8 @@ #include #include +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)); diff --git a/board/renesas/r2dplus/r2dplus.c b/board/renesas/r2dplus/r2dplus.c index 0c08d68594..b70395dd2b 100644 --- a/board/renesas/r2dplus/r2dplus.c +++ b/board/renesas/r2dplus/r2dplus.c @@ -28,6 +28,8 @@ #include #include +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)); diff --git a/board/renesas/r7780mp/r7780mp.c b/board/renesas/r7780mp/r7780mp.c index 396e4b6db3..0b80099047 100644 --- a/board/renesas/r7780mp/r7780mp.c +++ b/board/renesas/r7780mp/r7780mp.c @@ -26,6 +26,8 @@ #include #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)); diff --git a/board/renesas/rsk7203/rsk7203.c b/board/renesas/rsk7203/rsk7203.c index fbf2e23cf0..06552c0818 100644 --- a/board/renesas/rsk7203/rsk7203.c +++ b/board/renesas/rsk7203/rsk7203.c @@ -26,6 +26,8 @@ #include #include +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)); diff --git a/board/renesas/sh7763rdp/sh7763rdp.c b/board/renesas/sh7763rdp/sh7763rdp.c index 88bab70e35..9f44b9afb8 100644 --- a/board/renesas/sh7763rdp/sh7763rdp.c +++ b/board/renesas/sh7763rdp/sh7763rdp.c @@ -25,6 +25,8 @@ #include #include +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)); diff --git a/board/renesas/sh7785lcr/sh7785lcr.c b/board/renesas/sh7785lcr/sh7785lcr.c index cad3905ff2..904e755879 100644 --- a/board/renesas/sh7785lcr/sh7785lcr.c +++ b/board/renesas/sh7785lcr/sh7785lcr.c @@ -23,6 +23,8 @@ #include #include +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)); -- cgit v1.2.1