Skip to content

Commit

Permalink
wandboard: Fix wand_reserve function for any wandboard version
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgar committed Aug 4, 2013
1 parent 221c4be commit f77f226
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions arch/arm/mach-mx6/board-wand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -37,6 +38,7 @@
#include <mach/iomux-v3.h>
#include <mach/mx6.h>


#include "crm_regs.h"
#include "devices-imx6q.h"
#include "usb.h"
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit f77f226

Please sign in to comment.