]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arm64: Move unflatten_device_tree() call earlier.
authorDavid Daney <david.daney@cavium.com>
Fri, 8 Apr 2016 22:50:26 +0000 (15:50 -0700)
committerWill Deacon <will.deacon@arm.com>
Fri, 15 Apr 2016 17:06:08 +0000 (18:06 +0100)
In order to extract NUMA information from the device tree, we need to
have the tree in its unflattened form.

Move the call to bootmem_init() in the tail of paging_init() into
setup_arch, and adjust header files so that its declaration is
visible.

Move the unflatten_device_tree() call between the calls to
paging_init() and bootmem_init().  Follow on patches add NUMA handling
to bootmem_init().

Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/mmu.h
arch/arm64/kernel/setup.c
arch/arm64/mm/mm.h
arch/arm64/mm/mmu.c

index 990124a67eebd4b10a19ae9509cfd5b6d9ac1712..97b1d8f26b9c8aeedba43bd489b91f58e4fae76c 100644 (file)
@@ -29,6 +29,7 @@ typedef struct {
 #define ASID(mm)       ((mm)->context.id.counter & 0xffff)
 
 extern void paging_init(void);
+extern void bootmem_init(void);
 extern void __iomem *early_io_map(phys_addr_t phys, unsigned long virt);
 extern void init_mem_pgprot(void);
 extern void create_pgd_mapping(struct mm_struct *mm, phys_addr_t phys,
index 7b85b1d6a6fb111872880d43eaa6616e3236238b..432bc7f1dc45bea668e16d3cce07e7b8c44cf310 100644 (file)
@@ -265,18 +265,22 @@ void __init setup_arch(char **cmdline_p)
 
        paging_init();
 
+       if (acpi_disabled)
+               unflatten_device_tree();
+
+       bootmem_init();
+
        kasan_init();
 
        request_standard_resources();
 
        early_ioremap_reset();
 
-       if (acpi_disabled) {
-               unflatten_device_tree();
+       if (acpi_disabled)
                psci_dt_init();
-       } else {
+       else
                psci_acpi_init();
-       }
+
        xen_early_init();
 
        cpu_read_bootcpu_ops();
index ef47d99b5cbccfc5b7b06381f132f5cbda5a768b..71fe9898545517d19f0838c82dd373bd3996ba67 100644 (file)
@@ -1,3 +1,2 @@
-extern void __init bootmem_init(void);
 
 void fixup_init(void);
index dbad533076d14fbaea3cef9ea0c18d96f92d6fa1..0f85a46c3e18cf0582a8f57e3cca81aff10b0d81 100644 (file)
@@ -564,8 +564,6 @@ void __init paging_init(void)
         */
        memblock_free(__pa(swapper_pg_dir) + PAGE_SIZE,
                      SWAPPER_DIR_SIZE - PAGE_SIZE);
-
-       bootmem_init();
 }
 
 /*