diff options
author | Mohan V <mohanv@ti.com> | 2012-06-22 10:40:02 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2012-06-22 10:40:02 -0400 |
commit | fe7ea0062f2f846bb68447c7b813b9230285dbeb (patch) | |
tree | b32c0698f2ea3a4d55c986638ab34d3205baefea /arch/arm/mach-omap2/pm34xx.c | |
parent | 75a4433e409b2d22cbe443b623d92047b59cbb9a (diff) |
ARM: OMAP3: PM: correct enable/disable of daisy io chain
Currently the enabling and disabling of IO Daisy chain is not
according to the TRM. The below steps are followed to enable/
disable the IO chain, based loosely on the "Sec 3.5.7.2.2
I/O Wake-Up Mechanism" section in OMAP3630 Public TRM[1].
Steps to enable IO chain:
[a] Set PM_WKEN_WKUP.EN_IO bit
[b] Set the PM_WKEN_WKUP.EN_IO_CHAIN bit
[c] Poll for PM_WKST_WKUP.ST_IO_CHAIN.
[d] When ST_IO_CHAIN bit set to 1, clear PM_WKEN_WKUP.EN_IO_CHAIN
[e] Clear ST_IO_CHAIN bit.
Steps to disable IO chain:
[a] Clear PM_WKEN_WKUP.EN_IO_CHAIN bit
[b] Clear PM_WKEN_WKUP.EN_IO bit
[c] Clear PM_WKST_WKUP.ST_IO bit by writing 1 to it.
Step [e] & [c] in each case can be skipped, as these are handled
by the PRCM interrupt handler later.
[1] http://focus.ti.com/pdfs/wtbu/OMAP36xx_ES1.x_PUBLIC_TRM_vV.zip
Signed-off-by: Mohan V <mohanv@ti.com>
Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
[paul@pwsan.com: modified commit message to clarify that these steps are
based loosely on the TRM section, rather than documented exactly]
Reviewed-by: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: resolved new warnings from checkpatch]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index a34023d0ca7c..6d7f0d8a3103 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -81,16 +81,17 @@ static void omap3_enable_io_chain(void) | |||
81 | /* Do a readback to assure write has been done */ | 81 | /* Do a readback to assure write has been done */ |
82 | omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN); | 82 | omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN); |
83 | 83 | ||
84 | while (!(omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN) & | 84 | while (!(omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST) & |
85 | OMAP3430_ST_IO_CHAIN_MASK)) { | 85 | OMAP3430_ST_IO_CHAIN_MASK)) { |
86 | timeout++; | 86 | timeout++; |
87 | if (timeout > 1000) { | 87 | if (timeout > 1000) { |
88 | pr_err("Wake up daisy chain activation failed.\n"); | 88 | pr_err("Wake up daisy chain activation failed.\n"); |
89 | return; | 89 | return; |
90 | } | 90 | } |
91 | omap2_prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK, | ||
92 | WKUP_MOD, PM_WKEN); | ||
93 | } | 91 | } |
92 | omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD, | ||
93 | PM_WKEN); | ||
94 | |||
94 | } | 95 | } |
95 | 96 | ||
96 | static void omap3_disable_io_chain(void) | 97 | static void omap3_disable_io_chain(void) |