From patchwork Fri Jan 4 13:02:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastien Guiriec X-Patchwork-Id: 1932871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 2901C3FF0F for ; Fri, 4 Jan 2013 13:06:00 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tr6um-000293-R4; Fri, 04 Jan 2013 13:02:24 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tr6ub-00027V-TD for linux-arm-kernel@lists.infradead.org; Fri, 04 Jan 2013 13:02:15 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r04D2B6b009201; Fri, 4 Jan 2013 07:02:11 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r04D2BoQ029016; Fri, 4 Jan 2013 07:02:11 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Fri, 4 Jan 2013 07:02:12 -0600 Received: from unb0919150.emea.dhcp.ti.com (unb0919150.emea.dhcp.ti.com [137.167.110.144]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r04D27PF015497; Fri, 4 Jan 2013 07:02:10 -0600 From: Sebastien Guiriec To: Sebastien Guiriec , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Paul Walmsley , Tony Lindgren , Subject: [PATCH 1/3] ARM: OMAP2+: hwmod: rename flag to prevent hwmod code from touching IP block during init Date: Fri, 4 Jan 2013 14:02:04 +0100 Message-ID: <1357304526-21557-2-git-send-email-s-guiriec@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1357304526-21557-1-git-send-email-s-guiriec@ti.com> References: <1357304526-21557-1-git-send-email-s-guiriec@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130104_080214_151406_2CB9654A X-CRM114-Status: GOOD ( 18.35 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Peter Ujfalusi , Tero Kristo , Liam Girdwood , linux-arm-kernel@lists.infradead.org, Jon Hunter X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Rename HWMOD_EXT_OPT_MAIN_CLK flag to indicate that this IP block is dependent on an off-chip functional clock that is not guaranteed to be present during initialization. Same flag can be use for IP with additional HW registers to control Auto IDLE mode. Signed-off-by: Sebastien Guiriec --- arch/arm/mach-omap2/omap_hwmod.c | 2 +- arch/arm/mach-omap2/omap_hwmod.h | 10 ++++++++-- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 4653efb..640c179 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2447,7 +2447,7 @@ static int __init _setup_reset(struct omap_hwmod *oh) if (oh->_state != _HWMOD_STATE_INITIALIZED) return -EINVAL; - if (oh->flags & HWMOD_EXT_OPT_MAIN_CLK) + if (oh->flags & HWMOD_NO_SETUP_RESET) return -EPERM; if (oh->rst_lines_cnt == 0) { diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h index 3ae852a..ce4bed4 100644 --- a/arch/arm/mach-omap2/omap_hwmod.h +++ b/arch/arm/mach-omap2/omap_hwmod.h @@ -446,11 +446,17 @@ struct omap_hwmod_omap4_prcm { * in order to complete the reset. Optional clocks will be disabled * again after the reset. * HWMOD_16BIT_REG: Module has 16bit registers - * HWMOD_EXT_OPT_MAIN_CLK: The only main functional clock source for + * HWMOD_NO_SETUP_RESET: This flag can be used for 2 problems: + * 1) The only main functional clock source for * this IP block comes from an off-chip source and is not always * enabled. This prevents the hwmod code from being able to * enable and reset the IP block early. XXX Eventually it should * be possible to query the clock framework for this information. + * 2) IP with additional registers for auto gatting control like AESS + * For some IPs we need to set AUTO_GATTING_ENABLE bit. This bit is set + * only when the associated driver is probed. If hwmod is enabling and + * reseting the IP early without setting auto idle bit then clocks are + * not gated. */ #define HWMOD_SWSUP_SIDLE (1 << 0) #define HWMOD_SWSUP_MSTANDBY (1 << 1) @@ -461,7 +467,7 @@ struct omap_hwmod_omap4_prcm { #define HWMOD_NO_IDLEST (1 << 6) #define HWMOD_CONTROL_OPT_CLKS_IN_RESET (1 << 7) #define HWMOD_16BIT_REG (1 << 8) -#define HWMOD_EXT_OPT_MAIN_CLK (1 << 9) +#define HWMOD_NO_SETUP_RESET (1 << 9) /* * omap_hwmod._int_flags definitions diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 129d508..b340a4e 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -2133,7 +2133,7 @@ static struct omap_hwmod omap44xx_mcpdm_hwmod = { * available, so it doesn't seem that we have any choice in * the kernel other than to avoid resetting it. */ - .flags = HWMOD_EXT_OPT_MAIN_CLK, + .flags = HWMOD_NO_SETUP_RESET, .mpu_irqs = omap44xx_mcpdm_irqs, .sdma_reqs = omap44xx_mcpdm_sdma_reqs, .main_clk = "mcpdm_fck",