Commit 0b8813cc authored by David Daney's avatar David Daney Committed by Tim Gardner

UBUNTU: SAUCE: (noup) arm64: Move unflatten_device_tree() call earlier.

BugLink: http://bugs.launchpad.net/bugs/1558765

In order to extract NUMA information from the device tree, we need to
have the tree in its unflattened form.

Split paging_init() into two pieces.  The first piece maps memory so
that unflatten_device_tree(), can allocate memory.  The second piece
containing the bootmem_init() call that will be patched in a follow-on
patch to add NUMA handling.

Move the unflatten_device_tree() call between the two new pieces.
Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
[ dannf: v15 submittal ]
Reference: http://www.spinics.net/lists/arm-kernel/msg489637.htmlSigned-off-by: default avatardann frazier <dann.frazier@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 84d33e02
...@@ -28,7 +28,8 @@ typedef struct { ...@@ -28,7 +28,8 @@ typedef struct {
*/ */
#define ASID(mm) ((mm)->context.id.counter & 0xffff) #define ASID(mm) ((mm)->context.id.counter & 0xffff)
extern void paging_init(void); extern void paging_init_map_mem(void);
extern void paging_init_rest(void);
extern void __iomem *early_io_map(phys_addr_t phys, unsigned long virt); extern void __iomem *early_io_map(phys_addr_t phys, unsigned long virt);
extern void init_mem_pgprot(void); extern void init_mem_pgprot(void);
extern void create_pgd_mapping(struct mm_struct *mm, phys_addr_t phys, extern void create_pgd_mapping(struct mm_struct *mm, phys_addr_t phys,
......
...@@ -319,7 +319,13 @@ void __init setup_arch(char **cmdline_p) ...@@ -319,7 +319,13 @@ void __init setup_arch(char **cmdline_p)
/* Parse the ACPI tables for possible boot-time configuration */ /* Parse the ACPI tables for possible boot-time configuration */
acpi_boot_table_init(); acpi_boot_table_init();
paging_init(); paging_init_map_mem();
if (acpi_disabled)
unflatten_device_tree();
paging_init_rest();
relocate_initrd(); relocate_initrd();
kasan_init(); kasan_init();
...@@ -328,12 +334,11 @@ void __init setup_arch(char **cmdline_p) ...@@ -328,12 +334,11 @@ void __init setup_arch(char **cmdline_p)
early_ioremap_reset(); early_ioremap_reset();
if (acpi_disabled) { if (acpi_disabled)
unflatten_device_tree();
psci_dt_init(); psci_dt_init();
} else { else
psci_acpi_init(); psci_acpi_init();
}
xen_early_init(); xen_early_init();
cpu_read_bootcpu_ops(); cpu_read_bootcpu_ops();
......
...@@ -439,18 +439,23 @@ void fixup_init(void) ...@@ -439,18 +439,23 @@ void fixup_init(void)
} }
/* /*
* paging_init() sets up the page tables, initialises the zone memory * paging_init_map_mem() sets up the page tables so that memblock
* maps and sets up the zero page. * memory is usable.
*/ */
void __init paging_init(void) void __init paging_init_map_mem(void)
{ {
void *zero_page;
map_mem(); map_mem();
fixup_executable(); fixup_executable();
}
/*
* paging_init_rest() finishes setting up the page tables, initializes
* the zone memory maps and sets up the zero page.
*/
void __init paging_init_rest(void)
{
/* allocate the zero page. */ /* allocate the zero page. */
zero_page = early_alloc(PAGE_SIZE); void *zero_page = early_alloc(PAGE_SIZE);
bootmem_init(); bootmem_init();
......
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