From: Mike Rapoport Date: Wed, 11 Nov 2009 10:03:10 +0200 Subject: [U-Boot] [PATCH] omap3: fix bi_dram initialization when CONFIG_NR_DRAM_BANKS is 1 Message-ID: <1257926592-14782-2-git-send-email-mike@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de When CONFIG_NR_DRAM_BANKS is 1 gd->bd->bi_dram[1] assignment exceeds bi_dram array bounds. Perform it only if CONFIG_NR_DRAM_BANKS is greater than 1. Signed-off-by: Mike Rapoport --- cpu/arm_cortexa8/omap3/board.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/cpu/arm_cortexa8/omap3/board.c b/cpu/arm_cortexa8/omap3/board.c index dd2c940..0b3805a 100644 --- a/cpu/arm_cortexa8/omap3/board.c +++ b/cpu/arm_cortexa8/omap3/board.c @@ -291,8 +291,11 @@ int dram_init(void) gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = size0; + +#if (CONFIG_NR_DRAM_BANKS > 1) gd->bd->bi_dram[1].start = PHYS_SDRAM_1 + get_sdr_cs_offset(CS1); gd->bd->bi_dram[1].size = size1; +#endif return 0; } -- 1.6.0.6