From b984b9cc9e7fa69309ab102f9aa4c6128cf5a750 Mon Sep 17 00:00:00 2001 From: Suman Anna Date: Mon, 30 Jul 2012 12:48:57 +0800 Subject: 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 Signed-off-by: Juan Gutierrez Signed-off-by: Paul Hunt Signed-off-by: Oleg Matcovschi --- arch/arm/mach-omap2/omap_hwmod.c | 20 ++++++++++---------- 1 file 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) { /* -- cgit v1.2.3