linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: d-gerlach@ti.com (Dave Gerlach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] ARM: OMAP2+: omap_hwmod: Introduce ti, no-init dt property
Date: Thu, 5 Mar 2015 07:13:28 -0600	[thread overview]
Message-ID: <1425561211-31003-2-git-send-email-d-gerlach@ti.com> (raw)
In-Reply-To: <1425561211-31003-1-git-send-email-d-gerlach@ti.com>

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 <d-gerlach@ti.com>
---
 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
-- 
2.3.0

  reply	other threads:[~2015-03-05 13:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 13:13 [PATCH 0/4] Add AM437x RTC Dave Gerlach
2015-03-05 13:13 ` Dave Gerlach [this message]
2015-03-05 18:16   ` [PATCH 1/4] ARM: OMAP2+: omap_hwmod: Introduce ti,no-init dt property Paul Walmsley
2015-03-05 18:49     ` Tony Lindgren
2015-03-05 19:47       ` Dave Gerlach
2015-03-05 20:17         ` Tony Lindgren
2015-03-06  0:41           ` Tony Lindgren
2015-03-06 17:28             ` Dave Gerlach
2015-03-06 17:45               ` Tony Lindgren
2015-03-10 16:12                 ` Dave Gerlach
2015-03-10 17:36                 ` Grygorii Strashko
2015-03-10 17:59                   ` Dave Gerlach
2015-03-11 16:32                     ` Grygorii Strashko
2015-03-12 20:05                       ` Dave Gerlach
2015-03-05 13:13 ` [PATCH 2/4] ARM: OMAP2+: AM43xx hwmod: Add RTC hwmod for AM43xx Dave Gerlach
2015-03-06  4:26   ` Paul Walmsley
2015-03-06 17:30     ` Dave Gerlach
2015-03-06 17:44       ` Paul Walmsley
2015-03-06 17:50         ` Dave Gerlach
2015-03-07  0:37           ` Paul Walmsley
2015-03-05 13:13 ` [PATCH 3/4] ARM: dts: am43x-epos-evm: Add rtc node with ti, no-init property Dave Gerlach
2015-03-05 13:13 ` [PATCH 4/4] ARM: dts: am437x-gp-evm: Enable RTC Dave Gerlach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425561211-31003-2-git-send-email-d-gerlach@ti.com \
    --to=d-gerlach@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).