public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Kirkwood: bugfix: DRAM size initialization
@ 2010-10-14 12:47 Tanmay Upadhyay
  2010-10-14 13:48 ` g_remlin
  2010-10-15 11:58 ` Tanmay Upadhyay
  0 siblings, 2 replies; 3+ messages in thread
From: Tanmay Upadhyay @ 2010-10-14 12:47 UTC (permalink / raw)
  To: u-boot

If start of any DRAM bank is greater than total DDR size, remaining
DDR bank sizes were left un-initialized in dram_init function. This
could break other functions who uses array 'gd->bd->bi_dram'.Kirkwood
network driver is one example.

Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
---
 arch/arm/cpu/arm926ejs/kirkwood/dram.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
index 7439c87..cb396d1 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
@@ -81,6 +81,13 @@ int dram_init(void)
 		gd->ram_size += gd->bd->bi_dram[i].size;
 
 	}
+
+	for (; i < CONFIG_NR_DRAM_BANKS; i++) {
+		/* If above loop terminated prematurely, we need to set
+		 * remaining bank sizes as 0 */
+		gd->bd->bi_dram[i].size = 0;
+	}
+
 	return 0;
 }
 
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-15 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-14 12:47 [U-Boot] [PATCH] Kirkwood: bugfix: DRAM size initialization Tanmay Upadhyay
2010-10-14 13:48 ` g_remlin
2010-10-15 11:58 ` Tanmay Upadhyay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox