From patchwork Wed Jun 5 07:45:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2665931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id D5EDCDF264 for ; Wed, 5 Jun 2013 07:39:00 +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 1Uk8J4-0001AI-RZ; Wed, 05 Jun 2013 07:38:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uk8J2-0000Ho-6G; Wed, 05 Jun 2013 07:38:52 +0000 Received: from mail-pd0-f170.google.com ([209.85.192.170]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uk8Iz-0000Fn-1q for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2013 07:38:49 +0000 Received: by mail-pd0-f170.google.com with SMTP id x10so1429930pdj.29 for ; Wed, 05 Jun 2013 00:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:subject; bh=tgucuwMhHSU96vTs9KYewIYHwT4GN4LILSlYeb2ZXhM=; b=Pa7PvGy6lGQXhRqkaf7mTwheSwbQunwImgXGxbbxZ0zptXJ5O3WbUGdHpg5Opk900Y QXek+rdKNB4HTztztvfSE910eOyzZSpn8sMeC736iuJhYo/FEQFhWg7bA+93hIF2Df55 Cl/Mceayjv6qj+Ohq1yvLCMLnL0X7js+6QW0scONU82waCmGiJ+UAGinR9IojV/gBEj4 d1FbcOkwbF6UNNQRRNLEcyZuuAdV7/AYypxDUpM9LxO6CFaRiNxrbKopn3UKC9x0QDZu KqOBMgX+hjRU++BoAz5MMFrKN9dQ/OjswsbuonvmnXnKR6c7Xl+Gpn6eDrcXRqFnarRU rszQ== X-Received: by 10.68.182.33 with SMTP id eb1mr29257587pbc.186.1370417907918; Wed, 05 Jun 2013 00:38:27 -0700 (PDT) Received: from [127.0.0.1] (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id ig4sm38755959pbc.18.2013.06.05.00.38.26 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Jun 2013 00:38:27 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Wed, 05 Jun 2013 16:45:53 +0900 Message-Id: <20130605074553.16962.7736.sendpatchset@w520> Subject: [PATCH] ARM: shmobile: Rework sh7372 sleep code to use virt_to_phys() X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130605_033849_216288_34FD0A85 X-CRM114-Status: UNSURE ( 8.76 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.170 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (magnus.damm[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: arnd@arndb.de, Magnus Damm , horms@verge.net.au, laurent.pinchart@ideasonboard.com, olof@lixom.net, 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 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 --- Tested with A3SM Suspend-to-RAM on Mackerel. 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(-) --- 0001/arch/arm/mach-shmobile/include/mach/sh7372.h +++ work/arch/arm/mach-shmobile/include/mach/sh7372.h 2013-06-05 16:40:41.000000000 +0900 @@ -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 --- 0001/arch/arm/mach-shmobile/pm-sh7372.c +++ work/arch/arm/mach-shmobile/pm-sh7372.c 2013-06-05 16:40:41.000000000 +0900 @@ -524,6 +524,9 @@ void __init sh7372_pm_init(void) /* do not convert A3SM, A3SP, A3SG, A4R power down into A4S */ __raw_writel(0, PDNSEL); + /* pass physical address of cpu_resume() to assembly resume code */ + sh7372_cpu_resume = virt_to_phys(cpu_resume); + sh7372_pm_setup_smfram(); sh7372_suspend_init(); --- 0001/arch/arm/mach-shmobile/sleep-sh7372.S +++ work/arch/arm/mach-shmobile/sleep-sh7372.S 2013-06-05 16:41:01.000000000 +0900 @@ -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