#include <asm/mach/arch.h>
#include <asm/mach/map.h>
+#include <mach/mtk_memcfg.h>
#include "mm.h"
#ifdef CONFIG_ZONE_DMA
-unsigned long arm_dma_zone_size __read_mostly;
+phys_addr_t arm_dma_zone_size __read_mostly;
EXPORT_SYMBOL(arm_dma_zone_size);
/*
BUG_ON(!arm_memblock_steal_permitted);
- phys = memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE);
+ phys = memblock_alloc_base(size, align, MEMBLOCK_ALLOC_NOPASR);
memblock_free(phys, size);
memblock_remove(phys, size);
+ if (phys) {
+ MTK_MEMCFG_LOG_AND_PRINTK(KERN_ALERT"[PHY layout]%ps : 0x%08llx - 0x%08llx (0x%08llx)\n",
+ __builtin_return_address(0), (unsigned long long)phys,
+ (unsigned long long)phys + size - 1,
+ (unsigned long long)size);
+ }
return phys;
}
+__attribute__((weak)) extern struct ion_platform_data ion_drv_platform_data;
+__attribute__((weak)) extern void __init ion_reserve(struct ion_platform_data *data);
+
void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
{
int i;
if (mdesc->reserve)
mdesc->reserve();
+ early_init_fdt_scan_reserved_mem();
+
+ //reserve for ion_carveout_heap
+ if(ion_reserve && (&ion_drv_platform_data))
+ ion_reserve(&ion_drv_platform_data);
/*
* reserve memory for DMA contigouos allocations,
* must come from DMA area inside low memory
#define MLM(b, t) b, t, ((t) - (b)) >> 20
#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K)
- printk(KERN_NOTICE "Virtual kernel memory layout:\n"
+ MTK_MEMCFG_LOG_AND_PRINTK(KERN_NOTICE "Virtual kernel memory layout:\n"
" vector : 0x%08lx - 0x%08lx (%4ld kB)\n"
#ifdef CONFIG_HAVE_TCM
" DTCM : 0x%08lx - 0x%08lx (%4ld kB)\n"