From patchwork Fri Jul 25 08:09:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4621651 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AEC8E9F36A for ; Fri, 25 Jul 2014 08:13:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA7FA20173 for ; Fri, 25 Jul 2014 08:13:05 +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 EF86D200E7 for ; Fri, 25 Jul 2014 08:13:04 +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 1XAaan-0007zs-KD; Fri, 25 Jul 2014 08:11:05 +0000 Received: from mail-by2lp0237.outbound.protection.outlook.com ([207.46.163.237] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XAaaT-0007dx-VP for linux-arm-kernel@lists.infradead.org; Fri, 25 Jul 2014 08:10:46 +0000 Received: from DM2PR03MB351.namprd03.prod.outlook.com (10.141.54.22) by DM2PR03MB511.namprd03.prod.outlook.com (10.141.87.19) with Microsoft SMTP Server (TLS) id 15.0.990.7; Fri, 25 Jul 2014 08:10:23 +0000 Received: from BN3PR0301CA0035.namprd03.prod.outlook.com (25.160.180.173) by DM2PR03MB351.namprd03.prod.outlook.com (10.141.54.22) with Microsoft SMTP Server (TLS) id 15.0.990.7; Fri, 25 Jul 2014 08:10:22 +0000 Received: from BY2FFO11FD003.protection.gbl (2a01:111:f400:7c0c::174) by BN3PR0301CA0035.outlook.office365.com (2a01:111:e400:4000::45) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Fri, 25 Jul 2014 08:10:21 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD003.mail.protection.outlook.com (10.1.14.125) with Microsoft SMTP Server (TLS) id 15.0.980.11 via Frontend Transport; Fri, 25 Jul 2014 08:10:21 +0000 Received: from dragon.ap.freescale.net ([10.192.185.114]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s6P8A40m029762; Fri, 25 Jul 2014 01:10:17 -0700 From: Shawn Guo To: Russell King Subject: [PATCH v2 2/2] ARM: smp_scu: enable SCU standby support Date: Fri, 25 Jul 2014 16:09:50 +0800 Message-ID: <1406275790-18617-3-git-send-email-shawn.guo@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1406275790-18617-1-git-send-email-shawn.guo@freescale.com> References: <1406275790-18617-1-git-send-email-shawn.guo@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(97736001)(50226001)(76176999)(95666004)(110136001)(104166001)(74662001)(33646002)(99396002)(74502001)(83322001)(46102001)(85306003)(31966008)(19580395003)(19580405001)(229853001)(50986999)(76482001)(85852003)(50466002)(87286001)(62966002)(81542001)(26826002)(83072002)(21056001)(44976005)(104016003)(81342001)(89996001)(88136002)(105606002)(575784001)(47776003)(20776003)(92726001)(36756003)(87936001)(86362001)(106466001)(4396001)(64706001)(48376002)(92566001)(6806004)(107046002)(79102001)(84676001)(102836001)(77982001)(68736004)(80022001)(77156001)(93916002); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR03MB351; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 02830F0362 Received-SPF: Fail (: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Shawn.Guo@freescale.com; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140725_011046_069895_8928450F X-CRM114-Status: UNSURE ( 8.25 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Nicolas Pitre , Rob Herring , Catalin Marinas , Will Deacon , Shawn Guo , Gregory Clement , 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,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 With SCU standby enabled, SCU CLK will be turned off when all processors are in WFI mode. And the clock will be turned on when any processor leaves WFI mode. This behavior should be preferable in terms of power efficiency of system idle. So let's set the SCU standby bit to enable the support in function scu_enable(). Cortex-A9 earlier than r2p0 has no standby bit in SCU, so we need to skip setting the bit for those. Signed-off-by: Shawn Guo --- arch/arm/kernel/smp_scu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c index c947508f84e6..72f9241ad5db 100644 --- a/arch/arm/kernel/smp_scu.c +++ b/arch/arm/kernel/smp_scu.c @@ -18,6 +18,7 @@ #define SCU_CTRL 0x00 #define SCU_ENABLE (1 << 0) +#define SCU_STANDBY_ENABLE (1 << 5) #define SCU_CONFIG 0x04 #define SCU_CPU_STATUS 0x08 #define SCU_INVALIDATE 0x0c @@ -55,6 +56,12 @@ void scu_enable(void __iomem *scu_base) return; scu_ctrl |= SCU_ENABLE; + + /* Cortex-A9 earlier than r2p0 has no standby bit in SCU */ + if ((read_cpuid_id() & 0xff0ffff0) == 0x410fc090 && + (read_cpuid_id() & 0x00f0000f) >= 0x00200000) + scu_ctrl |= SCU_STANDBY_ENABLE; + writel_relaxed(scu_ctrl, scu_base + SCU_CTRL); /*