From patchwork Thu Nov 19 17:06:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 61372 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 nAJFCpdn015581 for ; Thu, 19 Nov 2009 15:12:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754080AbZKSPMn (ORCPT ); Thu, 19 Nov 2009 10:12:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754015AbZKSPMn (ORCPT ); Thu, 19 Nov 2009 10:12:43 -0500 Received: from smtp.nokia.com ([192.100.105.134]:46286 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753817AbZKSPMm (ORCPT ); Thu, 19 Nov 2009 10:12:42 -0500 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nAJFCajX008194 for ; Thu, 19 Nov 2009 09:12:48 -0600 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 19 Nov 2009 17:12:45 +0200 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 19 Nov 2009 17:12:44 +0200 Received: from localhost.localdomain (sokoban.ntc.nokia.com [172.22.144.95]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nAJFCd3R010273 for ; Thu, 19 Nov 2009 17:12:42 +0200 From: Tero Kristo To: linux-omap@vger.kernel.org Subject: [PATCH 2/2] OMAP3: Implemented VFP restore/save context Date: Thu, 19 Nov 2009 19:06:15 +0200 Message-Id: <1258650375-9793-3-git-send-email-tero.kristo@nokia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1258650375-9793-2-git-send-email-tero.kristo@nokia.com> References: <> <1258650375-9793-1-git-send-email-tero.kristo@nokia.com> <1258650375-9793-2-git-send-email-tero.kristo@nokia.com> X-OriginalArrivalTime: 19 Nov 2009 15:12:45.0167 (UTC) FILETIME=[BF400FF0:01CA692A] 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 4f22107..dd5bbaf 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -18,6 +18,7 @@ extern u32 sleep_while_idle; extern u32 voltage_off_while_idle; extern void *omap3_secure_ram_storage; +extern void vfp_pm_save_context(void); extern void omap3_pm_off_mode_enable(int); extern void omap_sram_idle(void); extern int omap3_can_sleep(void); diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index b26ae5b..4b01303 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -321,6 +321,18 @@ 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 +} + +static inline void omap3_restore_neon_context(void) +{ + return; +} + /* Function to restore the table entry that was modified for enabling MMU */ static void restore_table_entry(void) { @@ -365,6 +377,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 +411,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); @@ -537,6 +554,8 @@ void omap_sram_idle(void) omap3_disable_io_chain(); } + if (neon_next_state == PWRDM_POWER_OFF) + omap3_restore_neon_context(); pwrdm_post_transition(); }