aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGirish S Ghongdemath <girishsg@ti.com>2011-12-03 22:30:26 -0600
committerArve Hjønnevåg <arve@android.com>2011-12-14 18:36:10 -0800
commit7ee11a3df703bae7db9e85796aa266f82f2e5c51 (patch)
tree2ececfc70751684f2d7e99d40e575d9cacdf3248
parent5a44bf340a2f8967a30da5035dfee9ae452a585a (diff)
downloadkernel_samsung_espresso10-7ee11a3df703bae7db9e85796aa266f82f2e5c51.tar.gz
kernel_samsung_espresso10-7ee11a3df703bae7db9e85796aa266f82f2e5c51.tar.bz2
kernel_samsung_espresso10-7ee11a3df703bae7db9e85796aa266f82f2e5c51.zip
OMAP4: PM: omap4_trigger_ioctrl: use proper mask for proper delay
PRM_IO_PMCTRL register has more fields beyond WUCLK_STATUS. Shifting the bits does not guarantee that the resultant value represents the WUCLK_STATUS (a single bit). Instead, mask the same to be sure about picking up just the register field we need. Without this, we may not manage to get the test to pass and it times out after 1+ms in every attempt. This wrongly forces the prcm_interrupt_handler to be delayed by 1ms when IOPAD wakeup is triggered. This causes the IO daisy chain blind window to be abnormally long, instead of a few us. Measurements show that time between rising and falling edge of WUCLIN is: * without fix: 1600us * with fix: 1.2us Also the latch is really complete when the WUCLKIN pulse goes low, so we need to wait until WUCLK_STATUS goes low. Change-Id: Ib0a052968796181b4b252afc13bca8f12cdd940b [d-elaidi@ti.com: parallel fix] Signed-off-by: Djamil Elaidi <d-elaidi@ti.com> Signed-off-by: Girish S Ghongdemath <girishsg@ti.com>
-rw-r--r--arch/arm/mach-omap2/pm44xx.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 75b6223ad9e..1ddc41e1b15 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -115,13 +115,30 @@ void omap4_trigger_ioctrl(void)
/* Trigger WUCLKIN enable */
omap4_prminst_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, OMAP4430_WUCLK_CTRL_MASK,
OMAP4430_PRM_PARTITION, OMAP4430_PRM_DEVICE_INST, OMAP4_PRM_IO_PMCTRL_OFFSET);
- omap_test_timeout(
- ((omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, OMAP4430_PRM_DEVICE_INST, OMAP4_PRM_IO_PMCTRL_OFFSET)
- >> OMAP4430_WUCLK_STATUS_SHIFT) == 1),
- MAX_IOPAD_LATCH_TIME, i);
+ omap_test_timeout((((omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
+ OMAP4430_PRM_DEVICE_INST,
+ OMAP4_PRM_IO_PMCTRL_OFFSET) &
+ OMAP4430_WUCLK_STATUS_MASK) >>
+ OMAP4430_WUCLK_STATUS_SHIFT) == 1),
+ MAX_IOPAD_LATCH_TIME, i);
+ if (i == MAX_IOPAD_LATCH_TIME)
+ pr_err("%s: Max IO latch time reached for WUCLKIN enable\n",
+ __func__);
+
/* Trigger WUCLKIN disable */
omap4_prminst_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0,
OMAP4430_PRM_PARTITION, OMAP4430_PRM_DEVICE_INST, OMAP4_PRM_IO_PMCTRL_OFFSET);
+
+ /* Ensure this is cleared */
+ omap_test_timeout((((omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
+ OMAP4430_PRM_DEVICE_INST,
+ OMAP4_PRM_IO_PMCTRL_OFFSET) &
+ OMAP4430_WUCLK_STATUS_MASK) >>
+ OMAP4430_WUCLK_STATUS_SHIFT) == 0),
+ MAX_IOPAD_LATCH_TIME, i);
+ if (i == MAX_IOPAD_LATCH_TIME)
+ pr_err("%s: Max IO latch time reached for WUCLKIN disable\n",
+ __func__);
return;
}