diff options
author | Axel Haslam <axelhaslam@ti.com> | 2011-09-29 12:35:48 -0700 |
---|---|---|
committer | Todd Poynor <toddpoynor@google.com> | 2011-10-06 18:47:28 -0700 |
commit | 2580b20e5e8bdaad1535f11d1a8cf1728fad9535 (patch) | |
tree | 00e1d338d9c529373d26a521f2a50cc52558ffad /arch/arm/mach-omap2/pm44xx.c | |
parent | 91756461f157a317be3ae6c43aca245e87c82914 (diff) | |
download | kernel_samsung_tuna-2580b20e5e8bdaad1535f11d1a8cf1728fad9535.zip kernel_samsung_tuna-2580b20e5e8bdaad1535f11d1a8cf1728fad9535.tar.gz kernel_samsung_tuna-2580b20e5e8bdaad1535f11d1a8cf1728fad9535.tar.bz2 |
OMAP4: PM: Tesla (DSP) power domain doesn't transition to OFF
Due to HW bug, same SWakeup signal is used for both MPU and DSP.
Thus Swakeup will unexpectedly wakeup the DSP domain even if nothing runs on
DSP. Since MPU is faster to process SWakeup, it acknowledges the Swakeup to
HSI before the DSP has completed its domain transition. This leaves the DSP
Power Domain in INTRANSITION state forever, and prevents the DEVICE-OFF mode.
PRCM silicon team have proposed following sequence as SW workaround:
when a SWakeup is asserted from HSI to MPU (and DSP) :
- force a DSP SW wakeup
- wait DSP module to be fully ON
- Configure a DSP CLK CTRL to HW_AUTO
- Wait on DSP module to be OFF
Change-Id: I1c7fc7f07afa1f403fec47673cd5aa32d548b2c6
Signed-off-by: Vinay Chaurasia <vinaych@ti.com>
Signed-off-by: Ambresh K <ambresh@ti.com>
Signed-off-by: Axel Haslam <axelhaslam@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm44xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm44xx.c | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index ead759a..6cfd501 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c @@ -864,7 +864,8 @@ static void __init prcm_setup_regs(void) * when a SWakeup is asserted from HSI to MPU (and DSP) : * - force a DSP SW wakeup * - wait DSP module to be fully ON -* - force a DSP SW sleep +* - Configure a DSP CLK CTRL to HW_AUTO +* - Wait on DSP module to be OFF * * Note : we detect a Swakeup is asserted to MPU by checking when an interrupt * is received while HSI module is ON. @@ -873,26 +874,54 @@ static void __init prcm_setup_regs(void) */ static void omap_pm_clear_dsp_wake_up(void) { + int ret; + int timeout = 10; + if (!tesla_pwrdm || !tesla_clkdm) { WARN_ONCE(1, "%s: unable to use tesla workaround\n", __func__); return; } - if (omap4_prminst_read_inst_reg(tesla_pwrdm->prcm_partition, - tesla_pwrdm->prcm_offs, - OMAP4_PM_PWSTST) & OMAP_INTRANSITION_MASK) { + ret = pwrdm_read_pwrst(tesla_pwrdm); + /* If Tesla power state in RET or OFF, then not hit by errata */ + if (ret <= PWRDM_POWER_RET) + return; - if (clkdm_wakeup(tesla_clkdm)) - pr_err("%s: Failed to force wakeup of %s\n", __func__, - tesla_clkdm->name); + if (clkdm_wakeup(tesla_clkdm)) + pr_err("%s: Failed to force wakeup of %s\n", __func__, + tesla_clkdm->name); - /* This takes less than a few microseconds, hence in context */ + /* This takes less than a few microseconds, hence in context */ + pwrdm_wait_transition(tesla_pwrdm); + + /* + * Check current power state of Tesla after transition, to make sure + * that Tesla is indeed turned ON. + */ + ret = pwrdm_read_pwrst(tesla_pwrdm); + do { pwrdm_wait_transition(tesla_pwrdm); + ret = pwrdm_read_pwrst(tesla_pwrdm); + } while ((ret < PWRDM_POWER_INACTIVE) && --timeout); + + if (!timeout) + pr_err("%s: Tesla failed to transition to ON state!\n", + __func__); + + timeout = 10; + clkdm_allow_idle(tesla_clkdm); + + /* Ensure Tesla power state in OFF state */ + ret = pwrdm_read_pwrst(tesla_pwrdm); + do { + pwrdm_wait_transition(tesla_pwrdm); + ret = pwrdm_read_pwrst(tesla_pwrdm); + } while ((ret >= PWRDM_POWER_INACTIVE) && --timeout); + + if (!timeout) + pr_err("%s: Tesla failed to transition to OFF state\n", + __func__); - if (clkdm_sleep(tesla_clkdm)) - pr_err("%s: Failed to force sleep of %s\n", __func__, - tesla_clkdm->name); - } } static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id) |