From patchwork Thu Sep 1 01:44:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1118212 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p811ktrW018127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 1 Sep 2011 01:47:16 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QywMP-0003dg-7D; Thu, 01 Sep 2011 01:46:30 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QywMO-0005C7-C1; Thu, 01 Sep 2011 01:46:28 +0000 Received: from mail-yx0-f177.google.com ([209.85.213.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QywKa-0004m3-B0 for linux-arm-kernel@lists.infradead.org; Thu, 01 Sep 2011 01:44:39 +0000 Received: by yxk8 with SMTP id 8so67618yxk.36 for ; Wed, 31 Aug 2011 18:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=X1ezY9X7MfCKjzAyz7KVRgSKgqRbbZ0bizR0MD/gOxk=; b=moo8WeGqjlwdhzNG5YSxGli1Wo3HOJPnIF9+7saMHn+4v3b+PP/eme1euGkFiN29U5 jaxeGShV3JGFPzJX88hlok8AI8JiRF/a6MkMr4dGUM93d8aVl5ob14EaW3nM1Q2GdDkc JVTawjB7S62vDAIVPXXcg7BbmLK2O9KvqQLo0= Received: by 10.101.88.14 with SMTP id q14mr882388anl.125.1314841474400; Wed, 31 Aug 2011 18:44:34 -0700 (PDT) Received: from rob-laptop.i.smooth-stone.com (65-36-74-215.dyn.grandenetworks.net [65.36.74.215]) by mx.google.com with ESMTPS id h25sm156849anm.4.2011.08.31.18.44.32 (version=SSLv3 cipher=OTHER); Wed, 31 Aug 2011 18:44:33 -0700 (PDT) From: Rob Herring To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 7/7] ARM: highbank: add suspend support Date: Wed, 31 Aug 2011 20:44:06 -0500 Message-Id: <1314841446-11006-8-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314841446-11006-1-git-send-email-robherring2@gmail.com> References: <1314841446-11006-1-git-send-email-robherring2@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110831_214436_680413_9CA1EE22 X-CRM114-Status: GOOD ( 14.84 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) 0.1 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -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 0.0 T_TO_NO_BRKTS_FREEMAIL To: misformatted and free email service Cc: jamie@jamieiles.com, arnd@arndb.de, shawn.guo@freescale.com, Rob Herring , linux@arm.linux.org.uk X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 01 Sep 2011 01:47:16 +0000 (UTC) From: Rob Herring Add the platform suspend ops for highbank. Signed-off-by: Rob Herring --- Changes in v2: - s/a9_base_addr/scu_base_addr/ - use sysregs helper functions - add __init to highbank_pm_init arch/arm/mach-highbank/Makefile | 1 + arch/arm/mach-highbank/pm.c | 55 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-highbank/pm.c diff --git a/arch/arm/mach-highbank/Makefile b/arch/arm/mach-highbank/Makefile index df30b0d..daeb3d8 100644 --- a/arch/arm/mach-highbank/Makefile +++ b/arch/arm/mach-highbank/Makefile @@ -3,3 +3,4 @@ obj-$(CONFIG_DEBUG_LL) += lluart.o obj-$(CONFIG_SMP) += platsmp.o obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o +obj-$(CONFIG_PM_SLEEP) += pm.o diff --git a/arch/arm/mach-highbank/pm.c b/arch/arm/mach-highbank/pm.c new file mode 100644 index 0000000..33b3beb --- /dev/null +++ b/arch/arm/mach-highbank/pm.c @@ -0,0 +1,55 @@ +/* + * Copyright 2011 Calxeda, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#include +#include +#include + +#include +#include +#include + +#include "core.h" +#include "sysregs.h" + +static int highbank_suspend_finish(unsigned long val) +{ + cpu_do_idle(); + return 0; +} + +static int highbank_pm_enter(suspend_state_t state) +{ + hignbank_set_pwr_suspend(); + highbank_set_cpu_jump(0, cpu_resume); + + scu_power_mode(scu_base_addr, SCU_PM_POWEROFF); + cpu_suspend(0, highbank_suspend_finish); + + return 0; +} + +static const struct platform_suspend_ops highbank_pm_ops = { + .enter = highbank_pm_enter, + .valid = suspend_valid_only_mem, +}; + +static int __init highbank_pm_init(void) +{ + suspend_set_ops(&highbank_pm_ops); + return 0; +} +module_init(highbank_pm_init);