Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759261AbcDHWuv (ORCPT ); Fri, 8 Apr 2016 18:50:51 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:33195 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759189AbcDHWuq (ORCPT ); Fri, 8 Apr 2016 18:50:46 -0400 From: David Daney To: Will Deacon , linux-arm-kernel@lists.infradead.org, Rob Herring , Frank Rowand , Grant Likely , Pawel Moll , Ian Campbell , Kumar Gala , Ganapatrao Kulkarni , Robert Richter , Ard Biesheuvel , Matt Fleming , Mark Rutland , Catalin Marinas Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, David Daney Subject: [PATCH v16 4/6] arm64: Move unflatten_device_tree() call earlier. Date: Fri, 8 Apr 2016 15:50:26 -0700 Message-Id: <1460155828-8690-5-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1460155828-8690-1-git-send-email-ddaney.cavm@gmail.com> References: <1460155828-8690-1-git-send-email-ddaney.cavm@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2418 Lines: 89 From: David Daney 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 --- arch/arm64/include/asm/mmu.h | 1 + arch/arm64/kernel/setup.c | 13 +++++++++---- arch/arm64/mm/mm.h | 1 - arch/arm64/mm/mmu.c | 2 -- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h index 990124a..97b1d8f 100644 --- a/arch/arm64/include/asm/mmu.h +++ b/arch/arm64/include/asm/mmu.h @@ -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, diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 9dc6776..9bd237e 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -327,6 +327,12 @@ void __init setup_arch(char **cmdline_p) acpi_boot_table_init(); paging_init(); + + if (acpi_disabled) + unflatten_device_tree(); + + bootmem_init(); + relocate_initrd(); kasan_init(); @@ -335,12 +341,11 @@ void __init setup_arch(char **cmdline_p) 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(); diff --git a/arch/arm64/mm/mm.h b/arch/arm64/mm/mm.h index ef47d99..71fe989 100644 --- a/arch/arm64/mm/mm.h +++ b/arch/arm64/mm/mm.h @@ -1,3 +1,2 @@ -extern void __init bootmem_init(void); void fixup_init(void); diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index f3e5c74..267903b 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -564,8 +564,6 @@ void __init paging_init(void) */ memblock_free(__pa(swapper_pg_dir) + PAGE_SIZE, SWAPPER_DIR_SIZE - PAGE_SIZE); - - bootmem_init(); } /* -- 1.8.3.1