From patchwork Fri Apr 8 22:50:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 8786731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6136C9F71A for ; Fri, 8 Apr 2016 22:52:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C0182011E for ; Fri, 8 Apr 2016 22:52:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9629200E5 for ; Fri, 8 Apr 2016 22:52:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aofFD-0001U9-Ga; Fri, 08 Apr 2016 22:51:15 +0000 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aofF0-0001Pa-Hl for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2016 22:51:03 +0000 Received: by mail-pa0-x242.google.com with SMTP id q6so9908373pav.0 for ; Fri, 08 Apr 2016 15:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rK3C04L+tiGDPqeQlwM4bukWCTsvMrVYTPtAYdKRmXY=; b=J0u1tfqNxitcVfeBg4tDNtLqPFmd2uyMpB0ou9gy9fauxvGDkWjh5GZjro0o8bD20i +UxataJKNQRPnCx8MzfXHl7SSGk5OcO2gDkTKnmYvJRNLqhkLTES0wLdaQNJ4wqxc33+ cKVkcwCBtLZYVhloFn93w1AfWaKH179a/2hakxcVRZLMphT53t1nawyFJ6SrxGnavk65 wOfSBOD2Qj03i/r8noPYbZM6Ir0WXStXXjMjxc7VbSVZ8AfRjKJHvLOOAVoEROGZQmZP DC3JNdov1/9aijUxHTHm2Niclz6r8LZLjcbI+ZNkoZk+3UJ/T4yoDemdjvsa09Ftxtl6 B7Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rK3C04L+tiGDPqeQlwM4bukWCTsvMrVYTPtAYdKRmXY=; b=Mb64KTZ+jy+iuGDvHEUc+oeN3WHqnok9c5vPOZrE1T1TX91Fx0xmNvloa/aOJKVl2h PQXghltYYQ/IQXVwGQqV4CTwZ182z2LvvrKFPoNx9gu+JJrdaN3K3l49uVpsGO4abCkA Sv+PNrC+FXkA3DFNOUcDl8M7hps4kiy0P1ot4hC5elRk3wfQv1LaWDASDHja2t+b8tcs M0SRZOmrvXqLcsjfTbJ5JCCEpIgVDL1FdgUqaDeJocJPq1XCHktk3Fl3gt/CoU4DhvCy K0XI4hEQH0pOcrTXriYSWZLTPTzdHTI2R9pJHCGRW1tPd7ys1hb1edclXQplgS/bRmxn /+RA== X-Gm-Message-State: AD7BkJLyA4So4OAO1LPFSZ6IpO2R8ALY5o03shtExt1Uaf4aBmpCiLrdQnGSuiofbyNCgQ== X-Received: by 10.66.79.162 with SMTP id k2mr14649335pax.121.1460155845379; Fri, 08 Apr 2016 15:50:45 -0700 (PDT) Received: from dl.caveonetworks.com ([64.2.3.194]) by smtp.gmail.com with ESMTPSA id l11sm20864993pfb.56.2016.04.08.15.50.39 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 08 Apr 2016 15:50:40 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id u38MocsW008747; Fri, 8 Apr 2016 15:50:38 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u38Mocx6008746; Fri, 8 Apr 2016 15:50:38 -0700 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160408_155102_668707_4B5F3521 X-CRM114-Status: GOOD ( 15.85 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, David Daney MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(); } /*