From patchwork Fri Nov 19 01:54:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 338071 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAJ1tCVh025169 for ; Fri, 19 Nov 2010 01:55:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760288Ab0KSBzN (ORCPT ); Thu, 18 Nov 2010 20:55:13 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:55460 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760192Ab0KSBzD (ORCPT ); Thu, 18 Nov 2010 20:55:03 -0500 Received: from dlep35.itg.ti.com ([157.170.170.118]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id oAJ1t1uc030794 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Nov 2010 19:55:02 -0600 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id oAJ1t1rs003833; Thu, 18 Nov 2010 19:55:01 -0600 (CST) Received: from senorita (senorita.am.dhcp.ti.com [128.247.74.250]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id oAJ1t0f12119; Thu, 18 Nov 2010 19:55:00 -0600 (CST) Received: by senorita (Postfix, from userid 1000) id 595DBC2B4; Thu, 18 Nov 2010 19:54:58 -0600 (CST) From: Nishanth Menon To: linux-omap Cc: Kevin , Jean Pihet , Vishwanath Sripathy , Tony Subject: [PATCH 05/13] OMAP3: PM: optional save secure RAM context every core off cycle Date: Thu, 18 Nov 2010 19:54:50 -0600 Message-Id: <1290131698-6194-6-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1290131698-6194-1-git-send-email-nm@ti.com> References: <1290131698-6194-1-git-send-email-nm@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 19 Nov 2010 01:55:36 +0000 (UTC) diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index c0af788..39934ec 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -90,6 +90,18 @@ extern unsigned int omap34xx_cpu_suspend_sz; * @size: size of copy to be saved - this is based on the PPA used * secure ram size could be configured to various sizes, this is * the size used + 64 byte header required. + * @save_every_cycle: While going to OFF mode and coming out of it on HS/EMU + * devices, secure service is provided to enable saving the + * contexts of secure ram and secure status of various drivers + * using secure devices. However, there are many kinds of secure + * conditions in the wild: + * 1. Implements its own save and restore using pm hooks + * 2. Generic drivers which depend on OMAP PM code to handle the + * same correspondingly, PPA may or may not allow capability + * to save in every transition to OFF mode. + * 3. PPA may be buggy and does'nt allow multiple saves + * Support of this depends heavily on the PPA used and the security + * driver capability. If in doubt, contact the security team. * * Different platforms use different security PPAs based on their unique needs. * This structure describes the delta behavior expected for these custom @@ -97,6 +109,7 @@ extern unsigned int omap34xx_cpu_suspend_sz; */ struct omap3_secure_copy_data { u32 size; + bool save_every_cycle; }; #if defined(CONFIG_PM) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index ba85e9c..b20ecf5 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -57,6 +57,7 @@ /* Secure ram save size - store the defaults */ static struct omap3_secure_copy_data secure_copy_data = { .size = 0x803F, + .save_every_cycle = false, /* explicit for readability */ }; struct power_state { @@ -199,7 +200,8 @@ static void omap3_save_secure_ram_context(u32 target_mpu_state) secure_ram_save_status = _omap_save_secure_sram((u32 *) __pa(omap3_secure_ram_storage)); pwrdm_set_next_pwrst(mpu_pwrdm, target_mpu_state); - secure_ram_saved = 1; + if (!secure_copy_data.save_every_cycle) + secure_ram_saved = 1; } }