From patchwork Fri Oct 16 10:49:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 54232 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9GB8hRg026877 for ; Fri, 16 Oct 2009 11:08:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758617AbZJPLEy (ORCPT ); Fri, 16 Oct 2009 07:04:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758611AbZJPLEy (ORCPT ); Fri, 16 Oct 2009 07:04:54 -0400 Received: from smtp.nokia.com ([192.100.105.134]:19665 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758584AbZJPLEx (ORCPT ); Fri, 16 Oct 2009 07:04:53 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9GB3L2L010020 for ; Fri, 16 Oct 2009 06:03:26 -0500 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Oct 2009 14:03:25 +0300 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Oct 2009 14:03:02 +0300 Received: from localhost.localdomain (sokoban.ntc.nokia.com [172.22.144.95]) by mgw-sa02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9GB2faA022261 for ; Fri, 16 Oct 2009 14:03:01 +0300 From: Tero Kristo To: linux-omap@vger.kernel.org Subject: [PATCH 16/17] OMAP3: PM: Write voltage and clock setup times dynamically in idle loop Date: Fri, 16 Oct 2009 13:49:09 +0300 Message-Id: <1255690150-16853-17-git-send-email-tero.kristo@nokia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1255690150-16853-16-git-send-email-tero.kristo@nokia.com> References: <> <1255690150-16853-1-git-send-email-tero.kristo@nokia.com> <1255690150-16853-2-git-send-email-tero.kristo@nokia.com> <1255690150-16853-3-git-send-email-tero.kristo@nokia.com> <1255690150-16853-4-git-send-email-tero.kristo@nokia.com> <1255690150-16853-5-git-send-email-tero.kristo@nokia.com> <1255690150-16853-6-git-send-email-tero.kristo@nokia.com> <1255690150-16853-7-git-send-email-tero.kristo@nokia.com> <1255690150-16853-8-git-send-email-tero.kristo@nokia.com> <1255690150-16853-9-git-send-email-tero.kristo@nokia.com> <1255690150-16853-10-git-send-email-tero.kristo@nokia.com> <1255690150-16853-11-git-send-email-tero.kristo@nokia.com> <1255690150-16853-12-git-send-email-tero.kristo@nokia.com> <1255690150-16853-13-git-send-email-tero.kristo@nokia.com> <1255690150-16853-14-git-send-email-tero.kristo@nokia.com> <1255690150-16853-15-git-send-email-tero.kristo@nokia.com> <1255690150-16853-16-git-send-email-tero.kristo@nokia.com> X-OriginalArrivalTime: 16 Oct 2009 11:03:02.0567 (UTC) FILETIME=[3AE13B70:01CA4E50] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index f492142..ae83121 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -575,6 +575,30 @@ void omap_sram_idle(void) if (regset_save_on_suspend) pm_dbg_regset_save(1); + /* Write voltage setup times which are changed dynamically */ + if (core_next_state == PWRDM_POWER_OFF) { + prm_write_mod_reg(0, OMAP3430_GR_MOD, + OMAP3_PRM_VOLTSETUP1_OFFSET); + prm_write_mod_reg(prm_setup.voltsetup2, OMAP3430_GR_MOD, + OMAP3_PRM_VOLTSETUP2_OFFSET); + prm_write_mod_reg(prm_setup.clksetup, OMAP3430_GR_MOD, + OMAP3_PRM_CLKSETUP_OFFSET); + } else { + prm_write_mod_reg((prm_setup.voltsetup_time2 << + OMAP3430_SETUP_TIME2_SHIFT) | + (prm_setup.voltsetup_time1 << + OMAP3430_SETUP_TIME1_SHIFT), + OMAP3430_GR_MOD, OMAP3_PRM_VOLTSETUP1_OFFSET); + prm_write_mod_reg(0, OMAP3430_GR_MOD, + OMAP3_PRM_VOLTSETUP2_OFFSET); + /* + * Use static 1 as only HF_CLKOUT is turned off. + * Value taken from application note SWPA152 + */ + prm_write_mod_reg(0x1, OMAP3430_GR_MOD, + OMAP3_PRM_CLKSETUP_OFFSET); + } + /* * omap3_arm_context is the location where ARM registers * get saved. The restore path then reads from this @@ -1379,19 +1403,9 @@ static void __init configure_vc(void) OMAP3430_GR_MOD, OMAP3_PRM_VC_I2C_CFG_OFFSET); - /* Write setup times */ - prm_write_mod_reg(prm_setup.clksetup, OMAP3430_GR_MOD, - OMAP3_PRM_CLKSETUP_OFFSET); - prm_write_mod_reg((prm_setup.voltsetup_time2 << - OMAP3430_SETUP_TIME2_SHIFT) | - (prm_setup.voltsetup_time1 << - OMAP3430_SETUP_TIME1_SHIFT), - OMAP3430_GR_MOD, OMAP3_PRM_VOLTSETUP1_OFFSET); - + /* Write static setup times */ prm_write_mod_reg(prm_setup.voltoffset, OMAP3430_GR_MOD, OMAP3_PRM_VOLTOFFSET_OFFSET); - prm_write_mod_reg(prm_setup.voltsetup2, OMAP3430_GR_MOD, - OMAP3_PRM_VOLTSETUP2_OFFSET); pm_dbg_regset_init(1); pm_dbg_regset_init(2);