aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2017-03-17 04:58:18 -0400
committerTony Lindgren <tony@atomide.com>2017-03-23 16:19:59 -0400
commit8ff42da411474893ae373d4280ea88954fa97fcc (patch)
treecdf50dc9abaa194cb004790436290566512d4d66
parent390c06828dd22549706946113a0783cb8e2a3240 (diff)
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: Roger Quadros <rogerq@ti.com> [nsekhar@ti.com: rebased to v4.9 kernel] Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c9
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h5
2 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 8a4039325845..8bcea0d83fa0 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2027,7 +2027,7 @@ static int _enable(struct omap_hwmod *oh)
2027 2027
2028 r = (soc_ops.wait_target_ready) ? soc_ops.wait_target_ready(oh) : 2028 r = (soc_ops.wait_target_ready) ? soc_ops.wait_target_ready(oh) :
2029 -EINVAL; 2029 -EINVAL;
2030 if (oh->clkdm) 2030 if (oh->clkdm && !(oh->flags & HWMOD_CLKDM_NOAUTO))
2031 clkdm_allow_idle(oh->clkdm); 2031 clkdm_allow_idle(oh->clkdm);
2032 2032
2033 if (!r) { 2033 if (!r) {
@@ -2084,7 +2084,12 @@ static int _idle(struct omap_hwmod *oh)
2084 _idle_sysc(oh); 2084 _idle_sysc(oh);
2085 _del_initiator_dep(oh, mpu_oh); 2085 _del_initiator_dep(oh, mpu_oh);
2086 2086
2087 if (oh->clkdm) 2087 /*
2088 * If HWMOD_CLKDM_NOAUTO is set then we don't
2089 * deny idle the clkdm again since idle was already denied
2090 * in _enable()
2091 */
2092 if (oh->clkdm && !(oh->flags & HWMOD_CLKDM_NOAUTO))
2088 clkdm_deny_idle(oh->clkdm); 2093 clkdm_deny_idle(oh->clkdm);
2089 2094
2090 if (oh->flags & HWMOD_BLOCK_WFI) 2095 if (oh->flags & HWMOD_BLOCK_WFI)
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 7ba9f53145dd..a8f779381fd8 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -531,6 +531,10 @@ struct omap_hwmod_omap4_prcm {
531 * operate and they need to be handled at the same time as the main_clk. 531 * operate and they need to be handled at the same time as the main_clk.
532 * HWMOD_NO_IDLE: Do not idle the hwmod at all. Useful to handle certain 532 * HWMOD_NO_IDLE: Do not idle the hwmod at all. Useful to handle certain
533 * IPs like CPSW on DRA7, where clocks to this module cannot be disabled. 533 * IPs like CPSW on DRA7, where clocks to this module cannot be disabled.
534 * HWMOD_CLKDM_NOAUTO: Allows the hwmod's clockdomain to be prevented from
535 * entering HW_AUTO while hwmod is active. This is needed to workaround
536 * some modules which don't function correctly with HW_AUTO. For example,
537 * DCAN on DRA7x SoC needs this to workaround errata i893.
534 */ 538 */
535#define HWMOD_SWSUP_SIDLE (1 << 0) 539#define HWMOD_SWSUP_SIDLE (1 << 0)
536#define HWMOD_SWSUP_MSTANDBY (1 << 1) 540#define HWMOD_SWSUP_MSTANDBY (1 << 1)
@@ -548,6 +552,7 @@ struct omap_hwmod_omap4_prcm {
548#define HWMOD_RECONFIG_IO_CHAIN (1 << 13) 552#define HWMOD_RECONFIG_IO_CHAIN (1 << 13)
549#define HWMOD_OPT_CLKS_NEEDED (1 << 14) 553#define HWMOD_OPT_CLKS_NEEDED (1 << 14)
550#define HWMOD_NO_IDLE (1 << 15) 554#define HWMOD_NO_IDLE (1 << 15)
555#define HWMOD_CLKDM_NOAUTO (1 << 16)
551 556
552/* 557/*
553 * omap_hwmod._int_flags definitions 558 * omap_hwmod._int_flags definitions