diff options
author | Kalle Jokiniemi <kalle.jokiniemi@digia.com> | 2009-05-13 06:32:11 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-11-11 17:42:26 -0500 |
commit | 8a917d2fc80b7c45ce0146ff134168646274a9bd (patch) | |
tree | 5416b17c7d70203a870990f95f9c37646c6bdd9f | |
parent | ba50ea7eb9ce663511013b35608cf0753c9ab674 (diff) |
ARM: OMAP: SMS: save/restore of SMS_SYSCONFIG for off-mode
The 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>
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/sdrc.c | 27 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/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 a9f4034aa70a..90d1dc5884ef 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -399,6 +399,7 @@ static void omap_sram_idle(void) | |||
399 | omap3_core_restore_context(); | 399 | omap3_core_restore_context(); |
400 | omap3_prcm_restore_context(); | 400 | omap3_prcm_restore_context(); |
401 | omap3_sram_restore_context(); | 401 | omap3_sram_restore_context(); |
402 | omap2_sms_restore_context(); | ||
402 | } | 403 | } |
403 | if (per_next_state < PWRDM_POWER_ON) { | 404 | if (per_next_state < PWRDM_POWER_ON) { |
404 | per_prev_state = | 405 | per_prev_state = |
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c index 07000de48f34..9a592199321c 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; | |||
37 | void __iomem *omap2_sdrc_base; | 37 | void __iomem *omap2_sdrc_base; |
38 | void __iomem *omap2_sms_base; | 38 | void __iomem *omap2_sms_base; |
39 | 39 | ||
40 | struct omap2_sms_regs { | ||
41 | u32 sms_sysconfig; | ||
42 | }; | ||
43 | |||
44 | static struct omap2_sms_regs sms_context; | ||
45 | |||
40 | /* SDRC_POWER register bits */ | 46 | /* SDRC_POWER register bits */ |
41 | #define SDRC_POWER_EXTCLKDIS_SHIFT 3 | 47 | #define SDRC_POWER_EXTCLKDIS_SHIFT 3 |
42 | #define SDRC_POWER_PWDENA_SHIFT 2 | 48 | #define SDRC_POWER_PWDENA_SHIFT 2 |
43 | #define SDRC_POWER_PAGEPOLICY_SHIFT 0 | 49 | #define SDRC_POWER_PAGEPOLICY_SHIFT 0 |
44 | 50 | ||
45 | /** | 51 | /** |
52 | * omap2_sms_save_context - Save SMS registers | ||
53 | * | ||
54 | * Save SMS registers that need to be restored after off mode. | ||
55 | */ | ||
56 | void omap2_sms_save_context(void) | ||
57 | { | ||
58 | sms_context.sms_sysconfig = sms_read_reg(SMS_SYSCONFIG); | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * omap2_sms_restore_context - Restore SMS registers | ||
63 | * | ||
64 | * Restore SMS registers that need to be Restored after off mode. | ||
65 | */ | ||
66 | void omap2_sms_restore_context(void) | ||
67 | { | ||
68 | sms_write_reg(sms_context.sms_sysconfig, SMS_SYSCONFIG); | ||
69 | } | ||
70 | |||
71 | /** | ||
46 | * omap2_sdrc_get_params - return SDRC register values for a given clock rate | 72 | * omap2_sdrc_get_params - return SDRC register values for a given clock rate |
47 | * @r: SDRC clock rate (in Hz) | 73 | * @r: SDRC clock rate (in Hz) |
48 | * @sdrc_cs0: chip select 0 ram timings ** | 74 | * @sdrc_cs0: chip select 0 ram timings ** |
@@ -132,4 +158,5 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | |||
132 | l = (1 << SDRC_POWER_EXTCLKDIS_SHIFT) | | 158 | l = (1 << SDRC_POWER_EXTCLKDIS_SHIFT) | |
133 | (1 << SDRC_POWER_PAGEPOLICY_SHIFT); | 159 | (1 << SDRC_POWER_PAGEPOLICY_SHIFT); |
134 | sdrc_write_reg(l, SDRC_POWER); | 160 | sdrc_write_reg(l, SDRC_POWER); |
161 | omap2_sms_save_context(); | ||
135 | } | 162 | } |
diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h index 7b58a5f78ce4..772b71e8b44f 100644 --- a/arch/arm/plat-omap/include/plat/sdrc.h +++ b/arch/arm/plat-omap/include/plat/sdrc.h | |||
@@ -120,6 +120,8 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | |||
120 | int omap2_sdrc_get_params(unsigned long r, | 120 | int omap2_sdrc_get_params(unsigned long r, |
121 | struct omap_sdrc_params **sdrc_cs0, | 121 | struct omap_sdrc_params **sdrc_cs0, |
122 | struct omap_sdrc_params **sdrc_cs1); | 122 | struct omap_sdrc_params **sdrc_cs1); |
123 | void omap2_sms_save_context(void); | ||
124 | void omap2_sms_restore_context(void); | ||
123 | 125 | ||
124 | #ifdef CONFIG_ARCH_OMAP2 | 126 | #ifdef CONFIG_ARCH_OMAP2 |
125 | 127 | ||