summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSRICHARAN R <r.sricharan@ti.com>2012-05-17 00:12:08 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-07-07 14:07:22 +0200
commit41321fd4d64492689bfad20c98b8970171aee7ce (patch)
tree683a5d2ef70a007e2a8a98e67a328a69bbffe18e
parent77efdeb7588aeae585fcde7e59cc8693df592fd7 (diff)
downloadu-boot-imx-41321fd4d64492689bfad20c98b8970171aee7ce.zip
u-boot-imx-41321fd4d64492689bfad20c98b8970171aee7ce.tar.gz
u-boot-imx-41321fd4d64492689bfad20c98b8970171aee7ce.tar.bz2
ARM: OMAP5: Align memory used for testing to the power of 2
get_ram_size checks the given memory range for valid ram, but expects the size of memory to be aligned to the power of 2. In case of OMAP5 evm board the memory available is 2GB - 16MB(used for TRAP section) = 2032MB. So always ensure that the size of memory used for testing is aligned to the power of 2. Signed-off-by: R Sricharan <r.sricharan@ti.com>
-rw-r--r--arch/arm/cpu/armv7/omap-common/emif-common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/emif-common.c b/arch/arm/cpu/armv7/omap-common/emif-common.c
index db509c9..389feda 100644
--- a/arch/arm/cpu/armv7/omap-common/emif-common.c
+++ b/arch/arm/cpu/armv7/omap-common/emif-common.c
@@ -1161,6 +1161,9 @@ void sdram_init(void)
/* Do some testing after the init */
if (!in_sdram) {
size_prog = omap_sdram_size();
+ size_prog = log_2_n_round_down(size_prog);
+ size_prog = (1 << size_prog);
+
size_detect = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
size_prog);
/* Compare with the size programmed */