From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/13] ARM: OMAP2/3: PRM: add SoC reset functions (using the CORE DPLL method)
Date: Thu, 25 Oct 2012 17:21:14 -0600 [thread overview]
Message-ID: <20121025232113.17558.18125.stgit@dusk.lan> (raw)
In-Reply-To: <20121025231818.17558.57884.stgit@dusk.lan>
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>
---
arch/arm/mach-omap2/prm2xxx.c | 14 ++++++++++++++
arch/arm/mach-omap2/prm2xxx.h | 2 ++
arch/arm/mach-omap2/prm3xxx.c | 15 +++++++++++++++
arch/arm/mach-omap2/prm3xxx.h | 2 ++
4 files changed, 33 insertions(+)
diff --git a/arch/arm/mach-omap2/prm2xxx.c b/arch/arm/mach-omap2/prm2xxx.c
index e2860f9..1f777bf 100644
--- a/arch/arm/mach-omap2/prm2xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx.c
@@ -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,
diff --git a/arch/arm/mach-omap2/prm2xxx.h b/arch/arm/mach-omap2/prm2xxx.h
index 1d97112..fe8a14f 100644
--- a/arch/arm/mach-omap2/prm2xxx.h
+++ b/arch/arm/mach-omap2/prm2xxx.h
@@ -124,6 +124,8 @@
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);
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index 1fea656..5435673 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -123,6 +123,21 @@ u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 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
*
diff --git a/arch/arm/mach-omap2/prm3xxx.h b/arch/arm/mach-omap2/prm3xxx.h
index a3c28a8..10cd41a 100644
--- a/arch/arm/mach-omap2/prm3xxx.h
+++ b/arch/arm/mach-omap2/prm3xxx.h
@@ -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 */
next prev parent reply other threads:[~2012-10-25 23:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 23:21 [PATCH 00/13] ARM: OMAP: remove prcm.[ch] Paul Walmsley
2012-10-25 23:21 ` [PATCH 01/13] ARM: OMAP2+: common: remove mach-omap2/common.c and map_common_io code Paul Walmsley
2012-10-25 23:21 ` Paul Walmsley [this message]
2012-10-25 23:21 ` [PATCH 03/13] ARM: OMAP2xxx: clock: remove global 'dclk' variable Paul Walmsley
2012-10-25 23:21 ` [PATCH 04/13] ARM: OMAP2xxx: clock: move virt_prcm_set code into clkt2xxx_virt_prcm_set.c Paul Walmsley
2012-10-25 23:21 ` [PATCH 05/13] ARM: OMAP2+: PRCM: create SoC-specific chip restart functions Paul Walmsley
2012-10-31 6:35 ` Vaibhav Hiremath
2012-10-31 6:38 ` Paul Walmsley
2012-11-01 11:57 ` Paul Walmsley
2012-11-07 20:03 ` Paul Walmsley
2012-10-25 23:21 ` [PATCH 06/13] ARM: OMAP2+: board files: use SoC-specific system " Paul Walmsley
2012-10-25 23:21 ` [PATCH 07/13] ARM: OMAP2xxx: APLL/CM: convert to use omap2_cm_wait_module_ready() Paul Walmsley
2012-10-25 23:21 ` [PATCH 08/13] ARM: OMAP2+: CM/clock: convert _omap2_module_wait_ready() to use SoC-independent CM functions Paul Walmsley
2012-11-08 22:15 ` Paul Walmsley
2012-10-25 23:21 ` [PATCH 09/13] ARM: OMAP2+: PRCM: remove omap2_cm_wait_idlest() Paul Walmsley
2012-10-25 23:21 ` [PATCH 10/13] ARM: OMAP2+: PRCM: split and relocate the PRM/CM globals setup Paul Walmsley
2012-10-25 23:21 ` [PATCH 11/13] ARM: OMAP2+: PRCM: consolidate PRCM-related timeout macros Paul Walmsley
2012-10-25 23:21 ` [PATCH 12/13] ARM: OMAP2+: hwmod: call to _omap4_disable_module() should use the SoC-specific call Paul Walmsley
2012-10-25 23:21 ` [PATCH 13/13] ARM: OMAP2+: PRCM: remove obsolete prcm.[ch] Paul Walmsley
2012-10-29 10:33 ` [PATCH 00/13] ARM: OMAP: remove prcm.[ch] Vaibhav Hiremath
2012-10-30 11:57 ` Paul Walmsley
2012-10-31 5:29 ` Hiremath, Vaibhav
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121025232113.17558.18125.stgit@dusk.lan \
--to=paul@pwsan.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).