diff options
author | Julien Grall <julien.grall@linaro.org> | 2013-07-15 15:40:55 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-07-17 10:53:23 +0100 |
commit | 4816f9a7d47f985dfa796dc632771201b10858e8 (patch) | |
tree | 0a2e3bda7d82634703a2a1d2125174d41d05d7f7 /xen/arch/arm/setup.c | |
parent | e5078b3a1b1a2fcb45197346edbd1beff4f290c4 (diff) | |
download | xen-4816f9a7d47f985dfa796dc632771201b10858e8.tar.gz xen-4816f9a7d47f985dfa796dc632771201b10858e8.tar.bz2 xen-4816f9a7d47f985dfa796dc632771201b10858e8.zip |
xen/arm: Dummy implementation of multi-bank support
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>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- "some banks" -> "some memory banks" ]
Diffstat (limited to 'xen/arch/arm/setup.c')
-rw-r--r-- | xen/arch/arm/setup.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index b192d15d51..c22972f0de 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 memory banks are not used\n"); + total_pages = ram_pages = ram_size >> PAGE_SHIFT; /* |