OMAP3: control/PRCM: move CONTROL_PADCONF_SYS_NIRQ save/restore to SCM code
authorPaul Walmsley <paul@pwsan.com>
Tue, 21 Dec 2010 22:30:53 +0000 (15:30 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 22 Dec 2010 03:01:53 +0000 (20:01 -0700)
For some reason, the PRCM context save/restore code also saves and
restores a single System Control Module register,
CONTROL_PADCONF_SYS_NIRQ.  This is probably just an error -- the
register should be handled by SCM code -- so this patch moves it
there.

If this register really does need to be saved and restored before the
rest of the PRCM registers, the code to do so should live in the SCM
code, and the PM code should call this separate function.  This
register pertains to devices with a stacked modem, so this patch is
unlikely to affect most OMAP devices out there.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com>
Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Rajendra Nayak <rnayak@ti.com>
arch/arm/mach-omap2/control.c
arch/arm/mach-omap2/prcm.c

index d058f7c3ec6a1c63d8a921aa65f74c9f7ef0ae38..b066c6e110a6425be0f0dcacc0b00a46808eb3e9 100644 (file)
@@ -134,6 +134,7 @@ struct omap3_control_regs {
        u32 sramldo4;
        u32 sramldo5;
        u32 csi;
+       u32 padconf_sys_nirq;
 };
 
 static struct omap3_control_regs control_context;
@@ -457,6 +458,8 @@ void omap3_control_save_context(void)
        control_context.sramldo4 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO4);
        control_context.sramldo5 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO5);
        control_context.csi = omap_ctrl_readl(OMAP343X_CONTROL_CSI);
+       control_context.padconf_sys_nirq =
+               omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ);
        return;
 }
 
@@ -513,6 +516,8 @@ void omap3_control_restore_context(void)
        omap_ctrl_writel(control_context.sramldo4, OMAP343X_CONTROL_SRAMLDO4);
        omap_ctrl_writel(control_context.sramldo5, OMAP343X_CONTROL_SRAMLDO5);
        omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI);
+       omap_ctrl_writel(control_context.padconf_sys_nirq,
+                        OMAP343X_CONTROL_PADCONF_SYSNIRQ);
        return;
 }
 
index 2eca8475d39671f6c295066075722d9e038c0074..d27cdbaeea55fea892209895cd3673cdcf633756 100644 (file)
@@ -42,7 +42,6 @@ static void __iomem *cm2_base;
 #define MAX_MODULE_ENABLE_WAIT         100000
 
 struct omap3_prcm_regs {
-       u32 control_padconf_sys_nirq;
        u32 iva2_cm_clksel1;
        u32 iva2_cm_clksel2;
        u32 cm_sysconfig;
@@ -312,8 +311,6 @@ void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals)
 #ifdef CONFIG_ARCH_OMAP3
 void omap3_prcm_save_context(void)
 {
-       prcm_context.control_padconf_sys_nirq =
-                        omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ);
        prcm_context.iva2_cm_clksel1 =
                         cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL1);
        prcm_context.iva2_cm_clksel2 =
@@ -466,8 +463,6 @@ void omap3_prcm_save_context(void)
 
 void omap3_prcm_restore_context(void)
 {
-       omap_ctrl_writel(prcm_context.control_padconf_sys_nirq,
-                                        OMAP343X_CONTROL_PADCONF_SYSNIRQ);
        cm_write_mod_reg(prcm_context.iva2_cm_clksel1, OMAP3430_IVA2_MOD,
                                         CM_CLKSEL1);
        cm_write_mod_reg(prcm_context.iva2_cm_clksel2, OMAP3430_IVA2_MOD,