From patchwork Thu Mar 5 13:13:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Gerlach X-Patchwork-Id: 446700 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A3CE81400B7 for ; Fri, 6 Mar 2015 00:14:19 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932565AbbCENOP (ORCPT ); Thu, 5 Mar 2015 08:14:15 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:35203 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754706AbbCENOO (ORCPT ); Thu, 5 Mar 2015 08:14:14 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t25DDjL2012919; Thu, 5 Mar 2015 07:13:45 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t25DDiHW017256; Thu, 5 Mar 2015 07:13:44 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Thu, 5 Mar 2015 07:13:44 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t25DDhpD031870; Thu, 5 Mar 2015 07:13:43 -0600 Received: from localhost (j-172-22-175-66.vpn.ti.com [172.22.175.66]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id t25DDh909957; Thu, 5 Mar 2015 07:13:43 -0600 (CST) From: Dave Gerlach To: , , CC: Paul Walmsley , Tony Lindgren , KEERTHY , Dave Gerlach Subject: [PATCH 1/4] ARM: OMAP2+: omap_hwmod: Introduce ti, no-init dt property Date: Thu, 5 Mar 2015 07:13:28 -0600 Message-ID: <1425561211-31003-2-git-send-email-d-gerlach@ti.com> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1425561211-31003-1-git-send-email-d-gerlach@ti.com> References: <1425561211-31003-1-git-send-email-d-gerlach@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Introduce a dt property, ti,no-init, that prevents hwmod initialization. Even if a dt node is marked as disabled, hwmod still at least enables the hwmod and programs the sysconfig before attempting to idle it at boot. If an IP has been disabled by the hardware configuration on a platform, this will cause a hang due to writing to inactive registers. This property prevents that from happening by marking the hwmod as _HWMOD_STATE_DISABLED during init. Signed-off-by: Dave Gerlach --- Documentation/devicetree/bindings/arm/omap/omap.txt | 2 ++ arch/arm/mach-omap2/omap_hwmod.c | 7 ++++++- arch/arm/mach-omap2/omap_hwmod.h | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt index 4f6a82c..7c0d3a53 100644 --- a/Documentation/devicetree/bindings/arm/omap/omap.txt +++ b/Documentation/devicetree/bindings/arm/omap/omap.txt @@ -23,6 +23,8 @@ Optional properties: during suspend. - ti,no-reset-on-init: When present, the module should not be reset at init - ti,no-idle-on-init: When present, the module should not be idled at init +- ti,no_init: When present, the module is marked as disabled immediately and + no setup is done. Example: diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 92afb72..e835f61 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2471,9 +2471,14 @@ static int __init _init(struct omap_hwmod *oh, void *data) oh->flags |= HWMOD_INIT_NO_RESET; if (of_find_property(np, "ti,no-idle-on-init", NULL)) oh->flags |= HWMOD_INIT_NO_IDLE; + if (of_find_property(np, "ti,no-init", NULL)) + oh->flags |= HWMOD_NO_INIT; } - oh->_state = _HWMOD_STATE_INITIALIZED; + if (oh->flags & HWMOD_NO_INIT) + oh->_state = _HWMOD_STATE_DISABLED; + else + oh->_state = _HWMOD_STATE_INITIALIZED; return 0; } diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h index 9d4bec6e..75061fc 100644 --- a/arch/arm/mach-omap2/omap_hwmod.h +++ b/arch/arm/mach-omap2/omap_hwmod.h @@ -517,6 +517,9 @@ struct omap_hwmod_omap4_prcm { * HWMOD_RECONFIG_IO_CHAIN: omap_hwmod code needs to reconfigure wake-up * events by calling _reconfigure_io_chain() when a device is enabled * or idled. + * HWMOD_NO_INIT: Do not initialize the hwmod. Useful for when certain + * platforms disable the IP through hardware configuration, like the + * RTC on the AM437x EPOS EVM. */ #define HWMOD_SWSUP_SIDLE (1 << 0) #define HWMOD_SWSUP_MSTANDBY (1 << 1) @@ -532,6 +535,7 @@ struct omap_hwmod_omap4_prcm { #define HWMOD_FORCE_MSTANDBY (1 << 11) #define HWMOD_SWSUP_SIDLE_ACT (1 << 12) #define HWMOD_RECONFIG_IO_CHAIN (1 << 13) +#define HWMOD_NO_INIT (1 << 14) /* * omap_hwmod._int_flags definitions