aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/cm4xxx.c
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2010-09-24 12:23:18 -0400
committerPaul Walmsley <paul@pwsan.com>2010-09-24 12:23:18 -0400
commitff173d45525701d65d394cb8687e71845bfb34dc (patch)
tree09dba874d07ce2c4243f0aeb2953f9b318eed00b /arch/arm/mach-omap2/cm4xxx.c
parentf39f4898ac72fec92066f15aef0e7485013482ea (diff)
OMAP4: PM: Declare idle modules as functional too
The omap4_cm_wait_module_ready function would only check for the modules to be completely functional before declaring them ready to be accessed. There might also be instances where in the module is actually in idle (under h/w control) but should still be declared accessible, as the h/w control would make it functional when needed. Hence make omap4_cm_wait_module_ready return true in case the module is fully functional *or* in idle state. Fail only if the module is fully disabled or stuck intransition. The explaination from the TRM for the idlest bits on OMAP4 is as below for quick reference Module idle state: 0x0 func: Module is fully functional, including OCP 0x1 trans: Module is performing transition: wakeup, or sleep, or sleep abortion 0x2 idle: Module is in Idle mode (only OCP part). It is functional if using separate functional clock 0x3 disabled: Module is disabled and cannot be accessed Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Partha Basak <p-basak2@ti.com> Signed-off-by: Benoit Cousson <b-cousson@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/cm4xxx.c')
-rw-r--r--arch/arm/mach-omap2/cm4xxx.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/cm4xxx.c b/arch/arm/mach-omap2/cm4xxx.c
index b101091e95d6..f8a660a1a4a6 100644
--- a/arch/arm/mach-omap2/cm4xxx.c
+++ b/arch/arm/mach-omap2/cm4xxx.c
@@ -43,7 +43,6 @@
43 * using separate functional clock 43 * using separate functional clock
44 * 0x3 disabled: Module is disabled and cannot be accessed 44 * 0x3 disabled: Module is disabled and cannot be accessed
45 * 45 *
46 * TODO: Need to handle module accessible in idle state
47 */ 46 */
48int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg) 47int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
49{ 48{
@@ -52,9 +51,11 @@ int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
52 if (!clkctrl_reg) 51 if (!clkctrl_reg)
53 return 0; 52 return 0;
54 53
55 omap_test_timeout(((__raw_readl(clkctrl_reg) & 54 omap_test_timeout((
56 OMAP4430_IDLEST_MASK) == 0), 55 ((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) == 0) ||
57 MAX_MODULE_READY_TIME, i); 56 (((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) >>
57 OMAP4430_IDLEST_SHIFT) == 0x2)),
58 MAX_MODULE_READY_TIME, i);
58 59
59 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY; 60 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
60} 61}