From patchwork Mon Feb 1 14:08:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Brandt X-Patchwork-Id: 60932 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp21620lbb; Mon, 1 Feb 2016 06:10:59 -0800 (PST) X-Received: by 10.98.12.221 with SMTP id 90mr22739887pfm.95.1454335859511; Mon, 01 Feb 2016 06:10:59 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id fn1si24534660pad.82.2016.02.01.06.10.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Feb 2016 06:10:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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 1aQFB0-0007Tx-Vm; Mon, 01 Feb 2016 14:09:58 +0000 Received: from relmlor4.renesas.com ([210.160.252.174] helo=relmlie3.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQFAt-00074x-BB for linux-arm-kernel@lists.infradead.org; Mon, 01 Feb 2016 14:09:53 +0000 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 01 Feb 2016 23:09:29 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id AC1456872F; Mon, 1 Feb 2016 23:09:29 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id A47682806E; Mon, 1 Feb 2016 23:09:29 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 933252806D; Mon, 1 Feb 2016 23:09:29 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id ZAB02832; Mon, 1 Feb 2016 23:09:29 +0900 X-IronPort-AV: E=Sophos;i="5.22,380,1449500400"; d="scan'208";a="204756435" Received: from unknown (HELO rtamta01.rta.renesas.com) ([143.103.48.75]) by relmlii2.idc.renesas.com with ESMTP; 01 Feb 2016 23:09:28 +0900 Received: from localhost.localdomain (unknown [143.103.58.146]) by rtamta01.rta.renesas.com (Postfix) with ESMTP id 900B553B; Mon, 1 Feb 2016 14:09:25 +0000 (UTC) From: Chris Brandt To: linux@arm.linux.org.uk Subject: [PATCH v2] ARM: proc-v7.S: Adjust stack address when XIP_KERNEL Date: Mon, 1 Feb 2016 09:08:56 -0500 Message-Id: <1454335736-10084-1-git-send-email-chris.brandt@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454105474-3009-1-git-send-email-chris.brandt@renesas.com> References: <1454105474-3009-1-git-send-email-chris.brandt@renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160201_060951_622533_50CB6B3A X-CRM114-Status: GOOD ( 10.69 ) X-Spam-Score: -2.4 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [210.160.252.174 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: Chris Brandt , linux-arm-kernel@lists.infradead.org, Nicolas Pitre MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org From: Nicolas Pitre When XIP_KERNEL is enabled, the virt to phys address translation for RAM is not the same as the virt to phys address translation for .text. The only way to know where physical RAM is located is to use PLAT_PHYS_OFFSET. The MACRO will be useful for other places where there is a similar problem. Signed-off-by: Nicolas Pitre Signed-off-by: Chris Brandt --- v2: * Fixed Signed-off to show correct author --- arch/arm/include/asm/memory.h | 8 ++++++++ arch/arm/mm/proc-v7.S | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index c79b57b..7dd2ab5 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -134,6 +134,14 @@ */ #define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET) +#ifdef CONFIG_XIP_KERNEL +#define PHYS_OFFSET_FIXUP \ + ( XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR) - PAGE_OFFSET + \ + PLAT_PHYS_OFFSET - CONFIG_XIP_PHYS_ADDR ) +#else +#define PHYS_OFFSET_FIXUP 0 +#endif + #ifndef __ASSEMBLY__ /* diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 0f92d57..1595fb2 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -487,7 +487,7 @@ __errata_finish: .align 2 __v7_setup_stack_ptr: - .word __v7_setup_stack - . + .word __v7_setup_stack - . + PHYS_OFFSET_FIXUP ENDPROC(__v7_setup) .bss