From patchwork Fri Oct 11 16:15:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 3025101 Return-Path: X-Original-To: patchwork-linux-omap@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 C6307BF924 for ; Fri, 11 Oct 2013 16:16:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEE6820253 for ; Fri, 11 Oct 2013 16:16:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B085201BC for ; Fri, 11 Oct 2013 16:16:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758567Ab3JKQQb (ORCPT ); Fri, 11 Oct 2013 12:16:31 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:56925 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758558Ab3JKQQb (ORCPT ); Fri, 11 Oct 2013 12:16:31 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r9BGG74U027460; Fri, 11 Oct 2013 11:16:07 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r9BGG7wf009713; Fri, 11 Oct 2013 11:16:07 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Fri, 11 Oct 2013 11:16:07 -0500 Received: from sokoban.tieu.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id r9BGFnEQ005990; Fri, 11 Oct 2013 11:16:06 -0500 From: Tero Kristo To: , , , CC: Subject: [PATCH 07/11] ARM: OMAP3: CM/PM: add new API for checking IVA2 idle status Date: Fri, 11 Oct 2013 19:15:37 +0300 Message-ID: <1381508141-15244-8-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381508141-15244-1-git-send-email-t-kristo@ti.com> References: <1381508141-15244-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 OMAP3 PM code needs this functionality during the IVA2 reset, but is currently using direct CM register accesses for this purpose. Implement a new API so the PM code can use this instead. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/cm3xxx.c | 6 ++++++ arch/arm/mach-omap2/cm3xxx.h | 1 + arch/arm/mach-omap2/pm34xx.c | 3 +-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/cm3xxx.c b/arch/arm/mach-omap2/cm3xxx.c index 55bf939..b0509b9 100644 --- a/arch/arm/mach-omap2/cm3xxx.c +++ b/arch/arm/mach-omap2/cm3xxx.c @@ -696,6 +696,12 @@ void omap3_cm_force_iva_clk(bool enable) omap2_cm_write_mod_reg(val, OMAP3430_IVA2_MOD, CM_FCLKEN); } +bool omap3_cm_is_iva_active(void) +{ + return omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSTST) & + OMAP3430_CLKACTIVITY_IVA2_MASK; +} + /* * */ diff --git a/arch/arm/mach-omap2/cm3xxx.h b/arch/arm/mach-omap2/cm3xxx.h index 61fdfc7..a944b5f 100644 --- a/arch/arm/mach-omap2/cm3xxx.h +++ b/arch/arm/mach-omap2/cm3xxx.h @@ -87,6 +87,7 @@ extern void omap3_cm_save_scratchpad_contents(u32 *ptr); extern u32 omap3_cm_write_module_clken(s16 module, u8 regs, bool fck, u32 val); extern u32 omap3_cm_read_module_clken(s16 module, u8 regs, bool fck); extern void omap3_cm_force_iva_clk(bool enable); +extern bool omap3_cm_is_iva_active(void); extern int __init omap3xxx_cm_init(void); diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index ede058a..a73a012 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -415,8 +415,7 @@ static void __init omap3_iva_idle(void) omap3_cm_force_iva_clk(false); /* if no clock activity, nothing else to do */ - if (!(omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSTST) & - OMAP3430_CLKACTIVITY_IVA2_MASK)) + if (!omap3_cm_is_iva_active()) return; /* Reset IVA2 */