Skip to content

Commit 3194ac6

Browse files
daviddaneywildea01
authored andcommitted
arm64: Move unflatten_device_tree() call earlier.
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 <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 298535c commit 3194ac6

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

arch/arm64/include/asm/mmu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ typedef struct {
2929
#define ASID(mm) ((mm)->context.id.counter & 0xffff)
3030

3131
extern void paging_init(void);
32+
extern void bootmem_init(void);
3233
extern void __iomem *early_io_map(phys_addr_t phys, unsigned long virt);
3334
extern void init_mem_pgprot(void);
3435
extern void create_pgd_mapping(struct mm_struct *mm, phys_addr_t phys,

arch/arm64/kernel/setup.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,18 +265,22 @@ void __init setup_arch(char **cmdline_p)
265265

266266
paging_init();
267267

268+
if (acpi_disabled)
269+
unflatten_device_tree();
270+
271+
bootmem_init();
272+
268273
kasan_init();
269274

270275
request_standard_resources();
271276

272277
early_ioremap_reset();
273278

274-
if (acpi_disabled) {
275-
unflatten_device_tree();
279+
if (acpi_disabled)
276280
psci_dt_init();
277-
} else {
281+
else
278282
psci_acpi_init();
279-
}
283+
280284
xen_early_init();
281285

282286
cpu_read_bootcpu_ops();

arch/arm64/mm/mm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
extern void __init bootmem_init(void);
21

32
void fixup_init(void);

arch/arm64/mm/mmu.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,6 @@ void __init paging_init(void)
564564
*/
565565
memblock_free(__pa(swapper_pg_dir) + PAGE_SIZE,
566566
SWAPPER_DIR_SIZE - PAGE_SIZE);
567-
568-
bootmem_init();
569567
}
570568

571569
/*

0 commit comments

Comments
 (0)