ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case.
[pandora-kernel.git] / arch / arm / mach-omap2 / control.c
index f432ffc..e84e3b4 100644 (file)
@@ -309,7 +309,8 @@ void omap3_save_scratchpad_contents(void)
                scratchpad_contents.public_restore_ptr =
                        virt_to_phys(omap3_restore_3630);
        else if (omap_rev() != OMAP3430_REV_ES3_0 &&
-                                       omap_rev() != OMAP3430_REV_ES3_1)
+                                       omap_rev() != OMAP3430_REV_ES3_1 &&
+                                       omap_rev() != OMAP3430_REV_ES3_1_2)
                scratchpad_contents.public_restore_ptr =
                        virt_to_phys(omap3_restore);
        else
@@ -564,7 +565,7 @@ int omap3_ctrl_save_padconf(void)
  * Sets the bootmode for IVA2 to idle. This is needed by the PM code to
  * force disable IVA2 so that it does not prevent any low-power states.
  */
-void omap3_ctrl_set_iva_bootmode_idle(void)
+static void __init omap3_ctrl_set_iva_bootmode_idle(void)
 {
        omap_ctrl_writel(OMAP3_IVA2_BOOTMOD_IDLE,
                         OMAP343X_CONTROL_IVA2_BOOTMOD);
@@ -576,7 +577,7 @@ void omap3_ctrl_set_iva_bootmode_idle(void)
  * Sets up the pads controlling the stacked modem in such way that the
  * device can enter idle.
  */
-void omap3_ctrl_setup_d2d_padconf(void)
+static void __init omap3_ctrl_setup_d2d_padconf(void)
 {
        u16 mask, padconf;
 
@@ -595,4 +596,19 @@ void omap3_ctrl_setup_d2d_padconf(void)
        padconf |= mask;
        omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK);
 }
+
+/**
+ * omap3_ctrl_init - does static initializations for control module
+ *
+ * Initializes system control module. This sets up the sysconfig autoidle,
+ * and sets up modem and iva2 so that they can be idled properly.
+ */
+void __init omap3_ctrl_init(void)
+{
+       omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG);
+
+       omap3_ctrl_set_iva_bootmode_idle();
+
+       omap3_ctrl_setup_d2d_padconf();
+}
 #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */