From patchwork Tue Apr 30 20:22:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 240687 X-Patchwork-Delegate: trini@ti.com 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 7A0292C00B9 for ; Wed, 1 May 2013 06:30:39 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F2E454A2A6; Tue, 30 Apr 2013 22:30:25 +0200 (CEST) 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 VElb2Isnvhgu; Tue, 30 Apr 2013 22:30:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3200D4A29C; Tue, 30 Apr 2013 22:30:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D80E94A28F for ; Tue, 30 Apr 2013 22:29:53 +0200 (CEST) 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 AlXzDYnvAUZO for ; Tue, 30 Apr 2013 22:29:48 +0200 (CEST) X-Greylist: delayed 439 seconds by postgrey-1.27 at theia; Tue, 30 Apr 2013 22:29:38 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from mail-yh0-f73.google.com (mail-yh0-f73.google.com [209.85.213.73]) by theia.denx.de (Postfix) with ESMTPS id 677544A28E for ; Tue, 30 Apr 2013 22:29:38 +0200 (CEST) Received: by mail-yh0-f73.google.com with SMTP id f35so99161yha.0 for ; Tue, 30 Apr 2013 13:29:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=EGlf1JHRQ6uFPZV+2JIqLiIsS10G17KB5Zq92dO5A/o=; b=L/Hx7H09rAhtsYnZwn8c1YJ/6HBttMPLlLf72L80djmanTCaD+CZYSgQOUwp107ZMY g1cVVmNMA8O9nIHEFScVotb5St564wgRDb6r3/xWYJlVIWJJx0cQ9HcE/aKYSm1XINL1 Ma+99xAow6ypyk/OYp7qGD3p6M9vaqAgi/ultc125sb427wF04gYNjKo1xrKYeyFdHec 5MJ0OEoqrEbA0S82hesjac0FyVVO0DfX2v/sqYTrIHLdwJJg6TI3FTIMxt4fRJR8r17S JcmDwvsMmRrpdHUVwsUkE8U+JXpPGKmb+k9pbIJtfcc15ibiUO2RFd3MWWSLinUmnR2K DEhg== X-Received: by 10.236.143.177 with SMTP id l37mr32979777yhj.9.1367353338062; Tue, 30 Apr 2013 13:22:18 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id i36si459364yhb.3.2013.04.30.13.22.18 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Tue, 30 Apr 2013 13:22:18 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.162.34]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id E28195A4005; Tue, 30 Apr 2013 13:22:17 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 83CB38076A; Tue, 30 Apr 2013 13:22:17 -0700 (PDT) From: Doug Anderson To: Gerald Van Baren , Tom Rini Date: Tue, 30 Apr 2013 13:22:00 -0700 Message-Id: <1367353321-21204-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 1.8.2.1 X-Gm-Message-State: ALoCoQnbwPM/bwGWMOfOxv7oEiqnylg34QqOu5DiW/xPZYV4FA0JPA3Vc70lZV6/EQ5NIjUwy6fZsGNcKER9OJvvznwwrdTNt4QvqKAfzPFdI9m5TrA4TkJjREsf3IucV7Iv25O6uWWiVXNB8zXfarQJkH1wjD4WqFb6bwdCyJi5gWJzHdf+RB0X8HHlFt8U8McMk28VQMPQ Cc: u-boot@lists.denx.de, Vadim Bendebury Subject: [U-Boot] [PATCH] fdt_support: Use CONFIG_NR_DRAM_BANKS if defined X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 It appears that there are some cases where we have more than 4 banks of memory. Use CONFIG_NR_DRAM_BANKS if it's defined to handle this. This will take up a little extra stack space (64 bytes extra if we go up to 8 banks), but that seems OK. Signed-off-by: Doug Anderson Acked-by: Gerald Van Baren --- Note: nothing in-tree has 8 banks defined yet, but some configs have it defined that are not in tree yet. common/fdt_support.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/fdt_support.c b/common/fdt_support.c index 812acb4..416100e 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -387,7 +387,11 @@ static void write_cell(u8 *addr, u64 val, int size) } } +#ifdef CONFIG_NR_DRAM_BANKS +#define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS +#else #define MEMORY_BANKS_MAX 4 +#endif int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks) { int err, nodeoffset;