]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
ARM: OMAP2/3: PRM: add SoC reset functions (using the CORE DPLL method)
authorPaul Walmsley <paul@pwsan.com>
Tue, 30 Oct 2012 02:55:46 +0000 (20:55 -0600)
committerPaul Walmsley <paul@pwsan.com>
Thu, 8 Nov 2012 19:33:07 +0000 (12:33 -0700)
Add SoC reset functions into the PRM code.  These functions are based
on code from mach-omap2/prcm.c.  They reset the SoC using the CORE DPLL
reset method (as opposed to one of the other two or three chip reset
methods).

Adding them here will facilitate their removal from
arch/arm/mach-omap2/prcm.c.  (prcm.c is deprecated.)

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
arch/arm/mach-omap2/prm2xxx.c
arch/arm/mach-omap2/prm2xxx.h
arch/arm/mach-omap2/prm3xxx.c
arch/arm/mach-omap2/prm3xxx.h

index e2860f9c111d041f8ff2d644154fe962144a5592..1f777bf2bc8f152071bd05a12279499927c23dd5 100644 (file)
@@ -69,6 +69,20 @@ static u32 omap2xxx_prm_read_reset_sources(void)
        return r;
 }
 
+/**
+ * omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC
+ *
+ * Set the DPLL reset bit, which should reboot the SoC.  This is the
+ * recommended way to restart the SoC.  No return value.
+ */
+void omap2xxx_prm_dpll_reset(void)
+{
+       omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, WKUP_MOD,
+                                  OMAP2_RM_RSTCTRL);
+       /* OCP barrier */
+       omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTCTRL);
+}
+
 int omap2xxx_clkdm_sleep(struct clockdomain *clkdm)
 {
        omap2_prm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
index 1d97112524f1c7032a35d5f7f99e81d847c0a879..fe8a14f190abc001ba49eb46e7f57c13994e042e 100644 (file)
 extern int omap2xxx_clkdm_sleep(struct clockdomain *clkdm);
 extern int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm);
 
+extern void omap2xxx_prm_dpll_reset(void);
+
 extern int __init prm2xxx_init(void);
 extern int __exit prm2xxx_exit(void);
 
index 1fea656b2ca89f79694c0256bcab32e9c35b10e9..5435673ac9ce34edb5fa5d76fbed3af1f1c96bbb 100644 (file)
@@ -122,6 +122,21 @@ u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
        return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset);
 }
 
+/**
+ * omap3xxx_prm_dpll3_reset - use DPLL3 reset to reboot the OMAP SoC
+ *
+ * Set the DPLL3 reset bit, which should reboot the SoC.  This is the
+ * recommended way to restart the SoC, considering Errata i520.  No
+ * return value.
+ */
+void omap3xxx_prm_dpll3_reset(void)
+{
+       omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, OMAP3430_GR_MOD,
+                                  OMAP2_RM_RSTCTRL);
+       /* OCP barrier */
+       omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP2_RM_RSTCTRL);
+}
+
 /**
  * omap3xxx_prm_read_pending_irqs - read pending PRM MPU IRQs into @events
  * @events: ptr to a u32, preallocated by caller
index a3c28a8754101dbfec6ce1df8c0f4f292315e159..10cd41a8129eb62c4589edfddbcfd907cf264b36 100644 (file)
@@ -152,6 +152,8 @@ extern void omap3xxx_prm_ocp_barrier(void);
 extern void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask);
 extern void omap3xxx_prm_restore_irqen(u32 *saved_mask);
 
+extern void omap3xxx_prm_dpll3_reset(void);
+
 extern u32 omap3xxx_prm_get_reset_sources(void);
 
 #endif /* __ASSEMBLER */