Commit 8ff42da4 authored by Roger Quadros's avatar Roger Quadros Committed by Tony Lindgren

ARM: OMAP2+ hwmod: Allow modules to disable HW_AUTO

Introduce HWMOD_CLKDM_NOAUTO flag that allows the hwmod's
clockdomain to be prevented from HW_AUTO while the hwmod is active.

This is needed to workaround some modules which don't function
correctly with HW_AUTO. e.g. DCAN on DRA7.
Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
[nsekhar@ti.com: rebased to v4.9 kernel]
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 390c0682
...@@ -2027,7 +2027,7 @@ static int _enable(struct omap_hwmod *oh) ...@@ -2027,7 +2027,7 @@ static int _enable(struct omap_hwmod *oh)
r = (soc_ops.wait_target_ready) ? soc_ops.wait_target_ready(oh) : r = (soc_ops.wait_target_ready) ? soc_ops.wait_target_ready(oh) :
-EINVAL; -EINVAL;
if (oh->clkdm) if (oh->clkdm && !(oh->flags & HWMOD_CLKDM_NOAUTO))
clkdm_allow_idle(oh->clkdm); clkdm_allow_idle(oh->clkdm);
if (!r) { if (!r) {
...@@ -2084,7 +2084,12 @@ static int _idle(struct omap_hwmod *oh) ...@@ -2084,7 +2084,12 @@ static int _idle(struct omap_hwmod *oh)
_idle_sysc(oh); _idle_sysc(oh);
_del_initiator_dep(oh, mpu_oh); _del_initiator_dep(oh, mpu_oh);
if (oh->clkdm) /*
* If HWMOD_CLKDM_NOAUTO is set then we don't
* deny idle the clkdm again since idle was already denied
* in _enable()
*/
if (oh->clkdm && !(oh->flags & HWMOD_CLKDM_NOAUTO))
clkdm_deny_idle(oh->clkdm); clkdm_deny_idle(oh->clkdm);
if (oh->flags & HWMOD_BLOCK_WFI) if (oh->flags & HWMOD_BLOCK_WFI)
......
...@@ -531,6 +531,10 @@ struct omap_hwmod_omap4_prcm { ...@@ -531,6 +531,10 @@ struct omap_hwmod_omap4_prcm {
* operate and they need to be handled at the same time as the main_clk. * operate and they need to be handled at the same time as the main_clk.
* HWMOD_NO_IDLE: Do not idle the hwmod at all. Useful to handle certain * HWMOD_NO_IDLE: Do not idle the hwmod at all. Useful to handle certain
* IPs like CPSW on DRA7, where clocks to this module cannot be disabled. * IPs like CPSW on DRA7, where clocks to this module cannot be disabled.
* HWMOD_CLKDM_NOAUTO: Allows the hwmod's clockdomain to be prevented from
* entering HW_AUTO while hwmod is active. This is needed to workaround
* some modules which don't function correctly with HW_AUTO. For example,
* DCAN on DRA7x SoC needs this to workaround errata i893.
*/ */
#define HWMOD_SWSUP_SIDLE (1 << 0) #define HWMOD_SWSUP_SIDLE (1 << 0)
#define HWMOD_SWSUP_MSTANDBY (1 << 1) #define HWMOD_SWSUP_MSTANDBY (1 << 1)
...@@ -548,6 +552,7 @@ struct omap_hwmod_omap4_prcm { ...@@ -548,6 +552,7 @@ struct omap_hwmod_omap4_prcm {
#define HWMOD_RECONFIG_IO_CHAIN (1 << 13) #define HWMOD_RECONFIG_IO_CHAIN (1 << 13)
#define HWMOD_OPT_CLKS_NEEDED (1 << 14) #define HWMOD_OPT_CLKS_NEEDED (1 << 14)
#define HWMOD_NO_IDLE (1 << 15) #define HWMOD_NO_IDLE (1 << 15)
#define HWMOD_CLKDM_NOAUTO (1 << 16)
/* /*
* omap_hwmod._int_flags definitions * omap_hwmod._int_flags definitions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment