summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/prm3xxx.c
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2014-02-26 11:54:29 +0200
committerTero Kristo <t-kristo@ti.com>2014-07-04 17:02:14 +0300
commit9efcea09b0b56488e46ab3a36fe8dbce9eded529 (patch)
tree8178e61ea7c2636384ab979391e4165b6db1a152 /arch/arm/mach-omap2/prm3xxx.c
parent55c6c3ad90f606d458d798b36f8ffca98c1894e0 (diff)
ARM: OMAP3: PRM: add API for checking and clearing cold reset status
This isolates the PRM register access within the PRM driver. Signed-off-by: Tero Kristo <t-kristo@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/prm3xxx.c')
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index e46ff7184c9d..4733c28d9d64 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -389,6 +389,26 @@ void omap3xxx_prm_iva_idle(void)
OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
}
+/**
+ * omap3xxx_prm_clear_global_cold_reset - checks the global cold reset status
+ * and clears it if asserted
+ *
+ * Checks if cold-reset has occurred and clears the status bit if yes. Returns
+ * 1 if cold-reset has occurred, 0 otherwise.
+ */
+int omap3xxx_prm_clear_global_cold_reset(void)
+{
+ if (omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) &
+ OMAP3430_GLOBAL_COLD_RST_MASK) {
+ omap2_prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST_MASK,
+ OMAP3430_GR_MOD,
+ OMAP3_PRM_RSTST_OFFSET);
+ return 1;
+ }
+
+ return 0;
+}
+
/* Powerdomain low-level functions */
static int omap3_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)