From patchwork Mon Jun 17 08:12:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 2731821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7A5F7C0AB1 for ; Mon, 17 Jun 2013 08:15:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAD8D201D9 for ; Mon, 17 Jun 2013 08:15:20 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5394E201F2 for ; Mon, 17 Jun 2013 08:15:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoUZQ-0006hs-Ix; Mon, 17 Jun 2013 08:13:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoUZ1-00087O-Oa; Mon, 17 Jun 2013 08:13:23 +0000 Received: from kirsty.vergenet.net ([202.4.237.240]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UoUYj-00084B-S8 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2013 08:13:07 +0000 Received: from penelope.isobedori.kobe.vergenet.net (p5212-ipbfp1903kobeminato.hyogo.ocn.ne.jp [114.172.132.212]) by kirsty.vergenet.net (Postfix) with ESMTP id 26A4925C00E; Mon, 17 Jun 2013 18:12:43 +1000 (EST) Received: by penelope.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id 209227C1B5D; Mon, 17 Jun 2013 17:13:46 +0900 (JST) From: Simon Horman To: Arnd Bergmann , Olof Johansson Subject: [PATCH 04/15] ARM: shmobile: Rework sh7372 sleep code to use virt_to_phys() Date: Mon, 17 Jun 2013 17:12:37 +0900 Message-Id: <1371456768-1084-5-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1371456768-1084-1-git-send-email-horms+renesas@verge.net.au> References: <1371456768-1084-1-git-send-email-horms+renesas@verge.net.au> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130617_041306_460782_D3BD08F1 X-CRM114-Status: GOOD ( 12.59 ) X-Spam-Score: -3.7 (---) Cc: linux-sh@vger.kernel.org, Magnus Damm , Magnus Damm , arm@kernel.org, Simon Horman , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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: Magnus Damm Instead of having a hard coded virt-to-phys address conversion code in sleep-sh7372.S, rework the code to do the conversion in C using virt_to_phys(). This removes the need for PLAT_PHYS_OFFSET which in turn is needed for ARCH_MULTIPLATFORM. Signed-off-by: Magnus Damm [horms+renesas@verge.net.au: squashed in build fix posted as "ARM: shmobile: sh7372 build fix for SUSPEND=n && CPU_IDLE=n"] Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/include/mach/sh7372.h | 2 ++ arch/arm/mach-shmobile/pm-sh7372.c | 3 +++ arch/arm/mach-shmobile/sleep-sh7372.S | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h index e882717..854a9f0 100644 --- a/arch/arm/mach-shmobile/include/mach/sh7372.h +++ b/arch/arm/mach-shmobile/include/mach/sh7372.h @@ -75,6 +75,8 @@ extern void sh7372_intcs_resume(void); extern void sh7372_intca_suspend(void); extern void sh7372_intca_resume(void); +extern unsigned long sh7372_cpu_resume; + #ifdef CONFIG_PM extern void __init sh7372_init_pm_domains(void); #else diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index dec9293..0de75fd 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c @@ -351,6 +351,9 @@ static void sh7372_enter_a4s_common(int pllc0_on) static void sh7372_pm_setup_smfram(void) { + /* pass physical address of cpu_resume() to assembly resume code */ + sh7372_cpu_resume = virt_to_phys(cpu_resume); + memcpy((void *)SMFRAM, sh7372_resume_core_standby_sysc, 0x100); } #else diff --git a/arch/arm/mach-shmobile/sleep-sh7372.S b/arch/arm/mach-shmobile/sleep-sh7372.S index a9df53b..53f4840 100644 --- a/arch/arm/mach-shmobile/sleep-sh7372.S +++ b/arch/arm/mach-shmobile/sleep-sh7372.S @@ -40,7 +40,10 @@ .global sh7372_resume_core_standby_sysc sh7372_resume_core_standby_sysc: ldr pc, 1f -1: .long cpu_resume - PAGE_OFFSET + PLAT_PHYS_OFFSET + + .globl sh7372_cpu_resume +sh7372_cpu_resume: +1: .space 4 #define SPDCR 0xe6180008