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: 5945961 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 056EF9F373 for ; Thu, 5 Mar 2015 13:14:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0809620380 for ; Thu, 5 Mar 2015 13:14:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEEDD20386 for ; Thu, 5 Mar 2015 13:14:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932566AbbCENOP (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: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 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