From patchwork Wed Jan 4 22:39:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 711152 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-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tv5RH2sCkz9sQw for ; Thu, 5 Jan 2017 09:42:19 +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="QRr/6gIv"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cOuEe-0005Cf-Qw; Wed, 04 Jan 2017 22:40:44 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cOuEM-0004DD-Eb; Wed, 04 Jan 2017 22:40:27 +0000 Received: by mail-pf0-x243.google.com with SMTP id y68so27507673pfb.1; Wed, 04 Jan 2017 14:40:05 -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=UOO7eElekQ2OafeHfmQWJhmycpqCx6AE6Zq/gSMc+4Y=; b=QRr/6gIv+/zWWyjP9uPpGijey+4frk3akpgAaK2I7uPjUEPgnrAQP+Kpee2MwUyy+T d8OiW/lcDOGJIdTbnrc6nhIHZISXiPHdYScHhqFJHBvKCJSKKL/OCGXIgoqDhbLLpzDG p9MidzHIok+f7ELJrA5gAGgZ6QnISAJONRXx+2v2pbHN5BeXVoSu67ByroWCdqZyBkI2 +RHzrc8LAGweAHfxj9lfFQjGIw4iRP7qU1yxBu6j0ferQvxnFCUKbQnKmABUdqbRZOzL WgWq+Z/+kuNIh9em9Sx8GbI720mlm4MVCnRkuqaW1YCYoD4dhFuERc8hv6v2noxSkqCR /ieA== 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=UOO7eElekQ2OafeHfmQWJhmycpqCx6AE6Zq/gSMc+4Y=; b=FFKGTEH1hzPdmfTo426GmlUyeCqWJb/8XJ44aV5LBKdg4+KmKwPjLeEzmt17BMPM1l WkGRaejUYe5DGj7qbW7LczzFWdnfuBXBLSlJc48MXfpnCEMCMbCk07L0oThOWzcofAlb fXoZiiv7MAIYACncCAevCA+kMkGaDOiWdqdMSbRzdJEYCc3tzH9/jI0ms/IbdBnPwMA/ hT8VZ9AJllRc8AMELvvrSw/9C2YBttIOhBM4vdqPrDdc2pjc1u7JL5ZB6LyPeboQh3SG S+NnCcFL1YBKJB3iMzQfi86d20323ANeKVNm4ZGdy67ifgxXJWyAKcX7GPPrSG41JdYi Oc8g== X-Gm-Message-State: AIkVDXJKilaTcXbV7NBh0IkWmLh5CeUtqeBI6jXVDWGbsVv56qPpOj3Mhu76q3qh5DBn1A== X-Received: by 10.99.125.65 with SMTP id m1mr129218502pgn.159.1483569605451; Wed, 04 Jan 2017 14:40:05 -0800 (PST) Received: from fainelli-desktop.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id t25sm150671574pgo.9.2017.01.04.14.40.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jan 2017 14:40:04 -0800 (PST) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH v6 2/4] ARM: Define KERNEL_START and KERNEL_END Date: Wed, 4 Jan 2017 14:39:53 -0800 Message-Id: <20170104223955.22859-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170104223955.22859-1-f.fainelli@gmail.com> References: <20170104011417.1496-1-f.fainelli@gmail.com> <20170104223955.22859-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170104_144026_628720_78EA8B2D X-CRM114-Status: GOOD ( 10.17 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid 0.9 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 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. Acked-by: Russell King 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..4127f578086c 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), KERNEL_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. */