From patchwork Fri Mar 18 08:04:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rogan Dawes X-Patchwork-Id: 87495 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 A9CD3B6F0D for ; Fri, 18 Mar 2011 19:06:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 25119281B3; Fri, 18 Mar 2011 09:06:05 +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 tVV2SJq2BJ2g; Fri, 18 Mar 2011 09:06:04 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9D923281B8; Fri, 18 Mar 2011 09:05:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 630372819A for ; Fri, 18 Mar 2011 09:05:44 +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 2vghnEzZzyCp for ; Fri, 18 Mar 2011 09:05:43 +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-wy0-f172.google.com (mail-wy0-f172.google.com [74.125.82.172]) by theia.denx.de (Postfix) with ESMTPS id 7EF5B2819D for ; Fri, 18 Mar 2011 09:05:31 +0100 (CET) Received: by mail-wy0-f172.google.com with SMTP id 42so3264954wyb.3 for ; Fri, 18 Mar 2011 01:05:31 -0700 (PDT) Received: by 10.227.159.77 with SMTP id i13mr854967wbx.177.1300435531388; Fri, 18 Mar 2011 01:05:31 -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 y12sm260049wby.25.2011.03.18.01.05.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 01:05:30 -0700 (PDT) From: rogan@dawes.za.net To: u-boot@lists.denx.de Date: Fri, 18 Mar 2011 10:04:56 +0200 Message-Id: <1300435500-4909-8-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 07/11] 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.za.net 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 90b0a9c..e677ce4 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 ();