Commit 3231fc889c114870ca830041fcdeb5d4745304cf

Authored by Rajendra Nayak
Committed by Kevin Hilman
1 parent c96631e138

OMAP3: PM: restore SRAM functions after off-mode.

Generalize the copy of SRAM functions into omap_push_sram_idle()
so it can be used on init but also after off-mode transitions.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>

Showing 3 changed files with 18 additions and 6 deletions Side-by-side Diff

arch/arm/mach-omap2/pm34xx.c
... ... @@ -749,6 +749,12 @@
749 749 return 0;
750 750 }
751 751  
  752 +void omap_push_sram_idle(void)
  753 +{
  754 + _omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend,
  755 + omap34xx_cpu_suspend_sz);
  756 +}
  757 +
752 758 static int __init omap3_pm_init(void)
753 759 {
754 760 struct power_state *pwrst, *tmp;
... ... @@ -786,9 +792,7 @@
786 792 goto err2;
787 793 }
788 794  
789   - _omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend,
790   - omap34xx_cpu_suspend_sz);
791   -
  795 + omap_push_sram_idle();
792 796 #ifdef CONFIG_SUSPEND
793 797 suspend_set_ops(&omap_pm_ops);
794 798 #endif /* CONFIG_SUSPEND */
arch/arm/plat-omap/include/plat/sram.h
... ... @@ -68,5 +68,11 @@
68 68 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
69 69 extern unsigned long omap3_sram_configure_core_dpll_sz;
70 70  
  71 +#ifdef CONFIG_PM
  72 +extern void omap_push_sram_idle(void);
  73 +#else
  74 +static inline void omap_push_sram_idle(void) {}
  75 +#endif /* CONFIG_PM */
  76 +
71 77 #endif
arch/arm/plat-omap/sram.c
... ... @@ -396,22 +396,24 @@
396 396 sdrc_actim_ctrl_b_1, sdrc_mr_1);
397 397 }
398 398  
399   -/* REVISIT: Should this be same as omap34xx_sram_init() after off-idle? */
400   -void restore_sram_functions(void)
  399 +#ifdef CONFIG_PM
  400 +void omap3_sram_restore_context(void)
401 401 {
402 402 omap_sram_ceil = omap_sram_base + omap_sram_size;
403 403  
404 404 _omap3_sram_configure_core_dpll =
405 405 omap_sram_push(omap3_sram_configure_core_dpll,
406 406 omap3_sram_configure_core_dpll_sz);
  407 + omap_push_sram_idle();
407 408 }
  409 +#endif /* CONFIG_PM */
408 410  
409 411 int __init omap34xx_sram_init(void)
410 412 {
411 413 _omap3_sram_configure_core_dpll =
412 414 omap_sram_push(omap3_sram_configure_core_dpll,
413 415 omap3_sram_configure_core_dpll_sz);
414   -
  416 + omap_push_sram_idle();
415 417 return 0;
416 418 }
417 419 #else