From patchwork Fri Mar 18 08:09:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rogan Dawes X-Patchwork-Id: 87502 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B1582B6FDE for ; Fri, 18 Mar 2011 19:14:41 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 602912823E; Fri, 18 Mar 2011 09:14:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hzMiDOTWwhzY; Fri, 18 Mar 2011 09:14:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F2F228229; Fri, 18 Mar 2011 09:14:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 98AC02821C for ; Fri, 18 Mar 2011 09:14:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F4RPWDaJ0ewb for ; Fri, 18 Mar 2011 09:14:14 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by theia.denx.de (Postfix) with ESMTPS id 7D7EF281FD for ; Fri, 18 Mar 2011 09:14:05 +0100 (CET) Received: by iyi12 with SMTP id 12so3490025iyi.3 for ; Fri, 18 Mar 2011 01:14:04 -0700 (PDT) Received: by 10.43.50.74 with SMTP id vd10mr1277405icb.16.1300436044183; Fri, 18 Mar 2011 01:14:04 -0700 (PDT) Received: from localhost.localdomain (196-215-42-15.dynamic.isadsl.co.za [196.215.42.15]) by mx.google.com with ESMTPS id uf10sm1721078icb.17.2011.03.18.01.14.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 01:14:03 -0700 (PDT) From: rogan@dawes.za.net To: u-boot@lists.denx.de Date: Fri, 18 Mar 2011 10:09:59 +0200 Message-Id: <1300435803-4940-4-git-send-email-rogan@dawes.za.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <4D81FE7F.8090002@dawes.za.net> References: <4D81FE7F.8090002@dawes.za.net> Subject: [U-Boot] [PATCH 3/7] Allow setting CONFIG_NR_DRAM_BANKS to a larger value X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Rogan Dawes This allows us to match the exact behaviour of the vendor U-boot in the kernel boot logs --- arch/arm/cpu/arm926ejs/orion5x/dram.c | 2 +- common/memsize.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/orion5x/dram.c b/arch/arm/cpu/arm926ejs/orion5x/dram.c index 2ae8f48..f5840ac 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/dram.c +++ b/arch/arm/cpu/arm926ejs/orion5x/dram.c @@ -44,7 +44,7 @@ u32 orion5x_sdram_bar(enum memory_bank bank) u32 enable = 0x01 & winregs[bank].size; if ((!enable) || (bank > BANK3)) - return 0; + return -1; result = winregs[bank].base; return result; diff --git a/common/memsize.c b/common/memsize.c index 6c275c9..85eca54 100644 --- a/common/memsize.c +++ b/common/memsize.c @@ -46,6 +46,9 @@ long get_ram_size(volatile long *base, long maxsize) long size; int i = 0; + if (base == -1) + return 0; + for (cnt = (maxsize / sizeof (long)) >> 1; cnt > 0; cnt >>= 1) { addr = base + cnt; /* pointer arith! */ sync ();