ARM: OMAP4: CLKDM: Update supported transition modes
PATCH 5/6 ARM: OMAP4: CLKDM: Update supported transition modes
From: Jon Hunter <[email protected]>
For OMAP3+ devices, the clock domains (CLKDMs) support one or more of the following transition modes ...
NO_SLEEP (0x0) - A clock domain sleep transition is never initiated,
irrespective of the hardware conditions.SW_SLEEP (0x1) - A software-forced sleep transition. The transition is initiated
when the associated hardware conditions are satisfiedSW_WKUP (0x2) - A software-forced clock domain wake-up transition is initiated,
irrespective of the hardware conditions.HW_AUTO (0x3) - Hardware-controlled automatic sleep and wake-up transition is
initiated by the PRCM module when the associated hardware conditions are satisfied.
For OMAP4 devices, SW_SLEEP is equivalent to HW_AUTO and NO_SLEEP is equivalent to SW_WKUP. For OMAP4 devices, all CLKDMs support HW_AUTO and therefore we can place the CLKDMs in the HW_AUTO state instead of the SW_SLEEP mode. Hence, we do not need to use the SW_SLEEP mode. With regard to NO_SLEEP and SW_WKUP it is preferred to use SW_WKUP mode if the CLKDM supports it and so use this mode instead of NO_SLEEP where possible.
For a software perspective the above 4 modes are represented by the following flags to indicate what modes are supported by each of the CLKDMs.
CLKDM_CAN_DISABLE_AUTO --> NO_SLEEPCLKDM_CAN_ENABLE_AUTO --> HW_AUTOCLKDM_CAN_FORCE_SLEEP --> SW_SLEEPCLKDM_CAN_FORCE_WAKEUP --> SW_WKUP
By eliminating the SW_SLEEP mode the the mapping of the flags for OMAP4 devices can becomes ...
CLKDM_CAN_DISABLE_AUTO --> NO_SLEEPCLKDM_CAN_ENABLE_AUTO --> HW_AUTOCLKDM_CAN_FORCE_SLEEP --> HW_AUTOCLKDM_CAN_FORCE_WAKEUP --> SW_WKUP
--- arch/arm/mach-omap2/clockdomain44xx.c | 7 +++++-- arch/arm/mach-omap2/cminst44xx.c | 14 -------------- 2 files changed, 5 insertions(+), 16 deletions(-)
arch/arm/mach-omap2/clockdomain44xx.c +5 -2
@@ -70,7 +70,7 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)static int omap4_clkdm_sleep (struct clockdomain *clkdm) { -omap4_cminst_clkdm_force_sleep (clkdm->prcm_partition, +omap4_cminst_clkdm_enable_hwsup (clkdm->prcm_partition, clkdm->cm_inst, clkdm->clkdm_offs);return 0 ; }
@@ -90,7 +90,10 @@ static void omap4_clkdm_allow_idle(struct clockdomain *clkdm)static void omap4_clkdm_deny_idle (struct clockdomain *clkdm) { -omap4_cminst_clkdm_disable_hwsup (clkdm->prcm_partition, +if (clkdm->flags &CLKDM_CAN_FORCE_WAKEUP ) +omap4_clkdm_wakeup (clkdm); +else +omap4_cminst_clkdm_disable_hwsup (clkdm->prcm_partition, clkdm->cm_inst, clkdm->clkdm_offs); }
arch/arm/mach-omap2/cminst44xx.c +0 -14
@@ -227,20 +227,6 @@ void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs) }/** -* omap4_cminst_clkdm_force_sleep - try to put a clockdomain into idle -* @part: PRCM partition ID that the clockdomain registers exist in -* @inst: CM instance register offset (*_INST macro) -* @cdoffs: Clockdomain register offset (*_CDOFFS macro) -* -* Put a clockdomain referred to by (@part, @inst, @cdoffs) into idle -* No return value. -*/ -void omap4_cminst_clkdm_force_sleep (u8 part,s16 inst,u16 cdoffs) -{ -_clktrctrl_write (OMAP34XX_CLKSTCTRL_FORCE_SLEEP , part, inst, cdoffs); -} - -/** * omap4_cminst_clkdm_force_sleep - try to take a clockdomain out of idle * @part: PRCM partition ID that the clockdomain registers exist in * @inst: CM instance register offset (*_INST macro)
Signature · 1 line
1.7.5.4
Quoted 30 lines · Jon Hunter
From: Jon Hunter <[email protected]>
For OMAP3+ devices, the clock domains (CLKDMs) support one or more of the following transition modes ...
NO_SLEEP(0x0) - A clock domain sleep transition is never initiated,
irrespective of the hardware conditions.SW_SLEEP(0x1) - A software-forced sleep transition. The transition is initiated
when the associated hardware conditions are satisfiedSW_WKUP(0x2) - A software-forced clock domain wake-up transition is initiated,
irrespective of the hardware conditions.HW_AUTO(0x3) - Hardware-controlled automatic sleep and wake-up transition is
initiated by the PRCM module when the associated hardware conditions are satisfied.For OMAP4 devices,
SW_SLEEPis equivalent toHW_AUTOandNO_SLEEPis equivalent toSW_WKUP. For OMAP4 devices, all CLKDMs supportHW_AUTOand therefore we can place the CLKDMs in theHW_AUTOstate instead of theSW_SLEEPmode. Hence, we do not need to use theSW_SLEEPmode. With regard toNO_SLEEPandSW_WKUPit is preferred to useSW_WKUPmode if the CLKDM supports it and so use this mode instead ofNO_SLEEPwhere possible.For a software perspective the above 4 modes are represented by the following flags to indicate what modes are supported by each of the CLKDMs.
CLKDM_CAN_DISABLE_AUTO-->NO_SLEEPCLKDM_CAN_ENABLE_AUTO-->HW_AUTOCLKDM_CAN_FORCE_SLEEP-->SW_SLEEPCLKDM_CAN_FORCE_WAKEUP-->SW_WKUP
Quoted 6 lines
By eliminating the
SW_SLEEPmode the the mapping of the flags for OMAP4 devices can becomes ...
CLKDM_CAN_DISABLE_AUTO-->NO_SLEEPCLKDM_CAN_ENABLE_AUTO-->HW_AUTOCLKDM_CAN_FORCE_SLEEP-->HW_AUTO
Not sure if this can be entirely correct for OMAP4. Because HW_AUTO = "Sleep and wakeup transition are based upon hardware conditions"
Where as SW_SLEEP = "Start a software forced sleep transition on the domain."
I will reply on the the thread where this is being discussed.
Quoted 19 lines
CLKDM_CAN_FORCE_WAKEUP-->SW_WKUPCc Ming Lei <[email protected]>Cc Will Deacon <[email protected]>Cc Benoit Cousson <[email protected]>Cc Paul Walmsley <[email protected]>Cc Kevin Hilman <[email protected]>Signed-off-by Jon Hunter <[email protected]>--- arch/arm/mach-omap2/clockdomain44xx.c | 7 +++++-- arch/arm/mach-omap2/cminst44xx.c | 14 -------------- 2 files changed, 5 insertions(+), 16 deletions(-)arch/arm/mach-omap2/clockdomain44xx.c +0
-0
arch/arm/mach-omap2/clockdomain44xx.c static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm) · line 74
Quoted 6 lines
arch/arm/mach-omap2/clockdomain44xx.c +1
-1@@ -70,7 +70,7 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)static int omap4_clkdm_sleep (struct clockdomain *clkdm) { -omap4_cminst_clkdm_force_sleep (clkdm->prcm_partition, +omap4_cminst_clkdm_enable_hwsup (clkdm->prcm_partition, clkdm->cm_inst, clkdm->clkdm_offs);
In case SW_SLEEP != HW_AUTO, something like below can be done
if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP )
omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition, clkdm->cm_inst, clkdm->clkdm_offs); else omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, clkdm->cm_inst, clkdm->clkdm_offs);
Quoted 39 lines
arch/arm/mach-omap2/clockdomain44xx.c +4
-1return 0 ; }@@ -90,7 +90,10 @@ static void omap4_clkdm_allow_idle(struct clockdomain *clkdm)static void omap4_clkdm_deny_idle (struct clockdomain *clkdm) { -omap4_cminst_clkdm_disable_hwsup (clkdm->prcm_partition, +if (clkdm->flags &CLKDM_CAN_FORCE_WAKEUP ) +omap4_clkdm_wakeup (clkdm); +else +omap4_cminst_clkdm_disable_hwsup (clkdm->prcm_partition, clkdm->cm_inst, clkdm->clkdm_offs); }arch/arm/mach-omap2/cminst44xx.c +0
-14@@ -227,20 +227,6 @@ void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs) }/** -* omap4_cminst_clkdm_force_sleep - try to put a clockdomain into idle -* @part: PRCM partition ID that the clockdomain registers exist in -* @inst: CM instance register offset (*_INST macro) -* @cdoffs: Clockdomain register offset (*_CDOFFS macro) -* -* Put a clockdomain referred to by (@part, @inst, @cdoffs) into idle -* No return value. -*/ -void omap4_cminst_clkdm_force_sleep (u8 part,s16 inst,u16 cdoffs) -{ -_clktrctrl_write (OMAP34XX_CLKSTCTRL_FORCE_SLEEP , part, inst, cdoffs); -} - -/** * omap4_cminst_clkdm_force_sleep - try to take a clockdomain out of idle * @part: PRCM partition ID that the clockdomain registers exist in * @inst: CM instance register offset (*_INST macro)
Hi Santosh, Benoit,
Quoted 37 lines · Santosh Shilimkar
Quoted 30 lines · Jon Hunter
From: Jon Hunter <[email protected]>
For OMAP3+ devices, the clock domains (CLKDMs) support one or more of the following transition modes ...
NO_SLEEP(0x0) - A clock domain sleep transition is never initiated,
irrespective of the hardware conditions.SW_SLEEP(0x1) - A software-forced sleep transition. The transition is initiated
when the associated hardware conditions are satisfiedSW_WKUP(0x2) - A software-forced clock domain wake-up transition is initiated,
irrespective of the hardware conditions.HW_AUTO(0x3) - Hardware-controlled automatic sleep and wake-up transition is
initiated by the PRCM module when the associated hardware conditions are satisfied.For OMAP4 devices,
SW_SLEEPis equivalent toHW_AUTOandNO_SLEEPis equivalent toSW_WKUP. For OMAP4 devices, all CLKDMs supportHW_AUTOand therefore we can place the CLKDMs in theHW_AUTOstate instead of theSW_SLEEPmode. Hence, we do not need to use theSW_SLEEPmode. With regard toNO_SLEEPandSW_WKUPit is preferred to useSW_WKUPmode if the CLKDM supports it and so use this mode instead ofNO_SLEEPwhere possible.For a software perspective the above 4 modes are represented by the following flags to indicate what modes are supported by each of the CLKDMs.
CLKDM_CAN_DISABLE_AUTO-->NO_SLEEPCLKDM_CAN_ENABLE_AUTO-->HW_AUTOCLKDM_CAN_FORCE_SLEEP-->SW_SLEEPCLKDM_CAN_FORCE_WAKEUP-->SW_WKUPQuoted 6 lines
By eliminating the
SW_SLEEPmode the the mapping of the flags for OMAP4 devices can becomes ...
CLKDM_CAN_DISABLE_AUTO-->NO_SLEEPCLKDM_CAN_ENABLE_AUTO-->HW_AUTOCLKDM_CAN_FORCE_SLEEP-->HW_AUTO
Quoted 7 lines
Not sure if this can be entirely correct for OMAP4. Because
HW_AUTO= "Sleep and wakeup transition are based upon hardware conditions"
Where asSW_SLEEP= "Start a software forced sleep transition on the domain."I will reply on the the thread where this is being discussed.
Given that feedback we received that the only difference between HW_AUTO and SW_SLEEP is "that the PRM_IRQSTATUS_MPU.TRANSITION_ST interrupt status is set in case of SW_SLEEP transition, and not set in case of HW_AUTO transition". Are you ok with this change? If so can you sign-off on this?
I can update the series with all the comments and re-post this week.
Cheers
Jon
Cousson, Benoit
Reviewed-byHi Jon,
Quoted 46 lines · Jon Hunter
Hi Santosh, Benoit,
Quoted 43 lines · Santosh Shilimkar
Quoted 30 lines · Jon Hunter
From: Jon Hunter<[email protected]>
For OMAP3+ devices, the clock domains (CLKDMs) support one or more of the following transition modes ...
NO_SLEEP(0x0) - A clock domain sleep transition is never initiated,
irrespective of the hardware conditions.SW_SLEEP(0x1) - A software-forced sleep transition. The transition is initiated
when the associated hardware conditions are satisfiedSW_WKUP(0x2) - A software-forced clock domain wake-up transition is initiated,
irrespective of the hardware conditions.HW_AUTO(0x3) - Hardware-controlled automatic sleep and wake-up transition is
initiated by the PRCM module when the associated hardware conditions are satisfied.For OMAP4 devices,
SW_SLEEPis equivalent toHW_AUTOandNO_SLEEPis equivalent toSW_WKUP. For OMAP4 devices, all CLKDMs supportHW_AUTOand therefore we can place the CLKDMs in theHW_AUTOstate instead of theSW_SLEEPmode. Hence, we do not need to use theSW_SLEEPmode. With regard toNO_SLEEPandSW_WKUPit is preferred to useSW_WKUPmode if the CLKDM supports it and so use this mode instead ofNO_SLEEPwhere possible.For a software perspective the above 4 modes are represented by the following flags to indicate what modes are supported by each of the CLKDMs.
CLKDM_CAN_DISABLE_AUTO-->NO_SLEEPCLKDM_CAN_ENABLE_AUTO-->HW_AUTOCLKDM_CAN_FORCE_SLEEP-->SW_SLEEPCLKDM_CAN_FORCE_WAKEUP-->SW_WKUPQuoted 6 lines
By eliminating the
SW_SLEEPmode the the mapping of the flags for OMAP4 devices can becomes ...
CLKDM_CAN_DISABLE_AUTO-->NO_SLEEPCLKDM_CAN_ENABLE_AUTO-->HW_AUTOCLKDM_CAN_FORCE_SLEEP-->HW_AUTONot sure if this can be entirely correct for OMAP4. Because
HW_AUTO= "Sleep and wakeup transition are based upon hardware conditions"
Where asSW_SLEEP= "Start a software forced sleep transition on the domain."
Quoted 7 lines
Quoted 1 line
I will reply on the the thread where this is being discussed.
Given that feedback we received that the only difference between
HW_AUTOandSW_SLEEPis "that the PRM_IRQSTATUS_MPU.TRANSITION_ST interrupt status is set in case ofSW_SLEEPtransition, and not set in case ofHW_AUTOtransition". Are you ok with this change? If so can you sign-off on this?
Yep I'm OK with that, but Paul is the only one who can sign-off this patch.
Regards,
Benoit
Shilimkar, Santosh
Reviewed-byQuoted 76 lines · Benoit
Hi Jon,
Quoted 62 lines · Jon Hunter
Hi Santosh, Benoit,
Quoted 58 lines · Santosh Shilimkar
Quoted 42 lines · Jon Hunter
From: Jon Hunter<[email protected]>
For OMAP3+ devices, the clock domains (CLKDMs) support one or more of the
following transition modes ...
NO_SLEEP(0x0) - A clock domain sleep transition is never initiated, irrespective of the hardware conditions.SW_SLEEP(0x1) - A software-forced sleep transition. The transition is initiated
when the associated hardware conditions are satisfiedSW_WKUP(0x2) - A software-forced clock domain wake-up transition is initiated,
irrespective of the hardware conditions.HW_AUTO(0x3) - Hardware-controlled automatic sleep and wake-up transition is
initiated by the PRCM module when the associated hardware
conditions are satisfied.For OMAP4 devices,
SW_SLEEPis equivalent toHW_AUTOandNO_SLEEPis equivalent
toSW_WKUP. For OMAP4 devices, all CLKDMs supportHW_AUTOand therefore we can
place the CLKDMs in theHW_AUTOstate instead of theSW_SLEEPmode. Hence, we
do not need to use theSW_SLEEPmode. With regard toNO_SLEEPandSW_WKUPit is
preferred to useSW_WKUPmode if the CLKDM supports it and so use this mode
instead ofNO_SLEEPwhere possible.For a software perspective the above 4 modes are represented by the following
flags to indicate what modes are supported by each of the CLKDMs.
CLKDM_CAN_DISABLE_AUTO--> NO_SLEEPCLKDM_CAN_ENABLE_AUTO--> HW_AUTOCLKDM_CAN_FORCE_SLEEP--> SW_SLEEPCLKDM_CAN_FORCE_WAKEUP--> SW_WKUPQuoted 7 lines
By eliminating the
SW_SLEEPmode the the mapping of the flags for OMAP4 devices
can becomes ...
CLKDM_CAN_DISABLE_AUTO--> NO_SLEEPCLKDM_CAN_ENABLE_AUTO--> HW_AUTOCLKDM_CAN_FORCE_SLEEP--> HW_AUTONot sure if this can be entirely correct for OMAP4. Because
HW_AUTO= "Sleep and wakeup transition are based upon hardware conditions"
Where asSW_SLEEP= "Start a software forced sleep transition on the domain."Quoted 8 lines
Quoted 1 line
I will reply on the the thread where this is being discussed.
Given that feedback we received that the only difference between
HW_AUTOandSW_SLEEPis "that the PRM_IRQSTATUS_MPU.TRANSITION_ST interrupt status is set in case ofSW_SLEEPtransition, and not set in case ofHW_AUTOtransition". Are you ok with this change? If so can you sign-off on this?
Quoted 4 lines
Yep I'm OK with that, but Paul is the only one who can sign-off this patch.
Reviewed-by Benoit Cousson <[email protected]>
Am OK as well.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html