X-Git-Url: https://git.stricted.de/?p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git;a=blobdiff_plain;f=arch%2Farm%2Fmm%2Finit.c;h=4117a6edb857fda3429646c309a92f76f81b76ca;hp=9a5cdc01fcdfef7315ec97687c35ae28adcb7688;hb=6fa3eb70c07b7ce2061fd6602159ac2d45a7dc3d;hpb=70a3067d55b31839720db1502eafd76f36a8c1af diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 9a5cdc01fcdf..4117a6edb857 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -33,6 +33,7 @@ #include #include +#include #include "mm.h" @@ -206,7 +207,7 @@ static void __init arm_bootmem_init(unsigned long start_pfn, #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); /* @@ -327,13 +328,22 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align) 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; @@ -376,6 +386,11 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) 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 @@ -600,7 +615,7 @@ void __init mem_init(void) #ifdef CONFIG_SA1111 /* now that our DMA memory is actually so designated, we can free it */ - free_reserved_area(__va(PHYS_PFN_OFFSET), swapper_pg_dir, 0, NULL); + free_reserved_area(__va(PHYS_OFFSET), swapper_pg_dir, 0, NULL); #endif free_highpages(); @@ -651,7 +666,7 @@ void __init mem_init(void) #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"