From: khilman@deeprootsystems.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 18/27] ARM: OMAP: Add missing SMS_SYSCONFIG save/restore
Date: Wed, 14 Oct 2009 14:58:01 -0700 [thread overview]
Message-ID: <1255557490-16787-19-git-send-email-khilman@deeprootsystems.com> (raw)
In-Reply-To: <1255557490-16787-18-git-send-email-khilman@deeprootsystems.com>
From: Kalle Jokiniemi <kalle.jokiniemi@digia.com>
SMS_SYSCONFIG register gets reset in off mode, added
a save/restore mechanism for that.
Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@digia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/mach-omap2/pm34xx.c | 1 +
arch/arm/mach-omap2/sdrc.c | 27 +++++++++++++++++++++++++++
arch/arm/plat-omap/include/mach/sdrc.h | 2 ++
3 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 93f5988..80934c3 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -400,6 +400,7 @@ static void omap_sram_idle(void)
omap3_core_restore_context();
omap3_prcm_restore_context();
omap3_sram_restore_context();
+ omap2_sms_restore_context();
}
if (per_next_state < PWRDM_POWER_ON) {
per_prev_state =
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index 9e3bd4f..1a4f132 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -37,12 +37,38 @@ static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1;
void __iomem *omap2_sdrc_base;
void __iomem *omap2_sms_base;
+struct omap2_sms_regs {
+ u32 sms_sysconfig;
+};
+
+static struct omap2_sms_regs sms_context;
+
/* SDRC_POWER register bits */
#define SDRC_POWER_EXTCLKDIS_SHIFT 3
#define SDRC_POWER_PWDENA_SHIFT 2
#define SDRC_POWER_PAGEPOLICY_SHIFT 0
/**
+ * omap2_sms_save_context - Save SMS registers
+ *
+ * Save SMS registers that need to be restored after off mode.
+ */
+void omap2_sms_save_context(void)
+{
+ sms_context.sms_sysconfig = sms_read_reg(SMS_SYSCONFIG);
+}
+
+/**
+ * omap2_sms_restore_context - Restore SMS registers
+ *
+ * Restore SMS registers that need to be Restored after off mode.
+ */
+void omap2_sms_restore_context(void)
+{
+ sms_write_reg(sms_context.sms_sysconfig, SMS_SYSCONFIG);
+}
+
+/**
* omap2_sdrc_get_params - return SDRC register values for a given clock rate
* @r: SDRC clock rate (in Hz)
* @sdrc_cs0: chip select 0 ram timings **
@@ -132,4 +158,5 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
l = (1 << SDRC_POWER_EXTCLKDIS_SHIFT) |
(1 << SDRC_POWER_PAGEPOLICY_SHIFT);
sdrc_write_reg(l, SDRC_POWER);
+ omap2_sms_save_context();
}
diff --git a/arch/arm/plat-omap/include/mach/sdrc.h b/arch/arm/plat-omap/include/mach/sdrc.h
index 7b58a5f..772b71e 100644
--- a/arch/arm/plat-omap/include/mach/sdrc.h
+++ b/arch/arm/plat-omap/include/mach/sdrc.h
@@ -120,6 +120,8 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
int omap2_sdrc_get_params(unsigned long r,
struct omap_sdrc_params **sdrc_cs0,
struct omap_sdrc_params **sdrc_cs1);
+void omap2_sms_save_context(void);
+void omap2_sms_restore_context(void);
#ifdef CONFIG_ARCH_OMAP2
--
1.6.4.3
next prev parent reply other threads:[~2009-10-14 21:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 21:57 [PATCH 00/27] OMAP3: PM: base off-mode support Kevin Hilman
2009-10-14 21:57 ` [PATCH 01/27] OMAP3: PM: GPMC context save/restore Kevin Hilman
2009-10-14 21:57 ` [PATCH 02/27] OMAP3: PM: GPIO " Kevin Hilman
2009-10-14 21:57 ` [PATCH 03/27] OMAP3: PM: INTC " Kevin Hilman
2009-10-14 21:57 ` [PATCH 04/27] OMAP3: PM: PRCM " Kevin Hilman
2009-10-14 21:57 ` [PATCH 05/27] OMAP3: PM: Populate scratchpad contents Kevin Hilman
2009-10-14 21:57 ` [PATCH 06/27] OMAP3: PM: SCM context save/restore Kevin Hilman
2009-10-14 21:57 ` [PATCH 07/27] OMAP3: PM: SRAM restore function Kevin Hilman
2009-10-14 21:57 ` [PATCH 08/27] OMAP3: PM: handle PER/NEON/CORE in idle Kevin Hilman
2009-10-14 21:57 ` [PATCH 09/27] OMAP3: PM: Restore MMU table entry Kevin Hilman
2009-10-14 21:57 ` [PATCH 10/27] OMAP3: PM: MPU off-mode support Kevin Hilman
2009-10-14 21:57 ` [PATCH 11/27] OMAP3: PM: CORE domain " Kevin Hilman
2009-10-14 21:57 ` [PATCH 12/27] OMAP: PM: DMA context save/restore for " Kevin Hilman
2009-10-14 21:57 ` [PATCH 13/27] OMAP3 PM: off-mode support for HS/EMU devices Kevin Hilman
2009-10-14 21:57 ` [PATCH 14/27] OMAP3: PM: save secure RAM only during init Kevin Hilman
2009-10-14 21:57 ` [PATCH 15/27] OMAP3: PM: Enable SDRAM auto-refresh during sleep Kevin Hilman
2009-10-14 21:57 ` [PATCH 16/27] OMAP3: PM: Save and restore also CM_CLKSEL1_PLL_IVA2 Kevin Hilman
2009-10-14 21:58 ` [PATCH 17/27] OMAP3: PM: Fix secure SRAM context save/restore Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman [this message]
2009-10-14 21:58 ` [PATCH 19/27] OMAP3: PM: Fix PLL_MOD CLKEN offset in scratchpad Kevin Hilman
2009-10-14 21:58 ` [PATCH 20/27] OMAP: PM: Clear DMA channel state after a wakeup Kevin Hilman
2009-10-14 21:58 ` [PATCH 21/27] OMAP: Store reboot mode in scratchpad on OMAP34xx Kevin Hilman
2009-10-14 21:58 ` [PATCH 22/27] OMAP3: PM: SDRC auto-refresh workaround for off-mode Kevin Hilman
2009-10-14 21:58 ` [PATCH 23/27] OMAP3: PM: Fix INTC context save/restore Kevin Hilman
2009-10-14 21:58 ` [PATCH 24/27] PM: Disable usb host HW save and restore Kevin Hilman
2009-10-14 21:58 ` [PATCH 25/27] OMAP3: PM: Wait for SDRC ready iso a blind delay Kevin Hilman
2009-10-14 21:58 ` [PATCH 26/27] OMAP3: PM debug: allow runtime toggle of PM features Kevin Hilman
2009-10-14 21:58 ` [PATCH 27/27] PM debug: allow configurable wakeup from suspend on OMAP GPtimer Kevin Hilman
2009-10-14 22:18 ` [PATCH 08/27] OMAP3: PM: handle PER/NEON/CORE in idle Tony Lindgren
2009-10-14 22:17 ` [PATCH 07/27] OMAP3: PM: SRAM restore function Tony Lindgren
2009-10-14 22:15 ` [PATCH 03/27] OMAP3: PM: INTC context save/restore Tony Lindgren
2009-10-14 22:13 ` [PATCH 02/27] OMAP3: PM: GPIO " Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1255557490-16787-19-git-send-email-khilman@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).