diff options
author | Miguel Vadillo <vadillo@ti.com> | 2011-03-22 20:19:04 -0500 |
---|---|---|
committer | Dan Murphy <dmurphy@ti.com> | 2011-04-11 14:14:38 -0500 |
commit | 7036e2a3f6553ba57b16371753bbfaa564196dce (patch) | |
tree | 221ead21d4d978751158a7c76d3a377e059da548 | |
parent | 591644504eaf95498c925032dab6efdfeb7797b3 (diff) | |
download | pandroid-7036e2a3f6553ba57b16371753bbfaa564196dce.tar.gz |
syslink: ipu_pm: enable/disable wd in runtime
Add the possibility to enable and disable in
runtime the wd feature.
In order to disable watchdog timer the flag wdt_allowed
should be set to 0 and wd will be disabled.
Set the flag back to 1 to re-enable the wd feature.
This flag is located in the member pm_flags of the sms struct
and it is the 7 bit X0000000b.
Also changing the name of the pm_flags members to match
the kernel code convention.
Change-Id: I6dde896886784a8858dc42a5ceb480f43e3f12b9
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
-rw-r--r-- | drivers/dsp/syslink/ipu_pm/ipu_pm.c | 31 | ||||
-rw-r--r-- | drivers/dsp/syslink/ipu_pm/ipu_pm.h | 17 |
2 files changed, 28 insertions, 20 deletions
diff --git a/drivers/dsp/syslink/ipu_pm/ipu_pm.c b/drivers/dsp/syslink/ipu_pm/ipu_pm.c index b0bc5f9db06..c017a5d122d 100644 --- a/drivers/dsp/syslink/ipu_pm/ipu_pm.c +++ b/drivers/dsp/syslink/ipu_pm/ipu_pm.c @@ -2609,14 +2609,14 @@ int ipu_pm_restore_ctx(int proc_id) if (first_time) { /* Enable/disable ipu hibernation*/ #ifdef CONFIG_SYSLINK_IPU_SELF_HIBERNATION - handle->rcb_table->pm_flags.hibernateAllowed = 1; + handle->rcb_table->pm_flags.hibernate_allowed = 1; /* turn on ducati hibernation timer */ ipu_pm_timer_state(PM_HIB_TIMER_ON); #else - handle->rcb_table->pm_flags.hibernateAllowed = 0; + handle->rcb_table->pm_flags.hibernate_allowed = 0; #endif pr_debug("hibernateAllowed=%d\n", - handle->rcb_table->pm_flags.hibernateAllowed); + handle->rcb_table->pm_flags.hibernate_allowed); first_time = 0; cm_write_mod_reg(HW_AUTO, OMAP4430_CM2_CORE_MOD, @@ -2686,7 +2686,7 @@ exit: #ifdef CONFIG_SYSLINK_IPU_SELF_HIBERNATION /* turn on ducati hibernation timer */ if ((params->hib_timer_state == PM_HIB_TIMER_OFF) && - global_rcb->pm_flags.hibernateAllowed) + global_rcb->pm_flags.hibernate_allowed) ipu_pm_timer_state(PM_HIB_TIMER_ON); #endif mutex_unlock(ipu_pm_state.gate_handle); @@ -3140,14 +3140,17 @@ static int ipu_pm_timer_state(int event) if (params->hib_timer_state == PM_HIB_TIMER_ON) { pr_debug("Starting hibernation, waking up M3 cores"); handle->rcb_table->state_flag |= (SYS_PROC_HIB | - APP_PROC_HIB | ENABLE_IPU_HIB); + APP_PROC_HIB | + ENABLE_IPU_HIB); #ifdef CONFIG_DUCATI_WATCH_DOG - if (sys_rproc->dmtimer != NULL) - omap_dm_timer_set_load(sys_rproc->dmtimer, 1, - params->wdt_time); - params->hib_timer_state = PM_HIB_TIMER_WDRESET; - } else if (params->hib_timer_state == - PM_HIB_TIMER_WDRESET) { + if (global_rcb->pm_flags.wdt_allowed) { + if (sys_rproc->dmtimer != NULL) + omap_dm_timer_set_load( + sys_rproc->dmtimer, 1, + params->wdt_time); + params->hib_timer_state = PM_HIB_TIMER_WDRESET; + } + } else if (params->hib_timer_state == PM_HIB_TIMER_WDRESET) { /* notify devh to begin error recovery here */ pr_debug("Timer ISR: Trigger WD reset + recovery\n"); ipu_pm_recover_schedule(); @@ -3177,7 +3180,7 @@ static int ipu_pm_timer_state(int event) * having to rebuild the kernel. * Very useful when debugging IPU. */ - if (!global_rcb->pm_flags.hibernateAllowed) + if (!global_rcb->pm_flags.hibernate_allowed) break; if (params->hib_timer_state == PM_HIB_TIMER_RESET) { @@ -3194,6 +3197,10 @@ static int ipu_pm_timer_state(int event) (void *)sys_rproc->dmtimer); if (retval < 0) pr_warn("request_irq status: %x\n", retval); +#ifdef CONFIG_DUCATI_WATCH_DOG + /* Enable Watchdog */ + global_rcb->pm_flags.wdt_allowed = 1; +#endif /* * store the dmtimer handle locally to use during * free_irq as dev_id token in cases where the remote diff --git a/drivers/dsp/syslink/ipu_pm/ipu_pm.h b/drivers/dsp/syslink/ipu_pm/ipu_pm.h index 121c7e92255..56cbf7937e2 100644 --- a/drivers/dsp/syslink/ipu_pm/ipu_pm.h +++ b/drivers/dsp/syslink/ipu_pm/ipu_pm.h @@ -362,14 +362,15 @@ union message_slicer { }; struct ipu_pm_override { - unsigned hibernateAllowed:1; - unsigned retentionAllowed:1; - unsigned inactiveAllowed:1; - unsigned cmAutostateAllowed:1; - unsigned deepSleepAllowed:1; - unsigned wfiAllowed:1; - unsigned idleAllowed:1; - unsigned reserved:24; + unsigned hibernate_allowed:1; + unsigned retention_allowed:1; + unsigned inactive_allowed:1; + unsigned cm_autostate_allowed:1; + unsigned deep_sleep_allowed:1; + unsigned wfi_allowed:1; + unsigned idle_allowed:1; + unsigned wdt_allowed:1; + unsigned reserved:23; unsigned highbit:1; }; |