2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 04:34:11 +08:00

h8300: switch to NO_BOOTMEM

Commit 0fa1c57934 ("of/fdt: use memblock_virt_alloc for early alloc")
inadvertently switched the DT unflattening allocations from memblock to
bootmem which doesn't work because the unflattening happens before
bootmem is initialized. Swapping the order of bootmem init and
unflattening could also fix this, but removing bootmem is desired. So
enable NO_BOOTMEM on h8300 like other architectures have done.

Fixes: 0fa1c57934 ("of/fdt: use memblock_virt_alloc for early alloc")
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: uclinux-h8-devel@lists.sourceforge.jp
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
This commit is contained in:
Rob Herring 2018-03-16 16:33:06 -05:00 committed by Yoshinori Sato
parent 811d1b0e65
commit c489dfefe7
2 changed files with 9 additions and 28 deletions

View File

@ -16,6 +16,7 @@ config H8300
select OF_IRQ select OF_IRQ
select OF_EARLY_FLATTREE select OF_EARLY_FLATTREE
select HAVE_MEMBLOCK select HAVE_MEMBLOCK
select NO_BOOTMEM
select TIMER_OF select TIMER_OF
select H8300_TMR8 select H8300_TMR8
select HAVE_KERNEL_GZIP select HAVE_KERNEL_GZIP

View File

@ -71,10 +71,6 @@ void __init h8300_fdt_init(void *fdt, char *bootargs)
static void __init bootmem_init(void) static void __init bootmem_init(void)
{ {
int bootmap_size;
unsigned long ram_start_pfn;
unsigned long free_ram_start_pfn;
unsigned long ram_end_pfn;
struct memblock_region *region; struct memblock_region *region;
memory_end = memory_start = 0; memory_end = memory_start = 0;
@ -88,33 +84,17 @@ static void __init bootmem_init(void)
if (!memory_end) if (!memory_end)
panic("No memory!"); panic("No memory!");
ram_start_pfn = PFN_UP(memory_start); /* setup bootmem globals (we use no_bootmem, but mm still depends on this) */
/* free_ram_start_pfn is first page after kernel */ min_low_pfn = PFN_UP(memory_start);
free_ram_start_pfn = PFN_UP(__pa(_end)); max_low_pfn = PFN_DOWN(memblock_end_of_DRAM());
ram_end_pfn = PFN_DOWN(memblock_end_of_DRAM()); max_pfn = max_low_pfn;
max_pfn = ram_end_pfn; memblock_reserve(__pa(_stext), _end - _stext);
/* early_init_fdt_reserve_self();
* give all the memory to the bootmap allocator, tell it to put the early_init_fdt_scan_reserved_mem();
* boot mem_map at the start of memory
*/
bootmap_size = init_bootmem_node(NODE_DATA(0),
free_ram_start_pfn,
0,
ram_end_pfn);
/*
* free the usable memory, we have to make sure we do not free
* the bootmem bitmap so we then reserve it after freeing it :-)
*/
free_bootmem(PFN_PHYS(free_ram_start_pfn),
(ram_end_pfn - free_ram_start_pfn) << PAGE_SHIFT);
reserve_bootmem(PFN_PHYS(free_ram_start_pfn), bootmap_size,
BOOTMEM_DEFAULT);
for_each_memblock(reserved, region) { memblock_dump_all();
reserve_bootmem(region->base, region->size, BOOTMEM_DEFAULT);
}
} }
void __init setup_arch(char **cmdline_p) void __init setup_arch(char **cmdline_p)