Subject: [PATCH 04/12] ARM: OMAP2+: hwmod: Introduce a flag to deassert the HW reset line

From: Andre Heider <[email-masked]>
Date: Sun, 29 Jun 2014 18:21:39 +0200

hwmod's hardreset lines are not deasserted after a reset.
Add the HWMOD_INIT_DEASSERT_HARD_RESET flag to deassert those after a
successful reset.

This is required to get the PRU-ICSS in a usable state on am33xx SoCs.

Signed-off-by: Andre Heider <[email-masked]>
---
 arch/arm/mach-omap2/omap_hwmod.c |    2 ++
 arch/arm/mach-omap2/omap_hwmod.h |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 9025fff..758be0a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2542,6 +2542,8 @@ static int __init _setup_reset(struct omap_hwmod *oh)
 
 	if (!(oh->flags & HWMOD_INIT_NO_RESET))
 		r = _reset(oh);
+	if (!r && oh->flags & HWMOD_INIT_DEASSERT_HARD_RESET)
+		r = _deassert_hardreset(oh, oh->name);
 
 	return r;
 }
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 5b42faf..5e45006 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -517,6 +517,7 @@ 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_INIT_DEASSERT_HARD_RESET: deassert the HW reset line at boot
  */
 #define HWMOD_SWSUP_SIDLE			(1 << 0)
 #define HWMOD_SWSUP_MSTANDBY			(1 << 1)
@@ -532,6 +533,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_INIT_DEASSERT_HARD_RESET		(1 << 14)
 
 /*
  * omap_hwmod._int_flags definitions
-- 
1.7.10.4