summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2012-07-30 12:48:57 +0800
committerAndy Green <andy.green@linaro.org>2012-07-30 12:48:57 +0800
commitb984b9cc9e7fa69309ab102f9aa4c6128cf5a750 (patch)
tree1da06abcff11cec6f1f2f658c7ccb6b60967deea
parent8b5c7315a2ecd2abb57eaa2b41906d17df1fb5ef (diff)
omap: hwmod: enable clocks before deasserting hardreset
The enable code currently deasserts the hard-reset before turning on the clocks. These kind of reset lines are limited only to processor-device like IPs such as DSP or IPU or IVA, which actually need the clock to be enabled first. The code that deasserts the hard-reset has therefore been relocated to execute after the clocks are enabled, to avoid the hard-deassert traces (failed to hard reset). Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Juan Gutierrez <jgutierrez@ti.com> Signed-off-by: Paul Hunt <hunt@ti.com> Signed-off-by: Oleg Matcovschi <oleg.matcovschi@ti.com>
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index b6557a9e04c..2458eb39f00 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1646,16 +1646,6 @@ static int _enable(struct omap_hwmod *oh)
return -EINVAL;
}
-
- /*
- * If an IP contains only one HW reset line, then de-assert it in order
- * to allow the module state transition. Otherwise the PRCM will return
- * Intransition status, and the init will failed.
- */
- if ((oh->_state == _HWMOD_STATE_INITIALIZED ||
- oh->_state == _HWMOD_STATE_DISABLED) && oh->rst_lines_cnt == 1)
- _deassert_hardreset(oh, oh->rst_lines[0].name);
-
/* Mux pins for device runtime if populated */
if (oh->mux && (!oh->mux->enabled ||
((oh->_state == _HWMOD_STATE_IDLE) &&
@@ -1686,6 +1676,16 @@ static int _enable(struct omap_hwmod *oh)
_omap_update_context_lost(oh);
+ /*
+ * If an IP contains only one HW reset line, then de-assert it to have
+ * the module functional. deassert_hardreset is currently limited only
+ * to processor device-like IPs - IPU, DSP and IVA, so we can safely
+ * call it after enabling clocks.
+ */
+ if ((oh->_state == _HWMOD_STATE_INITIALIZED ||
+ oh->_state == _HWMOD_STATE_DISABLED) && oh->rst_lines_cnt == 1)
+ _deassert_hardreset(oh, oh->rst_lines[0].name);
+
r = _wait_target_ready(oh);
if (!r) {
/*