From patchwork Thu Feb 12 02:51:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenyou Yang X-Patchwork-Id: 5815741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C57BE9F30C for ; Thu, 12 Feb 2015 02:56:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C5012018E for ; Thu, 12 Feb 2015 02:56:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F0812017E for ; Thu, 12 Feb 2015 02:56:52 +0000 (UTC) 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 1YLjvA-0008SE-1r; Thu, 12 Feb 2015 02:54:28 +0000 Received: from nasmtp01.atmel.com ([192.199.1.246] helo=DVREDG02.corp.atmel.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YLjuy-000838-9Q for linux-arm-kernel@lists.infradead.org; Thu, 12 Feb 2015 02:54:20 +0000 Received: from apsmtp01.atmel.com (10.168.254.30) by DVREDG02.corp.atmel.com (10.42.103.31) with Microsoft SMTP Server (TLS) id 14.2.347.0; Wed, 11 Feb 2015 19:54:06 -0700 Received: from shaarm01.corp.atmel.com (10.168.254.13) by apsmtp01.corp.atmel.com (10.168.254.30) with Microsoft SMTP Server id 14.2.347.0; Thu, 12 Feb 2015 10:56:33 +0800 From: Wenyou Yang To: , , Subject: [PATCH 1/3] pm: at91: pm_suspend: add the WFI instruction support for ARMv7 Date: Thu, 12 Feb 2015 10:51:26 +0800 Message-ID: <1423709486-8382-1-git-send-email-wenyou.yang@atmel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1423709441-8342-1-git-send-email-wenyou.yang@atmel.com> References: <1423709441-8342-1-git-send-email-wenyou.yang@atmel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150211_185416_386357_9C1107B9 X-CRM114-Status: UNSURE ( 8.55 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: mark.rutland@arm.com, lorenzo.pieralisi@arm.com, sergei.shtylyov@cogentembedded.com, sylvain.rochet@finsecur.com, patrice.vilchez@atmel.com, linux-kernel@vger.kernel.org, wenyou.yang@atmel.com, alexandre.belloni@free-electrons.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Add the WFI instruction to make the cpu to the idle state. In the meanwhile, disable the processor's clock. Signed-off-by: Wenyou Yang Acked-by: Alexandre Belloni --- arch/arm/mach-at91/pm_suspend.S | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S index bebe3de..1c7256a 100644 --- a/arch/arm/mach-at91/pm_suspend.S +++ b/arch/arm/mach-at91/pm_suspend.S @@ -51,6 +51,24 @@ tmp2 .req r5 beq 1b .endm +/* + * Put the processor to enter the idle state + */ + .macro at91_cpu_idle + +#if defined(CONFIG_CPU_V7) + mov tmp1, #AT91_PMC_PCK + str tmp1, [pmc, #AT91_PMC_SCDR] + + dsb + + wfi @ Wait For Interrupt +#else + mcr p15, 0, tmp1, c7, c0, 4 +#endif + + .endm + .text /* @@ -120,7 +138,7 @@ skip_disable_main_clock: ldr pmc, .pmc_base /* Wait for interrupt */ - mcr p15, 0, tmp1, c7, c0, 4 + at91_cpu_idle ldr r0, .pm_mode tst r0, #AT91_PM_SLOW_CLOCK