Skip to content

Commit 4d8106f

Browse files
rpptmosalter
authored andcommitted
c6x: switch to NO_BOOTMEM
The c6x is already using memblock and does most of early memory reservations with it, so it was only a matter of removing the bootmem initialization and handover of the memory from memblock to bootmem. Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Mark Salter <msalter@redhat.com>
1 parent b59dfda commit 4d8106f

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

arch/c6x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config C6X
1414
select GENERIC_IRQ_SHOW
1515
select HAVE_ARCH_TRACEHOOK
1616
select HAVE_MEMBLOCK
17+
select NO_BOOTMEM
1718
select SPARSE_IRQ
1819
select IRQ_DOMAIN
1920
select OF

arch/c6x/kernel/setup.c

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ notrace void __init machine_init(unsigned long dt_ptr)
291291

292292
void __init setup_arch(char **cmdline_p)
293293
{
294-
int bootmap_size;
295294
struct memblock_region *reg;
296295

297296
printk(KERN_INFO "Initializing kernel\n");
@@ -348,16 +347,6 @@ void __init setup_arch(char **cmdline_p)
348347
init_mm.end_data = memory_start;
349348
init_mm.brk = memory_start;
350349

351-
/*
352-
* Give all the memory to the bootmap allocator, tell it to put the
353-
* boot mem_map at the start of memory
354-
*/
355-
bootmap_size = init_bootmem_node(NODE_DATA(0),
356-
memory_start >> PAGE_SHIFT,
357-
PAGE_OFFSET >> PAGE_SHIFT,
358-
memory_end >> PAGE_SHIFT);
359-
memblock_reserve(memory_start, bootmap_size);
360-
361350
unflatten_and_copy_device_tree();
362351

363352
c6x_cache_init();
@@ -392,22 +381,9 @@ void __init setup_arch(char **cmdline_p)
392381
/* Initialize the coherent memory allocator */
393382
coherent_mem_init(dma_start, dma_size);
394383

395-
/*
396-
* Free all memory as a starting point.
397-
*/
398-
free_bootmem(PAGE_OFFSET, memory_end - PAGE_OFFSET);
399-
400-
/*
401-
* Then reserve memory which is already being used.
402-
*/
403-
for_each_memblock(reserved, reg) {
404-
pr_debug("reserved - 0x%08x-0x%08x\n",
405-
(u32) reg->base, (u32) reg->size);
406-
reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT);
407-
}
408-
409384
max_low_pfn = PFN_DOWN(memory_end);
410385
min_low_pfn = PFN_UP(memory_start);
386+
max_pfn = max_low_pfn;
411387
max_mapnr = max_low_pfn - min_low_pfn;
412388

413389
/* Get kmalloc into gear */

0 commit comments

Comments
 (0)