From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: patches@linaro.org, ian.campbell@citrix.com,
Julien Grall <julien.grall@linaro.org>,
Stefano.Stabellini@eu.citrix.com
Subject: [PATCH] xen/arm: Dummy implementation of multi-bank support
Date: Mon, 15 Jul 2013 15:40:55 +0100 [thread overview]
Message-ID: <1373899255-19064-1-git-send-email-julien.grall@linaro.org> (raw)
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 <julien.grall@linaro.org>
---
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;
/*
--
1.7.10.4
next reply other threads:[~2013-07-15 14:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 14:40 Julien Grall [this message]
2013-07-17 10:34 ` [PATCH] xen/arm: Dummy implementation of multi-bank support Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373899255-19064-1-git-send-email-julien.grall@linaro.org \
--to=julien.grall@linaro.org \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=patches@linaro.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).