ARM: OMAP3: control: isolate control module init to its own function
authorTero Kristo <t-kristo@ti.com>
Tue, 4 Mar 2014 15:43:04 +0000 (17:43 +0200)
committerTero Kristo <t-kristo@ti.com>
Fri, 4 Jul 2014 14:02:21 +0000 (17:02 +0300)
Control module related PM initializations are now moved within control
module driver. Done in preparation to isolate the code to its own driver.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
arch/arm/mach-omap2/control.c
arch/arm/mach-omap2/control.h
arch/arm/mach-omap2/pm34xx.c
arch/arm/mach-omap2/prm3xxx.c

index f432ffc0deb23fe76ccd0fc17f3d74fc425a5e24..f4796c002070819aa91d5ae229fabae51e5a252b 100644 (file)
@@ -564,7 +564,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 +576,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 +595,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 */
index fc001587ebf573043c7688d733df060e910e205b..ccbd70ce4c97873bf9df926d08ba468cc3fce514 100644 (file)
@@ -427,8 +427,7 @@ extern void omap_ctrl_write_dsp_boot_addr(u32 bootaddr);
 extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode);
 extern void omap3630_ctrl_disable_rta(void);
 extern int omap3_ctrl_save_padconf(void);
-extern void omap3_ctrl_set_iva_bootmode_idle(void);
-void omap3_ctrl_setup_d2d_padconf(void);
+void omap3_ctrl_init(void);
 extern void omap2_set_globals_control(void __iomem *ctrl,
                                      void __iomem *ctrl_pad);
 #else
index 9410b4a5c252603ceb1aa853ca913eb690f2081f..3f80929a5f7e80eacaaa2f8f369f1dda4c232731 100644 (file)
@@ -355,8 +355,7 @@ restore:
 
 static void __init prcm_setup_regs(void)
 {
-       /* XXX This should be handled by hwmod code or SCM init code */
-       omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG);
+       omap3_ctrl_init();
 
        omap3_prm_init_pm(cpu_is_omap3630(), omap3_has_iva());
 }
index 75dfe8efdfe02fe21a073ad1ced2282b2d5b80cb..2458be6fc67bd7ef0617aea4899164d1507077c0 100644 (file)
@@ -28,7 +28,6 @@
 #include "prm-regbits-34xx.h"
 #include "cm3xxx.h"
 #include "cm-regbits-34xx.h"
-#include "control.h"
 
 static const struct omap_prcm_irq omap3_prcm_irqs[] = {
        OMAP_PRCM_IRQ("wkup",   0,      0),
@@ -366,8 +365,6 @@ void __init omap3_prm_init_pm(bool has_uart4, bool has_iva)
        /* We need to idle iva2_pwrdm even on am3703 with no iva2. */
        omap3xxx_prm_iva_idle();
 
-       omap3_ctrl_setup_d2d_padconf();
-
        omap3_prm_reset_modem();
 }
 
@@ -470,9 +467,6 @@ void omap3xxx_prm_iva_idle(void)
        omap2_cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK,
                               OMAP3430_IVA2_MOD, CM_FCLKEN);
 
-       /* Set IVA2 boot mode to 'idle' */
-       omap3_ctrl_set_iva_bootmode_idle();
-
        /* Un-reset IVA2 */
        omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);