diff options
author | Stephan Rafin <stephan.rafin@laposte.net> | 2012-09-24 15:15:42 +0800 |
---|---|---|
committer | John Weber <rjohnweber@gmail.com> | 2013-08-04 00:51:52 -0500 |
commit | e5099d323a8a37fc4b1a52b7b15069ad762b3565 (patch) | |
tree | 5fb42dd951c379879bd2531257b0688e86625f59 | |
parent | cf7575098a67ec2fc611da026be7876c67c24f7c (diff) |
wandboard: Fix wand_reserve function for any wandboard version
(cherry picked from commit f77f22601e4f4bcbf3e14a48266a4fe3fa56e6e0)
-rw-r--r-- | arch/arm/mach-mx6/board-wand.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/arm/mach-mx6/board-wand.c b/arch/arm/mach-mx6/board-wand.c index d12c677127a1..aa53d6e1d3d8 100644 --- a/arch/arm/mach-mx6/board-wand.c +++ b/arch/arm/mach-mx6/board-wand.c @@ -20,6 +20,7 @@ #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> +#include <asm/setup.h> #include <linux/clk.h> #include <linux/delay.h> @@ -37,6 +38,7 @@ #include <mach/iomux-v3.h> #include <mach/mx6.h> + #include "crm_regs.h" #include "devices-imx6q.h" #include "usb.h" @@ -1201,20 +1203,16 @@ static struct sys_timer wand_timer = { static void __init wand_reserve(void) { phys_addr_t phys; + struct meminfo *mi = &meminfo; + unsigned long total_mem = 0; + int i; if (wand_gpu_pdata.reserved_mem_size) { - if (cpu_is_mx6q()) - phys = memblock_alloc_base( - wand_gpu_pdata.reserved_mem_size, - SZ_4K, SZ_2G); - else if (cpu_is_mx6dl()) - phys = memblock_alloc_base( - wand_gpu_pdata.reserved_mem_size, - SZ_4K, SZ_1G); - else - phys = memblock_alloc_base( + for (i = 0; i < mi->nr_banks; i++) + total_mem += mi->bank[i].size; + phys = memblock_alloc_base( wand_gpu_pdata.reserved_mem_size, - SZ_4K, SZ_512M); + SZ_4K, total_mem); memblock_remove(phys, wand_gpu_pdata.reserved_mem_size); wand_gpu_pdata.reserved_mem_base = phys; } |