From patchwork Fri Mar 1 18:51:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Soren Brinkmann X-Patchwork-Id: 2202801 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 22294DF24C for ; Fri, 1 Mar 2013 18:55:02 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UBV3k-0003cC-MJ; Fri, 01 Mar 2013 18:51:56 +0000 Received: from co1ehsobe003.messaging.microsoft.com ([216.32.180.186] helo=co1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UBV3h-0003bp-7h for linux-arm-kernel@lists.infradead.org; Fri, 01 Mar 2013 18:51:54 +0000 Received: from mail71-co1-R.bigfish.com (10.243.78.235) by CO1EHSOBE017.bigfish.com (10.243.66.80) with Microsoft SMTP Server id 14.1.225.23; Fri, 1 Mar 2013 18:51:47 +0000 Received: from mail71-co1 (localhost [127.0.0.1]) by mail71-co1-R.bigfish.com (Postfix) with ESMTP id 14D11B4015A; Fri, 1 Mar 2013 18:51:47 +0000 (UTC) X-Forefront-Antispam-Report: CIP:149.199.60.83; KIP:(null); UIP:(null); IPV:NLI; H:xsj-gw1; RD:unknown-60-83.xilinx.com; EFVD:NLI X-SpamScore: 0 X-BigFish: VPS0(zzc89bh4015Izz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bhz2fh95h668h839h93fhd24hf0ah119dh1288h12a5h12a9h12bdh137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h906i1155h) Received-SPF: pass (mail71-co1: domain of xilinx.com designates 149.199.60.83 as permitted sender) client-ip=149.199.60.83; envelope-from=soren.brinkmann@xilinx.com; helo=xsj-gw1 ; helo=xsj-gw1 ; Received: from mail71-co1 (localhost.localdomain [127.0.0.1]) by mail71-co1 (MessageSwitch) id 1362163905976054_31898; Fri, 1 Mar 2013 18:51:45 +0000 (UTC) Received: from CO1EHSMHS031.bigfish.com (unknown [10.243.78.246]) by mail71-co1.bigfish.com (Postfix) with ESMTP id E70D2B8004D; Fri, 1 Mar 2013 18:51:45 +0000 (UTC) Received: from xsj-gw1 (149.199.60.83) by CO1EHSMHS031.bigfish.com (10.243.66.41) with Microsoft SMTP Server id 14.1.225.23; Fri, 1 Mar 2013 18:51:44 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-smtp1.xilinx.com) by xsj-gw1 with esmtp (Exim 4.63) (envelope-from ) id 1UBV3Y-0004v4-GZ; Fri, 01 Mar 2013 10:51:44 -0800 From: Soren Brinkmann To: Michal Simek , , Russell King , Gregory CLEMENT , Will Deacon , Jason Cooper , Tony Lindgren Subject: [PATCH RFC] arm: l2x0: Leverage power saving features Date: Fri, 1 Mar 2013 10:51:26 -0800 X-Mailer: git-send-email 1.8.1.3 MIME-Version: 1.0 X-OriginalArrivalTime: 01 Mar 2013 18:51:43.0359 (UTC) FILETIME=[D11990F0:01CE16AD] X-RCIS-Action: ALLOW Message-ID: X-OriginatorOrg: xilinx.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130301_135153_399672_BBFE03FB X-CRM114-Status: GOOD ( 10.95 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.180.186 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Soren Brinkmann , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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 Enable the 'dynamic clock stop' and 'standby mode' features in the l2x0 disable path. Signed-off-by: Soren Brinkmann --- Hi, we are currently implementing a suspend to RAM like low power mode for Zynq. The code for entering suspend looks like this: outer_disable(); cpu_suspend(0, zynq_pm_suspend); outer_resume(); In our low power guidelines we mention the pl310's standby and clock stop feature and that they should be enabled for low power modes. The question arising here now is: Does the outer_disable() make these features redundant, or does it make sense to add it like shown in this patch? Thanks, Sören arch/arm/mm/cache-l2x0.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index c2f3739..3565df1 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -286,8 +286,20 @@ static void l2x0_flush_range(unsigned long start, unsigned long end) static void l2x0_disable(void) { unsigned long flags; + unsigned long reg; + u32 l2x0_revision; raw_spin_lock_irqsave(&l2x0_lock, flags); + + l2x0_revision = readl_relaxed(l2x0_base + L2X0_CACHE_ID) & + L2X0_CACHE_ID_RTL_MASK; + + if (l2x0_revision >= L2X0_CACHE_ID_RTL_R3P0) { + reg = readl_relaxed(l2x0_base + L2X0_POWER_CTRL); + reg |= L2X0_STNDBY_MODE_EN | L2X0_DYNAMIC_CLK_GATING_EN; + writel_relaxed(reg, l2x0_base + L2X0_POWER_CTRL); + } + __l2x0_flush_all(); writel_relaxed(0, l2x0_base + L2X0_CTRL); dsb();