All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP4: PM: Declare idle modules as functional too
@ 2010-09-24  7:10 Rajendra Nayak
  2010-09-24  7:28 ` Paul Walmsley
  0 siblings, 1 reply; 4+ messages in thread
From: Rajendra Nayak @ 2010-09-24  7:10 UTC (permalink / raw)
  To: linux-omap; +Cc: Rajendra Nayak, Partha Basak, Benoit Cousson, Paul Walmsley

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>
Cc: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/cm4xxx.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/cm4xxx.c b/arch/arm/mach-omap2/cm4xxx.c
index b101091..f8a660a 100644
--- a/arch/arm/mach-omap2/cm4xxx.c
+++ b/arch/arm/mach-omap2/cm4xxx.c
@@ -43,7 +43,6 @@
  *                 using separate functional clock
  *   0x3 disabled: Module is disabled and cannot be accessed
  *
- * TODO: Need to handle module accessible in idle state
  */
 int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
 {
@@ -52,9 +51,11 @@ int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
 	if (!clkctrl_reg)
 		return 0;
 
-	omap_test_timeout(((__raw_readl(clkctrl_reg) &
-			    OMAP4430_IDLEST_MASK) == 0),
-			  MAX_MODULE_READY_TIME, i);
+	omap_test_timeout((
+		((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) == 0) ||
+		 (((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) >>
+		  OMAP4430_IDLEST_SHIFT) == 0x2)),
+		MAX_MODULE_READY_TIME, i);
 
 	return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
 }
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] OMAP4: PM: Declare idle modules as functional too
  2010-09-24  7:10 [PATCH] OMAP4: PM: Declare idle modules as functional too Rajendra Nayak
@ 2010-09-24  7:28 ` Paul Walmsley
  2010-09-24  7:50   ` Cousson, Benoit
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Walmsley @ 2010-09-24  7:28 UTC (permalink / raw)
  To: Rajendra Nayak; +Cc: linux-omap, Partha Basak, Benoit Cousson

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1230 bytes --]

Hi Rajendra, Partha, Benoît,

On Fri, 24 Sep 2010, Rajendra Nayak wrote:

> 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

Thanks for the detailed changelog.  Do we need to check any other 
registers to ensure that the OCP port is in autoidle, or to ensure that 
the separate functional clock is active?


- Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] OMAP4: PM: Declare idle modules as functional too
  2010-09-24  7:28 ` Paul Walmsley
@ 2010-09-24  7:50   ` Cousson, Benoit
  2010-09-24 16:30     ` Paul Walmsley
  0 siblings, 1 reply; 4+ messages in thread
From: Cousson, Benoit @ 2010-09-24  7:50 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Nayak, Rajendra, linux-omap@vger.kernel.org, Basak, Partha

On 9/24/2010 9:28 AM, Paul Walmsley wrote:
> Hi Rajendra, Partha, Benoît,
>
> On Fri, 24 Sep 2010, Rajendra Nayak wrote:
>
>> 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
>
> Thanks for the detailed changelog.  Do we need to check any other
> registers to ensure that the OCP port is in autoidle, or to ensure that
> the separate functional clock is active?

Unfortunately, we do not have any other status than that in OMAP4 for 
the modules clocks activity :-(

Benoit
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] OMAP4: PM: Declare idle modules as functional too
  2010-09-24  7:50   ` Cousson, Benoit
@ 2010-09-24 16:30     ` Paul Walmsley
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Walmsley @ 2010-09-24 16:30 UTC (permalink / raw)
  To: Cousson, Benoit
  Cc: Nayak, Rajendra, linux-omap@vger.kernel.org, Basak, Partha

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1606 bytes --]

On Fri, 24 Sep 2010, Cousson, Benoit wrote:

> On 9/24/2010 9:28 AM, Paul Walmsley wrote:
> > Hi Rajendra, Partha, Benoît,
> > 
> > On Fri, 24 Sep 2010, Rajendra Nayak wrote:
> > 
> > > 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
> > 
> > Thanks for the detailed changelog.  Do we need to check any other
> > registers to ensure that the OCP port is in autoidle, or to ensure that
> > the separate functional clock is active?
> 
> Unfortunately, we do not have any other status than that in OMAP4 for the
> modules clocks activity :-(

OK, thanks Rajendra and Benoît.  Queued for 2.6.37.


- Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-24 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-24  7:10 [PATCH] OMAP4: PM: Declare idle modules as functional too Rajendra Nayak
2010-09-24  7:28 ` Paul Walmsley
2010-09-24  7:50   ` Cousson, Benoit
2010-09-24 16:30     ` Paul Walmsley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.