]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: OMAP3: PRM: add API for saving PRM scratchpad contents
authorTero Kristo <t-kristo@ti.com>
Wed, 26 Feb 2014 10:00:16 +0000 (12:00 +0200)
committerTero Kristo <t-kristo@ti.com>
Fri, 4 Jul 2014 14:02:15 +0000 (17:02 +0300)
This isolates the PRM register access within the PRM driver.

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

index f8eb3e4354ad23b78920633e0c992d95184046f4..83080949d0d30f9b5c8aae783150acdb1c1e5a9d 100644 (file)
@@ -44,8 +44,7 @@ struct omap3_scratchpad {
 };
 
 struct omap3_scratchpad_prcm_block {
-       u32 prm_clksrc_ctrl;
-       u32 prm_clksel;
+       u32 prm_contents[2];
        u32 cm_contents[11];
        u32 prcm_block_size;
 };
@@ -327,13 +326,7 @@ void omap3_save_scratchpad_contents(void)
        scratchpad_contents.sdrc_block_offset = 0x64;
 
        /* Populate the PRCM block contents */
-       prcm_block_contents.prm_clksrc_ctrl =
-               omap2_prm_read_mod_reg(OMAP3430_GR_MOD,
-                                      OMAP3_PRM_CLKSRC_CTRL_OFFSET);
-       prcm_block_contents.prm_clksel =
-               omap2_prm_read_mod_reg(OMAP3430_CCR_MOD,
-                                      OMAP3_PRM_CLKSEL_OFFSET);
-
+       omap3_prm_save_scratchpad_contents(prcm_block_contents.prm_contents);
        omap3_cm_save_scratchpad_contents(prcm_block_contents.cm_contents);
 
        prcm_block_contents.prcm_block_size = 0x0;
index 4733c28d9d64232d6538c9ffb2f3669a778cfec9..4d93b844bcc4370784f5d2cf678849be6f0471d1 100644 (file)
@@ -409,6 +409,15 @@ int omap3xxx_prm_clear_global_cold_reset(void)
        return 0;
 }
 
+void omap3_prm_save_scratchpad_contents(u32 *ptr)
+{
+       *ptr++ = omap2_prm_read_mod_reg(OMAP3430_GR_MOD,
+                                       OMAP3_PRM_CLKSRC_CTRL_OFFSET);
+
+       *ptr++ = omap2_prm_read_mod_reg(OMAP3430_GR_MOD,
+                                       OMAP3_PRM_CLKSEL_OFFSET);
+}
+
 /* Powerdomain low-level functions */
 
 static int omap3_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
index 7548ae0e86d53f5084077d17332bafe081d4f176..c5f9cbabb5bbcb6134d75528ca940be5325ef5f1 100644 (file)
@@ -166,6 +166,7 @@ int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 ignore_bits);
 void omap3xxx_prm_iva_idle(void);
 void omap3_prm_reset_modem(void);
 int omap3xxx_prm_clear_global_cold_reset(void);
+void omap3_prm_save_scratchpad_contents(u32 *ptr);
 
 #endif /* __ASSEMBLER */