From patchwork Thu Jul 18 03:28:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 18406 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D37125B8B for ; Thu, 18 Jul 2013 03:28:45 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf3178675ghb.2 for ; Wed, 17 Jul 2013 20:28:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-transfer-encoding; bh=iQ5AedHNCAFIV8Vf/360WW2UeZFB7CK7Ib8Kiiuyyuc=; b=PcajSW+WNqGsjQs1N0lDO6vZQlNjD9blTBnz7hxJz4jJ0cYJKpyErYhaO5QfBy9Uva 5TJ5Ifq3GLeZFYa62OtGK5Z8sD5sKl2pMqriOVojIMSjm4h4bNDI09Jc1o2Ibj48n90K GtYpe0eSDmTV+H4z7MaALVQHc8mqWq4XPOUUBAr57gaKPBCZ4r2bEbTQI32LtBYbkjxn mwy3T3JjiWoHLl+evrFSTcKatyLRuZ+cxL2RG15DtMmU34WSI49lvEg4CNqOX5RnXRmT qLOI3eZMzPm52VUCjf/ZpE7LjUB3rBoBJVJk+PCG95gucoMxhLtRG0gj6UjJzONq+2Kz PEIQ== X-Received: by 10.236.170.41 with SMTP id o29mr5227324yhl.53.1374118124820; Wed, 17 Jul 2013 20:28:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.128.34 with SMTP id nl2ls1179462qeb.39.gmail; Wed, 17 Jul 2013 20:28:44 -0700 (PDT) X-Received: by 10.221.5.71 with SMTP id of7mr3301870vcb.39.1374118124713; Wed, 17 Jul 2013 20:28:44 -0700 (PDT) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id aw7si2284286vec.50.2013.07.17.20.28.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Jul 2013 20:28:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id 12so1924389vbf.8 for ; Wed, 17 Jul 2013 20:28:44 -0700 (PDT) X-Received: by 10.58.211.227 with SMTP id nf3mr3293093vec.20.1374118124634; Wed, 17 Jul 2013 20:28:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.149.77 with SMTP id s13csp204005vcv; Wed, 17 Jul 2013 20:28:44 -0700 (PDT) X-Received: by 10.49.109.72 with SMTP id hq8mr10744778qeb.38.1374118122207; Wed, 17 Jul 2013 20:28:42 -0700 (PDT) Received: from relais.videotron.ca (relais.videotron.ca. [24.201.245.36]) by mx.google.com with ESMTP id j17si3550640qen.3.2013.07.17.20.28.41 for ; Wed, 17 Jul 2013 20:28:42 -0700 (PDT) Received-SPF: neutral (google.com: 24.201.245.36 is neither permitted nor denied by best guess record for domain of nicolas.pitre@linaro.org) client-ip=24.201.245.36; Received: from yoda.home ([70.83.209.44]) by VL-VM-MR005.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0MQ400I0K4BSTFC0@VL-VM-MR005.ip.videotron.ca>; Wed, 17 Jul 2013 23:28:40 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 0B4692DA05FA; Wed, 17 Jul 2013 23:28:40 -0400 (EDT) From: Nicolas Pitre To: linux-arm-kernel@lists.infradead.org Cc: lorenzo.pieralisi@arm.com, dave.martin@arm.com, pawel.moll@arm.com, olof@lixom.net, tixy@linaro.org, achin.gupta@arm.com, sudeep.karkadanagesha@arm.com, patches@linaro.org Subject: [PATCH 4/4] ARM: vexpress/TC2: implement PM suspend method Date: Wed, 17 Jul 2013 23:28:36 -0400 Message-id: <1374118116-16836-5-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-reply-to: <1374118116-16836-1-git-send-email-nicolas.pitre@linaro.org> References: <1374118116-16836-1-git-send-email-nicolas.pitre@linaro.org> X-Gm-Message-State: ALoCoQkWcVGijwx5TkFpkM9H1Ovpr+XO/HynAWwpR38LTF35yfXxqviC+tLpiGVTrE6AFRIQDUFT X-Original-Sender: nicolas.pitre@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-transfer-encoding: 7BIT From: Nicolas Pitre Similar to power_down(), except that for a suspend, the firmware mailbox address has to be set prior entering low power mode. The residency argument is not used yet, so the last man always shuts down the cluster for now. Signed-off-by: Nicolas Pitre Acked-by: Pawel Moll --- arch/arm/mach-vexpress/tc2_pm.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c index 26dbe782fb..dfb55d45b6 100644 --- a/arch/arm/mach-vexpress/tc2_pm.c +++ b/arch/arm/mach-vexpress/tc2_pm.c @@ -84,7 +84,7 @@ static int tc2_pm_power_up(unsigned int cpu, unsigned int cluster) return 0; } -static void tc2_pm_power_down(void) +static void tc2_pm_down(u64 residency) { unsigned int mpidr, cpu, cluster; bool last_man = false, skip_wfi = false; @@ -198,6 +198,22 @@ static void tc2_pm_power_down(void) /* Not dead at this point? Let our caller cope. */ } +static void tc2_pm_power_down(void) +{ + tc2_pm_down(0); +} + +static void tc2_pm_suspend(u64 residency) +{ + unsigned int mpidr, cpu, cluster; + + mpidr = read_cpuid_mpidr(); + cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); + cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); + ve_spc_set_resume_addr(cluster, cpu, virt_to_phys(mcpm_entry_point)); + tc2_pm_down(residency); +} + static void tc2_pm_powered_up(void) { unsigned int mpidr, cpu, cluster; @@ -231,6 +247,7 @@ static void tc2_pm_powered_up(void) static const struct mcpm_platform_ops tc2_pm_power_ops = { .power_up = tc2_pm_power_up, .power_down = tc2_pm_power_down, + .suspend = tc2_pm_suspend, .powered_up = tc2_pm_powered_up, };