From patchwork Fri Jun 20 05:44:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 4387021 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 7A0BABEEAA for ; Fri, 20 Jun 2014 05:49:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7D23202AE for ; Fri, 20 Jun 2014 05:49:42 +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 5B0A320340 for ; Fri, 20 Jun 2014 05:49:41 +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 1WxreG-0003Bh-4V; Fri, 20 Jun 2014 05:46:04 +0000 Received: from mail-bl2lp0207.outbound.protection.outlook.com ([207.46.163.207] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WxreC-0003At-5E for linux-arm-kernel@lists.infradead.org; Fri, 20 Jun 2014 05:46:01 +0000 Received: from BLUPR03CA036.namprd03.prod.outlook.com (10.141.30.29) by BLUPR03MB342.namprd03.prod.outlook.com (10.141.48.13) with Microsoft SMTP Server (TLS) id 15.0.969.15; Fri, 20 Jun 2014 05:45:37 +0000 Received: from BY2FFO11FD030.protection.gbl (2a01:111:f400:7c0c::179) by BLUPR03CA036.outlook.office365.com (2a01:111:e400:879::29) with Microsoft SMTP Server (TLS) id 15.0.959.15 via Frontend Transport; Fri, 20 Jun 2014 05:45:37 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD030.mail.protection.outlook.com (10.1.14.211) with Microsoft SMTP Server (TLS) id 15.0.969.12 via Frontend Transport; Fri, 20 Jun 2014 05:45:36 +0000 Received: from ubuntu.ap.freescale.net (ubuntu-010192242118.ap.freescale.net [10.192.242.118]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s5K5jWMV009703; Thu, 19 Jun 2014 22:45:32 -0700 From: Anson Huang To: , , Subject: [PATCH] ARM: imx: add cpuidle support for i.mx6sx Date: Fri, 20 Jun 2014 13:44:05 +0800 Message-ID: <1403243045-8521-1-git-send-email-b20788@freescale.com> X-Mailer: git-send-email 1.7.9.5 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(99396002)(64706001)(97736001)(20776003)(47776003)(105606002)(80022001)(79102001)(81156003)(81342001)(85306003)(575784001)(36756003)(85852003)(31966008)(84676001)(74662001)(83072002)(104166001)(62966002)(69596002)(2201001)(74502001)(68736004)(89996001)(26826002)(19580395003)(33646001)(92566001)(92726001)(81542001)(93916002)(50466002)(87286001)(102836001)(48376002)(88136002)(6806004)(44976005)(77982001)(87936001)(46102001)(50986999)(95666004)(104016002)(50226001)(19580405001)(76482001)(83322001)(77156001)(21056001)(4396001)(42262001); DIR:OUT; SFP:; SCL:1; SRVR:BLUPR03MB342; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 024847EE92 Received-SPF: Fail (: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Anson.Huang@freescale.com; X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140619_224600_337883_683FC11C X-CRM114-Status: UNSURE ( 8.76 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: 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=-1.9 required=5.0 tests=BAYES_00, 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 cpuidle support for i.MX6SX, derive from i.MX6Q's cpuidle, two levels supported: 1. WFI; 2. WAIT mode. Signed-off-by: Anson Huang --- arch/arm/mach-imx/cpuidle-imx6q.c | 4 +++- arch/arm/mach-imx/mach-imx6sx.c | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c index 6bcae04..fc0bb1e 100644 --- a/arch/arm/mach-imx/cpuidle-imx6q.c +++ b/arch/arm/mach-imx/cpuidle-imx6q.c @@ -13,6 +13,7 @@ #include "common.h" #include "cpuidle.h" +#include "hardware.h" static atomic_t master = ATOMIC_INIT(0); static DEFINE_SPINLOCK(master_lock); @@ -66,7 +67,8 @@ static struct cpuidle_driver imx6q_cpuidle_driver = { int __init imx6q_cpuidle_init(void) { /* Need to enable SCU standby for entering WAIT modes */ - imx_scu_standby_enable(); + if (!cpu_is_imx6sx()) + imx_scu_standby_enable(); /* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */ imx6q_set_int_mem_clk_lpm(); diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c index b7a0bde..74ff7d6 100644 --- a/arch/arm/mach-imx/mach-imx6sx.c +++ b/arch/arm/mach-imx/mach-imx6sx.c @@ -12,6 +12,7 @@ #include #include "common.h" +#include "cpuidle.h" static void __init imx6sx_init_machine(void) { @@ -38,6 +39,11 @@ static void __init imx6sx_init_irq(void) irqchip_init(); } +static void __init imx6sx_init_late(void) +{ + imx6q_cpuidle_init(); +} + static const char *imx6sx_dt_compat[] __initconst = { "fsl,imx6sx", NULL, @@ -48,5 +54,6 @@ DT_MACHINE_START(IMX6SX, "Freescale i.MX6 SoloX (Device Tree)") .init_irq = imx6sx_init_irq, .init_machine = imx6sx_init_machine, .dt_compat = imx6sx_dt_compat, + .init_late = imx6sx_init_late, .restart = mxc_restart, MACHINE_END