Commit 5f376097 authored by Tony Lindgren's avatar Tony Lindgren

Merge branch 'for_3.5/fixes/pm-3' of...

Merge branch 'for_3.5/fixes/pm-3' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into fixes
parents fa2976a8 006c7f18
...@@ -31,12 +31,16 @@ ...@@ -31,12 +31,16 @@
* *
* CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this * CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this
* clockdomain. (Currently, this applies to OMAP3 clockdomains only.) * clockdomain. (Currently, this applies to OMAP3 clockdomains only.)
* CLKDM_ACTIVE_WITH_MPU: The PRCM guarantees that this clockdomain is
* active whenever the MPU is active. True for interconnects and
* the WKUP clockdomains.
*/ */
#define CLKDM_CAN_FORCE_SLEEP (1 << 0) #define CLKDM_CAN_FORCE_SLEEP (1 << 0)
#define CLKDM_CAN_FORCE_WAKEUP (1 << 1) #define CLKDM_CAN_FORCE_WAKEUP (1 << 1)
#define CLKDM_CAN_ENABLE_AUTO (1 << 2) #define CLKDM_CAN_ENABLE_AUTO (1 << 2)
#define CLKDM_CAN_DISABLE_AUTO (1 << 3) #define CLKDM_CAN_DISABLE_AUTO (1 << 3)
#define CLKDM_NO_AUTODEPS (1 << 4) #define CLKDM_NO_AUTODEPS (1 << 4)
#define CLKDM_ACTIVE_WITH_MPU (1 << 5)
#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO)
#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
......
...@@ -88,4 +88,5 @@ struct clockdomain wkup_common_clkdm = { ...@@ -88,4 +88,5 @@ struct clockdomain wkup_common_clkdm = {
.name = "wkup_clkdm", .name = "wkup_clkdm",
.pwrdm = { .name = "wkup_pwrdm" }, .pwrdm = { .name = "wkup_pwrdm" },
.dep_bit = OMAP_EN_WKUP_SHIFT, .dep_bit = OMAP_EN_WKUP_SHIFT,
.flags = CLKDM_ACTIVE_WITH_MPU,
}; };
...@@ -381,7 +381,7 @@ static struct clockdomain l4_wkup_44xx_clkdm = { ...@@ -381,7 +381,7 @@ static struct clockdomain l4_wkup_44xx_clkdm = {
.cm_inst = OMAP4430_PRM_WKUP_CM_INST, .cm_inst = OMAP4430_PRM_WKUP_CM_INST,
.clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS,
.dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT, .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT,
.flags = CLKDM_CAN_HWSUP, .flags = CLKDM_CAN_HWSUP | CLKDM_ACTIVE_WITH_MPU,
}; };
static struct clockdomain emu_sys_44xx_clkdm = { static struct clockdomain emu_sys_44xx_clkdm = {
......
...@@ -1124,15 +1124,18 @@ static struct omap_hwmod_addr_space * __init _find_mpu_rt_addr_space(struct omap ...@@ -1124,15 +1124,18 @@ static struct omap_hwmod_addr_space * __init _find_mpu_rt_addr_space(struct omap
* _enable_sysc - try to bring a module out of idle via OCP_SYSCONFIG * _enable_sysc - try to bring a module out of idle via OCP_SYSCONFIG
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
* *
* If module is marked as SWSUP_SIDLE, force the module out of slave * Ensure that the OCP_SYSCONFIG register for the IP block represented
* idle; otherwise, configure it for smart-idle. If module is marked * by @oh is set to indicate to the PRCM that the IP block is active.
* as SWSUP_MSUSPEND, force the module out of master standby; * Usually this means placing the module into smart-idle mode and
* otherwise, configure it for smart-standby. No return value. * smart-standby, but if there is a bug in the automatic idle handling
* for the IP block, it may need to be placed into the force-idle or
* no-idle variants of these modes. No return value.
*/ */
static void _enable_sysc(struct omap_hwmod *oh) static void _enable_sysc(struct omap_hwmod *oh)
{ {
u8 idlemode, sf; u8 idlemode, sf;
u32 v; u32 v;
bool clkdm_act;
if (!oh->class->sysc) if (!oh->class->sysc)
return; return;
...@@ -1141,8 +1144,16 @@ static void _enable_sysc(struct omap_hwmod *oh) ...@@ -1141,8 +1144,16 @@ static void _enable_sysc(struct omap_hwmod *oh)
sf = oh->class->sysc->sysc_flags; sf = oh->class->sysc->sysc_flags;
if (sf & SYSC_HAS_SIDLEMODE) { if (sf & SYSC_HAS_SIDLEMODE) {
idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? clkdm_act = ((oh->clkdm &&
HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; oh->clkdm->flags & CLKDM_ACTIVE_WITH_MPU) ||
(oh->_clk && oh->_clk->clkdm &&
oh->_clk->clkdm->flags & CLKDM_ACTIVE_WITH_MPU));
if (clkdm_act && !(oh->class->sysc->idlemodes &
(SIDLE_SMART | SIDLE_SMART_WKUP)))
idlemode = HWMOD_IDLEMODE_FORCE;
else
idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ?
HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART;
_set_slave_idlemode(oh, idlemode, &v); _set_slave_idlemode(oh, idlemode, &v);
} }
...@@ -1208,8 +1219,13 @@ static void _idle_sysc(struct omap_hwmod *oh) ...@@ -1208,8 +1219,13 @@ static void _idle_sysc(struct omap_hwmod *oh)
sf = oh->class->sysc->sysc_flags; sf = oh->class->sysc->sysc_flags;
if (sf & SYSC_HAS_SIDLEMODE) { if (sf & SYSC_HAS_SIDLEMODE) {
idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? /* XXX What about HWMOD_IDLEMODE_SMART_WKUP? */
HWMOD_IDLEMODE_FORCE : HWMOD_IDLEMODE_SMART; if (oh->flags & HWMOD_SWSUP_SIDLE ||
!(oh->class->sysc->idlemodes &
(SIDLE_SMART | SIDLE_SMART_WKUP)))
idlemode = HWMOD_IDLEMODE_FORCE;
else
idlemode = HWMOD_IDLEMODE_SMART;
_set_slave_idlemode(oh, idlemode, &v); _set_slave_idlemode(oh, idlemode, &v);
} }
......
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