@@ -267,7 +267,8 @@ void omap3_clear_scratchpad_contents(void)
}
/* Populate the scratchpad structure with restore structure */
-void omap3_save_scratchpad_contents(void)
+void omap3_save_scratchpad_contents(u32 public_restore_ptr,
+ u32 secure_ram_restore_ptr)
{
void __iomem *scratchpad_address;
u32 arm_context_addr;
@@ -278,27 +279,13 @@ void omap3_save_scratchpad_contents(void)
/*
* Populate the Scratchpad contents
*
- * The "get_*restore_pointer" functions are used to provide a
+ * The public_restore_ptr field of the scratchpad data provides a
* physical restore address where the ROM code jumps while waking
* up from MPU OFF/OSWR state.
- * The restore pointer is stored into the scratchpad.
*/
scratchpad_contents.boot_config_ptr = 0x0;
- if (cpu_is_omap3630())
- scratchpad_contents.public_restore_ptr =
- virt_to_phys(get_omap3630_restore_pointer());
- else if (omap_rev() != OMAP3430_REV_ES3_0 &&
- omap_rev() != OMAP3430_REV_ES3_1)
- scratchpad_contents.public_restore_ptr =
- virt_to_phys(get_restore_pointer());
- else
- scratchpad_contents.public_restore_ptr =
- virt_to_phys(get_es3_restore_pointer());
- if (omap_type() == OMAP2_DEVICE_TYPE_GP)
- scratchpad_contents.secure_ram_restore_ptr = 0x0;
- else
- scratchpad_contents.secure_ram_restore_ptr =
- (u32) __pa(omap3_secure_ram_storage);
+ scratchpad_contents.public_restore_ptr = public_restore_ptr;
+ scratchpad_contents.secure_ram_restore_ptr = secure_ram_restore_ptr;
scratchpad_contents.sdrc_module_semaphore = 0x0;
scratchpad_contents.prcm_block_offset = 0x2C;
scratchpad_contents.sdrc_block_offset = 0x64;
@@ -384,11 +384,9 @@ extern void omap_ctrl_writew(u16 val, u16 offset);
extern void omap_ctrl_writel(u32 val, u16 offset);
extern void omap4_ctrl_pad_writel(u32 val, u16 offset);
-extern void omap3_save_scratchpad_contents(void);
+extern void omap3_save_scratchpad_contents(u32 public_restore_ptr,
+ u32 secure_ram_restore_ptr);
extern void omap3_clear_scratchpad_contents(void);
-extern u32 *get_restore_pointer(void);
-extern u32 *get_es3_restore_pointer(void);
-extern u32 *get_omap3630_restore_pointer(void);
extern u32 omap3_arm_context[128];
extern void omap3_control_save_context(void);
extern void omap3_control_restore_context(void);
@@ -91,13 +91,18 @@ extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
void __iomem *sdrc_power);
extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
extern int save_secure_ram_context(u32 *addr);
-extern void omap3_save_scratchpad_contents(void);
extern unsigned int omap24xx_idle_loop_suspend_sz;
extern unsigned int save_secure_ram_context_sz;
extern unsigned int omap24xx_cpu_suspend_sz;
extern unsigned int omap34xx_cpu_suspend_sz;
+#ifdef CONFIG_PM
+extern u32 *get_restore_pointer(void);
+extern u32 *get_es3_restore_pointer(void);
+extern u32 *get_omap3630_restore_pointer(void);
+#endif
+
#define PM_RTA_ERRATUM_i608 (1 << 0)
#define PM_SDRC_WAKEUP_ERRATUM_i583 (1 << 1)
@@ -885,6 +885,31 @@ static void __init pm_errata_configure(void)
}
}
+/*
+ * The "get_*restore_pointer" functions are used to provide a
+ * physical restore address where the ROM code jumps while waking
+ * up from MPU OFF/OSWR state.
+ * The restore pointer is stored into the scratchpad.
+ */
+static inline u32 _get_public_restore_ptr(void)
+{
+ if (cpu_is_omap3630())
+ return virt_to_phys(get_omap3630_restore_pointer());
+ else if (omap_rev() != OMAP3430_REV_ES3_0 &&
+ omap_rev() != OMAP3430_REV_ES3_1)
+ return virt_to_phys(get_restore_pointer());
+ else
+ return virt_to_phys(get_es3_restore_pointer());
+}
+
+static inline u32 _get_secure_ram_restore_ptr(void)
+{
+ if (omap_type() == OMAP2_DEVICE_TYPE_GP)
+ return 0x0;
+ else
+ return (u32) __pa(omap3_secure_ram_storage);
+}
+
static int __init omap3_pm_init(void)
{
struct power_state *pwrst, *tmp;
@@ -970,7 +995,8 @@ static int __init omap3_pm_init(void)
local_fiq_enable();
}
- omap3_save_scratchpad_contents();
+ omap3_save_scratchpad_contents(_get_public_restore_ptr(),
+ _get_secure_ram_restore_ptr());
err1:
return ret;
err2: