From patchwork Mon Jul 15 14:40:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 18363 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0349D25E13 for ; Mon, 15 Jul 2013 14:41:04 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id kw10sf14173443vcb.7 for ; Mon, 15 Jul 2013 07:41:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=eImQ9ZDcLmIiuh/BLAKM23hXTfzzEwkBd+hfBbTVyxA=; b=i5llcZfpWVl7w6V1ZRVMTlc4qjRZuc+m+esqWTShJlVO5FKpkMM8nmUzqKJgIcIzb+ tU/YjRVwLRGe+O+uG4z8CLDwG+DasDGM31o72lGQCdlfEpd0kfg1RBBso+RFA8DrM5Si oP+smASdolhmeLDZ3NA2EqIU5/6i8hHat5FOToSpegyM7iXnKdRYA3fdJ/tknN8WdFDS Ex6XkyAnkNL2ZNAUeKb9iTHvULtH1DRyF8zwdvVtjbVouc8G2ZN/DEgLPH79T+Tbwliu xTMmJoG3sLBunliTrlLSECEb2NbmYcVS1qqcIW5hEaAWsy49iINK4Ux1YG9zbUtImww7 CPMA== X-Received: by 10.236.93.113 with SMTP id k77mr28659394yhf.25.1373899264459; Mon, 15 Jul 2013 07:41:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.25.164 with SMTP id d4ls4713486qeg.34.gmail; Mon, 15 Jul 2013 07:41:04 -0700 (PDT) X-Received: by 10.52.94.83 with SMTP id da19mr23776218vdb.101.1373899264334; Mon, 15 Jul 2013 07:41:04 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id to9si14845839vdc.19.2013.07.15.07.41.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jul 2013 07:41:04 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id d10so9963751vea.38 for ; Mon, 15 Jul 2013 07:41:04 -0700 (PDT) X-Received: by 10.52.91.202 with SMTP id cg10mr24081827vdb.85.1373899263780; Mon, 15 Jul 2013 07:41:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.149.77 with SMTP id s13csp72727vcv; Mon, 15 Jul 2013 07:41:03 -0700 (PDT) X-Received: by 10.194.122.71 with SMTP id lq7mr31539384wjb.77.1373899262769; Mon, 15 Jul 2013 07:41:02 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id fx15si5049793wic.56.2013.07.15.07.41.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jul 2013 07:41:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.212.178; Received: by mail-wi0-f178.google.com with SMTP id k10so2949588wiv.17 for ; Mon, 15 Jul 2013 07:41:02 -0700 (PDT) X-Received: by 10.180.12.243 with SMTP id b19mr9055851wic.6.1373899262193; Mon, 15 Jul 2013 07:41:02 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id u9sm21370032wif.6.2013.07.15.07.41.00 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jul 2013 07:41:01 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, Stefano.Stabellini@eu.citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH] xen/arm: Dummy implementation of multi-bank support Date: Mon, 15 Jul 2013 15:40:55 +0100 Message-Id: <1373899255-19064-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlvID40xg4Rb82pHYsWzxGlMZGHJNXJC/cHMRq417ApYsm5bat8Fuz2esv1jH+CNTo8G9u5 X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , U-boot for the arndale board splits the memory in 8 contiguous banks and rewrites the memory node. So most of the memory is lost. As the frametable is only able to handle contiguous memory, use the first contiguous banks and warn if some of the memory banks are not used. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/setup.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index b192d15..ead51b8 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -288,16 +288,27 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) unsigned long heap_pages, xenheap_pages, domheap_pages; unsigned long dtb_pages; unsigned long boot_mfn_start, boot_mfn_end; + int i = 0; - /* - * TODO: only using the first RAM bank for now. The heaps and the - * frame table assume RAM is physically contiguous. - */ - if ( early_info.mem.nr_banks > 1 ) - early_printk("WARNING: Only using first bank of memory\n"); + /* TODO: Handle non-contiguous memory bank */ + if ( !early_info.mem.nr_banks ) + early_panic("No memory bank\n"); ram_start = early_info.mem.bank[0].start; ram_size = early_info.mem.bank[0].size; ram_end = ram_start + ram_size; + + for ( i = 1; i < early_info.mem.nr_banks; i++ ) + { + if ( ram_end != early_info.mem.bank[i].start ) + break; + + ram_size += early_info.mem.bank[i].size; + ram_end += early_info.mem.bank[i].size; + } + + if ( i != early_info.mem.nr_banks ) + early_printk("WARNING: some banks are not used\n"); + total_pages = ram_pages = ram_size >> PAGE_SHIFT; /*