From patchwork Thu Oct 22 23:09:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 55482 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 n9MNAaGr019479 for ; Thu, 22 Oct 2009 23:10:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754755AbZJVXKa (ORCPT ); Thu, 22 Oct 2009 19:10:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751410AbZJVXKa (ORCPT ); Thu, 22 Oct 2009 19:10:30 -0400 Received: from qw-out-2122.google.com ([74.125.92.25]:3282 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754624AbZJVXK3 (ORCPT ); Thu, 22 Oct 2009 19:10:29 -0400 Received: by qw-out-2122.google.com with SMTP id 9so1260502qwb.37 for ; Thu, 22 Oct 2009 16:10:34 -0700 (PDT) Received: by 10.224.8.72 with SMTP id g8mr186804qag.291.1256253034623; Thu, 22 Oct 2009 16:10:34 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id 26sm923815qwa.13.2009.10.22.16.10.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 22 Oct 2009 16:10:33 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Rajendra Nayak Subject: [PATCH v2 10/32] OMAP3: PM: MPU off-mode support Date: Thu, 22 Oct 2009 16:09:31 -0700 Message-Id: <1256252993-24328-11-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.4.3 In-Reply-To: <1256252993-24328-10-git-send-email-khilman@deeprootsystems.com> References: <1256252993-24328-1-git-send-email-khilman@deeprootsystems.com> <1256252993-24328-2-git-send-email-khilman@deeprootsystems.com> <1256252993-24328-3-git-send-email-khilman@deeprootsystems.com> <1256252993-24328-4-git-send-email-khilman@deeprootsystems.com> <1256252993-24328-5-git-send-email-khilman@deeprootsystems.com> <1256252993-24328-6-git-send-email-khilman@deeprootsystems.com> <1256252993-24328-7-git-send-email-khilman@deeprootsystems.com> <1256252993-24328-8-git-send-email-khilman@deeprootsystems.com> <1256252993-24328-9-git-send-email-khilman@deeprootsystems.com> <1256252993-24328-10-git-send-email-khilman@deeprootsystems.com> 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 8b5bf91..9fb0876 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -223,6 +224,9 @@ static void omap_sram_idle(void) /* No need to save context */ save_state = 0; break; + case PWRDM_POWER_OFF: + save_state = 3; + break; default: /* Invalid state */ printk(KERN_ERR "Invalid mpu state in sram_idle\n"); @@ -248,7 +252,12 @@ static void omap_sram_idle(void) prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); } - _omap_sram_idle(NULL, save_state); + /* + * omap3_arm_context is the location where ARM registers + * get saved. The restore path then reads from this + * location and restores them back. + */ + _omap_sram_idle(omap3_arm_context, save_state); cpu_init(); /* Restore table entry modified during MMU restoration */ diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 6a749f2..f8d3834 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -36,12 +36,11 @@ OMAP3430_PM_PREPWSTST) #define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ OMAP3430_PM_PREPWSTST) -#define PM_PWSTCTRL_MPU_P OMAP34XX_PRM_REGADDR(MPU_MOD, PM_PWSTCTRL) +#define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + PM_PWSTCTRL #define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is * available */ -#define SCRATCHPAD_BASE_P OMAP343X_CTRL_REGADDR(\ - OMAP343X_CONTROL_MEM_WKUP +\ - SCRATCHPAD_MEM_OFFS) +#define SCRATCHPAD_BASE_P (OMAP343X_CTRL_BASE + OMAP343X_CONTROL_MEM_WKUP\ + + SCRATCHPAD_MEM_OFFS) #define SDRC_POWER_V OMAP34XX_SDRC_REGADDR(SDRC_POWER) .text @@ -96,7 +95,7 @@ loop: ldmfd sp!, {r0-r12, pc} @ restore regs and return restore: - /* b restore*/ @ Enable to debug restore code + /* b restore*/ @ Enable to debug restore code /* Check what was the reason for mpu reset and store the reason in r9*/ /* 1 - Only L1 and logic lost */ /* 2 - Only L2 lost - In this case, we wont be here */ @@ -416,8 +415,6 @@ scratchpad_base: .word SCRATCHPAD_BASE_P sdrc_power: .word SDRC_POWER_V -context_mem: - .word 0x803E3E14 clk_stabilize_delay: .word 0x000001FF assoc_mask: