From patchwork Mon Dec 26 20:38:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 708826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tnW9v4Ktsz9ssP for ; Tue, 27 Dec 2016 07:41:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sIa17aE2"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cLc3E-0000IQ-TN; Mon, 26 Dec 2016 20:39:20 +0000 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cLc33-0000EC-2y; Mon, 26 Dec 2016 20:39:10 +0000 Received: by mail-oi0-x241.google.com with SMTP id f201so45934265oib.0; Mon, 26 Dec 2016 12:38:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EVl9VyHsJei9ESN2gt1dKrd3xHWg+/mFhCTnCa2FnRY=; b=sIa17aE2MC0DX/039RoTPqj+uPMZ4c3G+8EL3szvnvEUoNwhKMrvAggj0+N1U7WXup y3QhB3icw6pIjL7Is9f2SfaAv4OqVr+t3Uc8tQBFWCgnQggAf1Xm8TgrMasoAn5TaJ61 yBDl/iMXQTa3u5TaCh8tBN4+xHnx89uHp5rCAbiJZBR1as8KmoxlWGRHCIuiEbLN9J0F SGKgWJ3T99KQGlqoFoOpm95exQdeIHaKlVHylirISHebXwyFHORXh6DZEt+Uj2Y0N8fv k9gG0+su+j7YX/zJdnOijlflh/0qPLAIi6blGTEKq/Iz8PXqCrat4b8/JNztUJzHqTXJ btdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EVl9VyHsJei9ESN2gt1dKrd3xHWg+/mFhCTnCa2FnRY=; b=BlmdPevl4IA3A5nTlss+xIQWLskGXA45Nq3kR0HZIQoziUKFIrcVhv+Bkg3LBmx2Zk mOLWj66nEljAp8/GiBrAulOvVCh+e3k7yMJdEipi4QojHpAbz8edOVdCGpR9R4jx3cEP RkAVHOctdKG1F8es6jeFazU1OGL2Pjfg8YWQ8ARXuQY8WMS0Q0IjYK8ECjLxDOlpQye6 wgmLGzxmoFX+h9O3KqRUCDL8roRklxicnJroZpguGhtdpoTq21O9gpNWD0+HCPk/h/0m yEv57V5F2QPRixCzU1sKZ6E0FqSK6LbNRmd6tSI9CNV8vmzS5+nJFbEbADO4tcCVK9Dg wOqQ== X-Gm-Message-State: AIkVDXJfKCz41w1QJPnhm49FSYNGcz0MhlTVjp9oxnv5i1ULfPolFClW7ioDXp8JYHvhQg== X-Received: by 10.202.86.134 with SMTP id k128mr14200159oib.212.1482784731748; Mon, 26 Dec 2016 12:38:51 -0800 (PST) Received: from bender.lan ([2001:470:d:73f:5586:4b80:7aae:266e]) by smtp.gmail.com with ESMTPSA id 36sm15361158otg.24.2016.12.26.12.38.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Dec 2016 12:38:51 -0800 (PST) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 2/4] ARM: Define KERNEL_START and KERNEL_END Date: Mon, 26 Dec 2016 12:38:40 -0800 Message-Id: <20161226203842.19457-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161226203842.19457-1-f.fainelli@gmail.com> References: <20161209233628.6642-1-f.fainelli@gmail.com> <20161226203842.19457-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161226_123909_327196_716EDE61 X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4003:c06:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolas.pitre@linaro.org, mark.rutland@arm.com, matt@codeblueprint.co.uk, stefan@agner.ch, chris.brandt@renesas.com, linux-mtd@lists.infradead.org, cyrille.pitchen@atmel.com, panand@redhat.com, boris.brezillon@free-electrons.com, Florian Fainelli , pawel.moll@arm.com, richard@nod.at, linux@armlinux.org.uk, ben@decadent.org.uk, vladimir.murzin@arm.com, keescook@chromium.org, arnd@arndb.de, labbott@fedoraproject.org, jonathan.austin@arm.com, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org, kirill.shutemov@linux.intel.com, js07.lee@samsung.com MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org In preparation for adding CONFIG_DEBUG_VIRTUAL support, define a set of common constants: KERNEL_START and KERNEL_END which abstract CONFIG_XIP_KERNEL vs. !CONFIG_XIP_KERNEL. Update the code where relevant. Signed-off-by: Florian Fainelli --- arch/arm/include/asm/memory.h | 7 +++++++ arch/arm/mm/init.c | 7 ++----- arch/arm/mm/mmu.c | 6 +----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 76cbd9c674df..bee7511c5098 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -111,6 +111,13 @@ #endif /* !CONFIG_MMU */ +#ifdef CONFIG_XIP_KERNEL +#define KERNEL_START _sdata +#else +#define KERNEL_START _stext +#endif +#define KERNEL_END _end + /* * We fix the TCM memories max 32 KiB ITCM resp DTCM at these * locations diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 370581aeb871..c87d0d5b65f2 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -230,11 +230,8 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align) void __init arm_memblock_init(const struct machine_desc *mdesc) { /* Register the kernel text, kernel data and initrd with memblock. */ -#ifdef CONFIG_XIP_KERNEL - memblock_reserve(__pa(_sdata), _end - _sdata); -#else - memblock_reserve(__pa(_stext), _end - _stext); -#endif + memblock_reserve(__pa(KERNEL_START), _end - KERNEL_START); + #ifdef CONFIG_BLK_DEV_INITRD /* FDT scan will populate initrd_start */ if (initrd_start && !phys_initrd_size) { diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 4001dd15818d..f0fd1a2db036 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1437,11 +1437,7 @@ static void __init kmap_init(void) static void __init map_lowmem(void) { struct memblock_region *reg; -#ifdef CONFIG_XIP_KERNEL - phys_addr_t kernel_x_start = round_down(__pa(_sdata), SECTION_SIZE); -#else - phys_addr_t kernel_x_start = round_down(__pa(_stext), SECTION_SIZE); -#endif + phys_addr_t kernel_x_start = round_down(__pa(KERNEL_START), SECTION_SIZE); phys_addr_t kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE); /* Map all the lowmem memory banks. */