All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: linux-omap@vger.kernel.org
Subject: [PATCH 09/21] OMAP3: PM: Force IVA2 into idle during bootup
Date: Wed,  4 Feb 2009 18:05:55 -0800	[thread overview]
Message-ID: <1233799567-22250-10-git-send-email-khilman@deeprootsystems.com> (raw)
In-Reply-To: <1233799567-22250-9-git-send-email-khilman@deeprootsystems.com>

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/pm34xx.c              |   45 +++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/control.h |    5 +++
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 1c6819e..dc27599 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -383,6 +383,49 @@ static struct platform_suspend_ops omap_pm_ops = {
 	.valid		= suspend_valid_only_mem,
 };
 
+
+/**
+ * omap3_iva_idle(): ensure IVA is in idle so it can be put into
+ *                   retention
+ *
+ * In cases where IVA2 is activated by bootcode, it may prevent
+ * full-chip retention or off-mode because it is not idle.  This
+ * function forces the IVA2 into idle state so it can go
+ * into retention/off and thus allow full-chip retention/off.
+ *
+ **/
+static void __init omap3_iva_idle(void)
+{
+	/* ensure IVA2 clock is disabled */
+	cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN);
+
+	/* Reset IVA2 */
+	prm_write_mod_reg(OMAP3430_RST1_IVA2 |
+			  OMAP3430_RST2_IVA2 |
+			  OMAP3430_RST3_IVA2,
+			  OMAP3430_IVA2_MOD, RM_RSTCTRL);
+
+	/* Enable IVA2 clock */
+	cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2,
+			 OMAP3430_IVA2_MOD, CM_FCLKEN);
+
+	/* Set IVA2 boot mode to 'idle' */
+	omap_ctrl_writel(OMAP3_IVA2_BOOTMOD_IDLE,
+			 OMAP343X_CONTROL_IVA2_BOOTMOD);
+
+	/* Un-reset IVA2 */
+	prm_write_mod_reg(0, OMAP3430_IVA2_MOD, RM_RSTCTRL);
+
+	/* Disable IVA2 clock */
+	cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN);
+
+	/* Reset IVA2 */
+	prm_write_mod_reg(OMAP3430_RST1_IVA2 |
+			  OMAP3430_RST2_IVA2 |
+			  OMAP3430_RST3_IVA2,
+			  OMAP3430_IVA2_MOD, RM_RSTCTRL);
+}
+
 static void __init prcm_setup_regs(void)
 {
 	/* reset modem */
@@ -542,6 +585,8 @@ static void __init prcm_setup_regs(void)
 	 * it is selected to mpu wakeup goup */
 	prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN,
 			  OCP_MOD, OMAP3430_PRM_IRQENABLE_MPU_OFFSET);
+
+	omap3_iva_idle();
 }
 
 static int __init pwrdms_setup(struct powerdomain *pwrdm)
diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h
index 0c9b197..9052a0a 100644
--- a/arch/arm/plat-omap/include/mach/control.h
+++ b/arch/arm/plat-omap/include/mach/control.h
@@ -211,6 +211,11 @@
 #define OMAP3_PADCONF_WAKEUPEVENT0	(1 << 15)
 #define OMAP3_PADCONF_WAKEUPENABLE0	(1 << 14)
 
+/* CONTROL_IVA2_BOOTMOD bits */
+#define OMAP3_IVA2_BOOTMOD_SHIFT	0
+#define OMAP3_IVA2_BOOTMOD_MASK		(0xf << 0)
+#define OMAP3_IVA2_BOOTMOD_IDLE		(0x1 << 0)
+
 #ifndef __ASSEMBLY__
 #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
 extern void __iomem *omap_ctrl_base_get(void);
-- 
1.6.1


  reply	other threads:[~2009-02-05  2:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05  2:05 [PATCH 00/21] OMAP: update PM infrastructure Kevin Hilman
2009-02-05  2:05 ` [PATCH 01/21] OMAP2/3: PM: push core PM code from linux-omap Kevin Hilman
2009-02-05  2:05   ` [PATCH 02/21] OMAP: Add new function to check wether there is irq pending Kevin Hilman
2009-02-05  2:05     ` [PATCH 03/21] OMAP3: PM: SmartReflex driver integration Kevin Hilman
2009-02-05  2:05       ` [PATCH 04/21] OMAP: Kconfig: move GP timer selection alongside other timer options Kevin Hilman
2009-02-05  2:05         ` [PATCH 05/21] OMAP: dmtimer: enable all timers to be wakeup events Kevin Hilman
2009-02-05  2:05           ` [PATCH 06/21] OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X Kevin Hilman
2009-02-05  2:05             ` [PATCH 07/21] OMAP3: PM: UART: disable clocks when idle and off-mode support Kevin Hilman
2009-02-05  2:05               ` [PATCH 08/21] OMAP: UART: Add sysfs interface for adjusting UART sleep timeout Kevin Hilman
2009-02-05  2:05                 ` Kevin Hilman [this message]
2009-02-05  2:05                   ` [PATCH 10/21] OMAP3: PM: Add D2D clocks and auto-idle setup to PRCM init Kevin Hilman
2009-02-05  2:05                     ` [PATCH 11/21] OMAP3: PM: D2D clockdomain supports SW supervised transitions Kevin Hilman
2009-02-05  2:05                       ` [PATCH 12/21] OMAP: PM counter infrastructure Kevin Hilman
2009-02-05  2:05                         ` [PATCH 13/21] OMAP: PM: Hook into PM counters Kevin Hilman
2009-02-05  2:06                           ` [PATCH 14/21] OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each Kevin Hilman
2009-02-05  2:06                             ` [PATCH 15/21] OMAP: PM: Add pm-debug counters Kevin Hilman
2009-02-05  2:06                               ` [PATCH 16/21] OMAP: PM debug: make powerdomains use PM-debug counters Kevin Hilman
2009-02-05  2:06                                 ` [PATCH 17/21] OMAP: PM debug: do not print out status for meta powerdomains (dpll*) Kevin Hilman
2009-02-05  2:06                                   ` [PATCH 18/21] OMAP: PM debug: Add PRCM register dump support Kevin Hilman
2009-02-05  2:06                                     ` [PATCH 19/21] OMAP: PM: Add definitions for ETK pads and observability registers Kevin Hilman
2009-02-05  2:06                                       ` [PATCH 20/21] OMAP: Debug observability and ETK padconf implementation Kevin Hilman
2009-02-05  2:06                                         ` [PATCH 21/21] OMAP: Add debug observablity (debobs) Kconfig item Kevin Hilman

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=1233799567-22250-10-git-send-email-khilman@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.