Commit 7990ac9c authored by Russell King's avatar Russell King

Merge branch 'for_3.14/arm-no-bootmem' of...

Merge branch 'for_3.14/arm-no-bootmem' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into devel-stable
parents 23f6620a 84f452b1
...@@ -62,6 +62,7 @@ config ARM ...@@ -62,6 +62,7 @@ config ARM
select IRQ_FORCED_THREADING select IRQ_FORCED_THREADING
select KTIME_SCALAR select KTIME_SCALAR
select MODULES_USE_ELF_REL select MODULES_USE_ELF_REL
select NO_BOOTMEM
select OLD_SIGACTION select OLD_SIGACTION
select OLD_SIGSUSPEND3 select OLD_SIGSUSPEND3
select PERF_USE_VMALLOC select PERF_USE_VMALLOC
......
...@@ -817,7 +817,7 @@ static void __init reserve_crashkernel(void) ...@@ -817,7 +817,7 @@ static void __init reserve_crashkernel(void)
if (ret) if (ret)
return; return;
ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE); ret = memblock_reserve(crash_base, crash_size);
if (ret < 0) { if (ret < 0) {
printk(KERN_WARNING "crashkernel reservation failed - " printk(KERN_WARNING "crashkernel reservation failed - "
"memory is in use (0x%lx)\n", (unsigned long)crash_base); "memory is in use (0x%lx)\n", (unsigned long)crash_base);
......
...@@ -145,58 +145,6 @@ static void __init find_limits(unsigned long *min, unsigned long *max_low, ...@@ -145,58 +145,6 @@ static void __init find_limits(unsigned long *min, unsigned long *max_low,
*max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]); *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]);
} }
static void __init arm_bootmem_init(unsigned long start_pfn,
unsigned long end_pfn)
{
struct memblock_region *reg;
unsigned int boot_pages;
phys_addr_t bitmap;
pg_data_t *pgdat;
/*
* Allocate the bootmem bitmap page. This must be in a region
* of memory which has already been mapped.
*/
boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
bitmap = memblock_alloc_base(boot_pages << PAGE_SHIFT, L1_CACHE_BYTES,
__pfn_to_phys(end_pfn));
/*
* Initialise the bootmem allocator, handing the
* memory banks over to bootmem.
*/
node_set_online(0);
pgdat = NODE_DATA(0);
init_bootmem_node(pgdat, __phys_to_pfn(bitmap), start_pfn, end_pfn);
/* Free the lowmem regions from memblock into bootmem. */
for_each_memblock(memory, reg) {
unsigned long start = memblock_region_memory_base_pfn(reg);
unsigned long end = memblock_region_memory_end_pfn(reg);
if (end >= end_pfn)
end = end_pfn;
if (start >= end)
break;
free_bootmem(__pfn_to_phys(start), (end - start) << PAGE_SHIFT);
}
/* Reserve the lowmem memblock reserved regions in bootmem. */
for_each_memblock(reserved, reg) {
unsigned long start = memblock_region_reserved_base_pfn(reg);
unsigned long end = memblock_region_reserved_end_pfn(reg);
if (end >= end_pfn)
end = end_pfn;
if (start >= end)
break;
reserve_bootmem(__pfn_to_phys(start),
(end - start) << PAGE_SHIFT, BOOTMEM_DEFAULT);
}
}
#ifdef CONFIG_ZONE_DMA #ifdef CONFIG_ZONE_DMA
phys_addr_t arm_dma_zone_size __read_mostly; phys_addr_t arm_dma_zone_size __read_mostly;
...@@ -236,7 +184,7 @@ void __init setup_dma_zone(const struct machine_desc *mdesc) ...@@ -236,7 +184,7 @@ void __init setup_dma_zone(const struct machine_desc *mdesc)
#endif #endif
} }
static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, static void __init zone_sizes_init(unsigned long min, unsigned long max_low,
unsigned long max_high) unsigned long max_high)
{ {
unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES]; unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
...@@ -384,7 +332,6 @@ void __init arm_memblock_init(struct meminfo *mi, ...@@ -384,7 +332,6 @@ void __init arm_memblock_init(struct meminfo *mi,
dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit)); dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit));
arm_memblock_steal_permitted = false; arm_memblock_steal_permitted = false;
memblock_allow_resize();
memblock_dump_all(); memblock_dump_all();
} }
...@@ -392,12 +339,11 @@ void __init bootmem_init(void) ...@@ -392,12 +339,11 @@ void __init bootmem_init(void)
{ {
unsigned long min, max_low, max_high; unsigned long min, max_low, max_high;
memblock_allow_resize();
max_low = max_high = 0; max_low = max_high = 0;
find_limits(&min, &max_low, &max_high); find_limits(&min, &max_low, &max_high);
arm_bootmem_init(min, max_low);
/* /*
* Sparsemem tries to allocate bootmem in memory_present(), * Sparsemem tries to allocate bootmem in memory_present(),
* so must be done after the fixed reservations * so must be done after the fixed reservations
...@@ -414,7 +360,7 @@ void __init bootmem_init(void) ...@@ -414,7 +360,7 @@ void __init bootmem_init(void)
* the sparse mem_map arrays initialized by sparse_init() * the sparse mem_map arrays initialized by sparse_init()
* for memmap_init_zone(), otherwise all PFNs are invalid. * for memmap_init_zone(), otherwise all PFNs are invalid.
*/ */
arm_bootmem_free(min, max_low, max_high); zone_sizes_init(min, max_low, max_high);
/* /*
* This doesn't seem to be used by the Linux memory manager any * This doesn't seem to be used by the Linux memory manager any
...@@ -587,7 +533,7 @@ void __init mem_init(void) ...@@ -587,7 +533,7 @@ void __init mem_init(void)
extern u32 itcm_end; extern u32 itcm_end;
#endif #endif
max_mapnr = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map; set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
/* this will put all unused low memory onto the freelists */ /* this will put all unused low memory onto the freelists */
free_unused_memmap(&meminfo); free_unused_memmap(&meminfo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment