From: Kevin Hilman <khilman@deeprootsystems.com>
To: Thara Gopinath <thara@ti.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 5/8] OMAP3 PM: Adding conditional core powerdomain context save and restore
Date: Fri, 22 Jan 2010 16:15:07 -0800 [thread overview]
Message-ID: <87zl45zng4.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1264001442-20078-6-git-send-email-thara@ti.com> (Thara Gopinath's message of "Wed\, 20 Jan 2010 21\:00\:39 +0530")
Thara Gopinath <thara@ti.com> writes:
> This patch adds a parameter core_state , depicting the power state
> which the core domain will attempt to enter, to omap3_core_save_context
> and omap3_core_restore_context. This is so as to distinguish between
> the context save and restore required when core domain is attempting
> OSWR and OFF. Core OSWR does not require interrupt controller,
> system control module and dma controller context save and retore
> where as Core OFF reuires these.
>
> Signed-off-by: Thara Gopinath <thara@ti.com>
Looks good, pulling this into PM branch after one minor fixup below...
> ---
> arch/arm/mach-omap2/pm34xx.c | 71 +++++++++++++++++++++++++-----------------
> 1 files changed, 42 insertions(+), 29 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 895e9ef..e4db1ea 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -150,44 +150,57 @@ static void omap3_disable_io_chain(void)
> prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN, WKUP_MOD, PM_WKEN);
> }
>
> -static void omap3_core_save_context(void)
> +static void omap3_core_save_context(int core_state)
> {
> - u32 control_padconf_off;
> + if (core_state == PWRDM_POWER_OFF) {
> + u32 control_padconf_off;
> +
> + /* Save the padconf registers */
> + control_padconf_off = omap_ctrl_readl(
> + OMAP343X_CONTROL_PADCONF_OFF);
> + control_padconf_off |= START_PADCONF_SAVE;
> + omap_ctrl_writel(control_padconf_off,
> + OMAP343X_CONTROL_PADCONF_OFF);
> + /* wait for the save to complete */
> + while (!(omap_ctrl_readl(
> + OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) &
> + PADCONF_SAVE_DONE))
> + udelay(1);
>
> - /* Save the padconf registers */
> - control_padconf_off = omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_OFF);
> - control_padconf_off |= START_PADCONF_SAVE;
> - omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF);
> - /* wait for the save to complete */
> - while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
> - & PADCONF_SAVE_DONE))
> - udelay(1);
> + /*
> + * Force write last pad into memory, as this can fail in some
> + * cases according to erratas 1.157, 1.185
> + */
> + omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
> + OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
>
> - /*
> - * Force write last pad into memory, as this can fail in some
> - * cases according to erratas 1.157, 1.185
> - */
> - omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
> - OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
> + /* Save the Interrupt controller context */
> + omap_intc_save_context();
> +
> + /* Save the system control module context,
> + * padconf already save above
> + */
> + omap3_control_save_context();
> + omap_dma_global_context_save();
> + }
>
> - /* Save the Interrupt controller context */
> - omap_intc_save_context();
> /* Save the GPMC context */
> omap3_gpmc_save_context();
> - /* Save the system control module context, padconf already save above*/
> - omap3_control_save_context();
> - omap_dma_global_context_save();
> }
>
> -static void omap3_core_restore_context(void)
> +static void omap3_core_restore_context(int core_state)
> {
> - /* Restore the control module context, padconf restored by h/w */
> - omap3_control_restore_context();
> + if (core_state == PWRDM_POWER_OFF) {
> + /* Restore the control module context,
> + * padconf restored by h/w
> + */
changing this to proper multi-line comment.
Kevin
> + omap3_control_restore_context();
> + /* Restore the interrupt controller context */
> + omap_intc_restore_context();
> + omap_dma_global_context_restore();
> + }
> /* Restore the GPMC context */
> omap3_gpmc_restore_context();
> - /* Restore the interrupt controller context */
> - omap_intc_restore_context();
> - omap_dma_global_context_restore();
> }
>
> /*
> @@ -445,7 +458,7 @@ void omap_sram_idle(void)
> prm_set_mod_reg_bits(voltctrl,
> OMAP3430_GR_MOD,
> OMAP3_PRM_VOLTCTRL_OFFSET);
> - omap3_core_save_context();
> + omap3_core_save_context(PWRDM_POWER_OFF);
> omap3_prcm_save_context();
> } else if (core_next_state == PWRDM_POWER_RET) {
> prm_set_mod_reg_bits(OMAP3430_AUTO_RET,
> @@ -497,7 +510,7 @@ void omap_sram_idle(void)
> if (core_next_state < PWRDM_POWER_ON) {
> core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm);
> if (core_prev_state == PWRDM_POWER_OFF) {
> - omap3_core_restore_context();
> + omap3_core_restore_context(core_prev_state);
> omap3_prcm_restore_context();
> omap3_sram_restore_context();
> omap2_sms_restore_context();
> --
> 1.5.6.3
>
> --
> 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
next prev parent reply other threads:[~2010-01-23 0:15 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 15:30 [PATCH 0/8] OMAP3: PM: Open Switch Retention support in the cpuidle thread Thara Gopinath
2010-01-20 15:30 ` [PATCH 1/8] PM: Increase the cpu idle max state Thara Gopinath
2010-01-20 15:30 ` [PATCH 2/8] OMAP3 PM: Conditional UART context save restore Thara Gopinath
2010-01-20 15:30 ` [PATCH 3/8] OMAP2/3 PM: Adding powerdomain APIs for reading the next logic and mem state Thara Gopinath
2010-01-20 15:30 ` [PATCH 4/8] OMAP3 PM: Defining .pwrsts_logic_ret field for core power domain structure Thara Gopinath
2010-01-20 15:30 ` [PATCH 5/8] OMAP3 PM: Adding conditional core powerdomain context save and restore Thara Gopinath
2010-01-20 15:30 ` [PATCH 6/8] OMAP3 PM: Enable DPLL4 autoidle after system off Thara Gopinath
2010-01-20 15:30 ` [PATCH 7/8] OMAP3 PM: Support for Open Switch Retention for Core and MPU power domains in cpuidle path Thara Gopinath
2010-01-20 15:30 ` [PATCH 8/8] OMAP3 PM: Support to enable disable OSWR feature from pm debug fs Thara Gopinath
2010-01-23 0:42 ` Kevin Hilman
2010-01-24 4:12 ` Gopinath, Thara
2010-01-25 19:55 ` Kevin Hilman
2010-01-21 5:59 ` [PATCH 7/8] OMAP3 PM: Support for Open Switch Retention for Core and MPU power domains in cpuidle path Paul Walmsley
2010-01-23 0:35 ` Kevin Hilman
2010-01-20 17:34 ` [PATCH 6/8] OMAP3 PM: Enable DPLL4 autoidle after system off Paul Walmsley
2010-01-21 5:33 ` Gopinath, Thara
2010-01-21 5:58 ` Paul Walmsley
2010-01-21 7:01 ` Gopinath, Thara
2010-01-21 7:12 ` Paul Walmsley
2010-01-23 0:15 ` Kevin Hilman [this message]
2010-01-21 6:25 ` [PATCH 4/8] OMAP3 PM: Defining .pwrsts_logic_ret field for core power domain structure Paul Walmsley
2010-01-21 6:12 ` [PATCH 3/8] OMAP2/3 PM: Adding powerdomain APIs for reading the next logic and mem state Paul Walmsley
2010-01-21 7:02 ` Gopinath, Thara
2010-01-22 23:44 ` [PATCH 2/8] OMAP3 PM: Conditional UART context save restore Kevin Hilman
2010-01-21 6:23 ` [PATCH 0/8] OMAP3: PM: Open Switch Retention support in the cpuidle thread Paul Walmsley
2010-01-21 7:08 ` Gopinath, Thara
2010-01-21 7:18 ` Paul Walmsley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zl45zng4.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=thara@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox