From patchwork Wed Sep 21 07:25:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 4209 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2DBD823F58 for ; Wed, 21 Sep 2011 07:25:29 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 22FBEA1859C for ; Wed, 21 Sep 2011 07:25:29 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 23so1925184fxe.11 for ; Wed, 21 Sep 2011 00:25:29 -0700 (PDT) Received: by 10.223.55.136 with SMTP id u8mr605816fag.46.1316589929029; Wed, 21 Sep 2011 00:25:29 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.18.198 with SMTP id y6cs111587lad; Wed, 21 Sep 2011 00:25:28 -0700 (PDT) Received: by 10.150.209.21 with SMTP id h21mr567837ybg.156.1316589927817; Wed, 21 Sep 2011 00:25:27 -0700 (PDT) Received: from mail-yx0-f178.google.com (mail-yx0-f178.google.com [209.85.213.178]) by mx.google.com with ESMTPS id k1si8233647ybf.64.2011.09.21.00.25.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Sep 2011 00:25:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) client-ip=209.85.213.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) smtp.mail=chander.kashyap@linaro.org Received: by yxj19 with SMTP id 19so2136158yxj.37 for ; Wed, 21 Sep 2011 00:25:27 -0700 (PDT) Received: by 10.68.27.193 with SMTP id v1mr972611pbg.462.1316589926465; Wed, 21 Sep 2011 00:25:26 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id h5sm14177076pbq.11.2011.09.21.00.25.22 (version=SSLv3 cipher=OTHER); Wed, 21 Sep 2011 00:25:25 -0700 (PDT) From: Chander Kashyap To: u-boot@lists.denx.de Cc: mk7.kang@samsung.com, bjlee@samsung.com, patches@linaro.org, samsung@lists.linaro.org, linaro-dev@lists.linaro.org, Chander Kashyap Subject: [PATCH 2/4] SMDKV310: use get_ram_size() to validate dram size Date: Wed, 21 Sep 2011 12:55:02 +0530 Message-Id: <1316589904-17431-3-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1316589904-17431-1-git-send-email-chander.kashyap@linaro.org> References: <1316589904-17431-1-git-send-email-chander.kashyap@linaro.org> smdkv310.c: in dram_init_banksize(void) function dram size was initialized without validation. get_ram_size() function will validate the bank size before initialization. Signed-off-by: Chander Kashyap --- board/samsung/smdkv310/smdkv310.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/board/samsung/smdkv310/smdkv310.c b/board/samsung/smdkv310/smdkv310.c index 4478b0b..d9caca7 100644 --- a/board/samsung/smdkv310/smdkv310.c +++ b/board/samsung/smdkv310/smdkv310.c @@ -74,13 +74,17 @@ int dram_init(void) void dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; - gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, \ + PHYS_SDRAM_1_SIZE); gd->bd->bi_dram[1].start = PHYS_SDRAM_2; - gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; + gd->bd->bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2, \ + PHYS_SDRAM_2_SIZE); gd->bd->bi_dram[2].start = PHYS_SDRAM_3; - gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE; + gd->bd->bi_dram[2].size = get_ram_size((long *)PHYS_SDRAM_3, \ + PHYS_SDRAM_3_SIZE); gd->bd->bi_dram[3].start = PHYS_SDRAM_4; - gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE; + gd->bd->bi_dram[3].size = get_ram_size((long *)PHYS_SDRAM_4, \ + PHYS_SDRAM_4_SIZE); } int board_eth_init(bd_t *bis)