From 279c8283db09b1168fce83fc9851ca8b36ea07f8 Mon Sep 17 00:00:00 2001 From: Vaibhav Hiremath Date: Mon, 29 Nov 2010 16:36:10 -0500 Subject: AM3517:EMIF4: fix SDRAM size to 256Mb With addition of "dram_init_banksize()" function from Heiko,Schocher (commit ID: 561142af20f1fd7b425d9425730014e656defb91), the DRAM size is getting configured wrongly to 512Mb (CS0 & CS1). So fix it to 256Mb. Signed-off-by: Vaibhav Hiremath Signed-off-by: Sandeep Paulraj --- arch/arm/cpu/armv7/omap3/emif4.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'arch/arm/cpu/armv7/omap3') diff --git a/arch/arm/cpu/armv7/omap3/emif4.c b/arch/arm/cpu/armv7/omap3/emif4.c index 0870857..2227576 100644 --- a/arch/arm/cpu/armv7/omap3/emif4.c +++ b/arch/arm/cpu/armv7/omap3/emif4.c @@ -48,10 +48,11 @@ u32 is_mem_sdr(void) */ u32 get_sdr_cs_size(u32 cs) { - u32 size; + u32 size = 0; /* TODO: Calculate the size based on EMIF4 configuration */ - size = CONFIG_SYS_CS0_SIZE; + if (cs == CS0) + size = CONFIG_SYS_CS0_SIZE; return size; } -- cgit v1.1 From ee3894c681e3d8e6ef0f5cfe71f0b7143d864b39 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Sat, 11 Dec 2010 11:41:42 -0500 Subject: omap3: emif|sdrc: use a single global data define DECLARE_GLOBAL_DATA_PTR declarations in functions are inherently troublesome with various compilers (e.g. gcc 4.5) Signed-off-by: Nishanth Menon Signed-off-by: Sandeep Paulraj --- arch/arm/cpu/armv7/omap3/emif4.c | 3 +-- arch/arm/cpu/armv7/omap3/sdrc.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'arch/arm/cpu/armv7/omap3') 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 #include +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 #include +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); -- cgit v1.1