From patchwork Thu Dec 3 13:35:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 64522 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 nB3Dd4Ka029070 for ; Thu, 3 Dec 2009 13:39:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756047AbZLCNin (ORCPT ); Thu, 3 Dec 2009 08:38:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756060AbZLCNin (ORCPT ); Thu, 3 Dec 2009 08:38:43 -0500 Received: from smtp.nokia.com ([192.100.105.134]:41229 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754686AbZLCNil (ORCPT ); Thu, 3 Dec 2009 08:38:41 -0500 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 nB3Db1Bx005904; Thu, 3 Dec 2009 07:38:41 -0600 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Dec 2009 15:38:38 +0200 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); Thu, 3 Dec 2009 15:38:37 +0200 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 nB3DcXE7006549; Thu, 3 Dec 2009 15:38:36 +0200 From: Tero Kristo To: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org Subject: [PATCHv2 2/2] OMAP3: Implemented VFP restore/save context Date: Thu, 3 Dec 2009 15:35:53 +0200 Message-Id: <1259847353-22725-3-git-send-email-tero.kristo@nokia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1259847353-22725-2-git-send-email-tero.kristo@nokia.com> References: <> <1259847353-22725-1-git-send-email-tero.kristo@nokia.com> <1259847353-22725-2-git-send-email-tero.kristo@nokia.com> X-OriginalArrivalTime: 03 Dec 2009 13:38:37.0786 (UTC) FILETIME=[EAEE9BA0:01CA741D] 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/pm.h b/arch/arm/mach-omap2/pm.h index e0c94ea..bf9b7f9 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -23,6 +23,7 @@ extern void omap_sram_idle(void); extern int omap3_can_sleep(void); extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); extern int omap3_idle_init(void); +extern void vfp_pm_save_context(void); struct prm_setup_times_vc { u16 clksetup; diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 009bc55..624a7af 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -321,6 +321,13 @@ static void restore_control_register(u32 val) __asm__ __volatile__ ("mcr p15, 0, %0, c1, c0, 0" : : "r" (val)); } +static inline void omap3_save_neon_context(void) +{ +#ifdef CONFIG_VFP + vfp_pm_save_context(); +#endif +} + /* Function to restore the table entry that was modified for enabling MMU */ static void restore_table_entry(void) { @@ -365,6 +372,7 @@ void omap_sram_idle(void) /* save_state = 3 => L1, L2 and logic lost */ int save_state = 0; int mpu_next_state = PWRDM_POWER_ON; + int neon_next_state = PWRDM_POWER_ON; int per_next_state = PWRDM_POWER_ON; int core_next_state = PWRDM_POWER_ON; int core_prev_state, per_prev_state; @@ -398,8 +406,12 @@ void omap_sram_idle(void) pwrdm_pre_transition(); /* NEON control */ - if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON) + if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON) { pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state); + neon_next_state = mpu_next_state; + if (neon_next_state == PWRDM_POWER_OFF) + omap3_save_neon_context(); + } /* PER */ per_next_state = pwrdm_read_next_pwrst(per_pwrdm);