diff mbox

[U-Boot] omap3: emif|sdrc: use a single global data define

Message ID 1291766944-17367-1-git-send-email-nm@ti.com
State Accepted
Commit ee3894c681e3d8e6ef0f5cfe71f0b7143d864b39
Delegated to: Sandeep Paulraj
Headers show

Commit Message

Nishanth Menon Dec. 8, 2010, 12:09 a.m. UTC
DECLARE_GLOBAL_DATA_PTR declarations in functions are inherently
troublesome with various compilers (e.g. gcc 4.5)

Signed-off-by: Nishanth Menon <nm@ti.com>
---
Similar to the fix I did in:
http://marc.info/?t=128803773500004&r=1&w=2
for OMAP4
 arch/arm/cpu/armv7/omap3/emif4.c |    3 +--
 arch/arm/cpu/armv7/omap3/sdrc.c  |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Sandeep Paulraj Dec. 11, 2010, 4:42 p.m. UTC | #1
> 
> DECLARE_GLOBAL_DATA_PTR declarations in functions are inherently
> troublesome with various compilers (e.g. gcc 4.5)
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
> Similar to the fix I did in:
> http://marc.info/?t=128803773500004&r=1&w=2
> for OMAP4
>  arch/arm/cpu/armv7/omap3/emif4.c |    3 +--
>  arch/arm/cpu/armv7/omap3/sdrc.c  |    3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)


Applied to u-boot-ti

Regards,
Sandeep
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/omap3/emif4.c b/arch/arm/cpu/armv7/omap3/emif4.c
index 2227576..3085637 100644
--- a/arch/arm/cpu/armv7/omap3/emif4.c
+++ b/arch/arm/cpu/armv7/omap3/emif4.c
@@ -29,6 +29,7 @@ 
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/emif4.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 extern omap3_sysinfo sysinfo;
 
 static emif4_t *emif4_base = (emif4_t *)OMAP34XX_SDRC_BASE;
@@ -139,7 +140,6 @@  void do_emif4_init(void)
  */
 int dram_init(void)
 {
-	DECLARE_GLOBAL_DATA_PTR;
 	unsigned int size0 = 0, size1 = 0;
 
 	size0 = get_sdr_cs_size(CS0);
@@ -157,7 +157,6 @@  int dram_init(void)
 
 void dram_init_banksize (void)
 {
-	DECLARE_GLOBAL_DATA_PTR;
 	unsigned int size0 = 0, size1 = 0;
 
 	size0 = get_sdr_cs_size(CS0);
diff --git a/arch/arm/cpu/armv7/omap3/sdrc.c b/arch/arm/cpu/armv7/omap3/sdrc.c
index a4979ce..2a7970b 100644
--- a/arch/arm/cpu/armv7/omap3/sdrc.c
+++ b/arch/arm/cpu/armv7/omap3/sdrc.c
@@ -37,6 +37,7 @@ 
 #include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
 
+DECLARE_GLOBAL_DATA_PTR;
 extern omap3_sysinfo sysinfo;
 
 static struct sdrc *sdrc_base = (struct sdrc *)OMAP34XX_SDRC_BASE;
@@ -172,7 +173,6 @@  void do_sdrc_init(u32 cs, u32 early)
  */
 int dram_init(void)
 {
-	DECLARE_GLOBAL_DATA_PTR;
 	unsigned int size0 = 0, size1 = 0;
 
 	size0 = get_sdr_cs_size(CS0);
@@ -194,7 +194,6 @@  int dram_init(void)
 
 void dram_init_banksize (void)
 {
-	DECLARE_GLOBAL_DATA_PTR;
 	unsigned int size0 = 0, size1 = 0;
 
 	size0 = get_sdr_cs_size(CS0);