Skip to contentSkip to conversation

OMAP2/3: PM sync-up

PATCH In review Kevin Hilman 5 participants 26 messages May 20, 2009 – May 28, 2009

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

v2 cover OMAP2/3: PM sync-up

This series is intended to push the core PM support from linux-omap into mainline.

Upon review/acceptance, Tony will merge into his for-next branch for the next merge window so all OMAP stuff can come from one place.

In addition to the linux-omap PM core sync, several OMAP3 init fixes are required to ensure that the chip can hit full-chip retention on idle and suspend.

Currently based on Tony's omap3-upstream branch. Compile tested on OMAP2, Boot tested on OMAP3430SDP and can hit full-chip retention in suspend and in idle.

Changes since v1:
- updated "push core PM" patch with review comments
- dropped all /sys/power/* knobs
- will use hlt_counter when it's exported to platform code
- dropped save/restore of abort mode regs in favor of cpu_init()
- MUSB idle patch fixed to work even when MUSB not enabled in Kconfig
- 2 new patches
- added UART-specific timeout feature under uart platform device. this replaces the need for /sys/power/clocks_off_while_idle
- revert of irq_chip->disable patch which is the wrong solution for the bug it was trying to fix

Jouni Hogander (2):
OMAP: Add new function to check wether there is irq pending
OMAP: UART: Add sysfs interface for adjusting UART sleep timeout

Kevin Hilman (10):
Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2" OMAP2/3: PM: push core PM code from linux-omap
OMAP3: PM: Force IVA2 into idle during bootup
OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X
OMAP3: PM: UART: disable clocks when idle and off-mode support
OMAP3: PM: Add D2D clocks and auto-idle setup to PRCM init
OMAP3: PM: D2D clockdomain supports SW supervised transitions
OMAP3: PM: Ensure PRCM interrupts are cleared at boot
OMAP3: PM: Clear pending PRCM reset flags on init
OMAP3: PM: prevent module wakeups from waking IVA2

Peter 'p2' De Schrijver (1):
OMAP3: PM: Ensure MUSB block can idle when driver not loaded

 arch/arm/mach-omap2/Makefile              |    5 +-
 arch/arm/mach-omap2/clock34xx.c           |    3 +
 arch/arm/mach-omap2/clock34xx.h           |   33 ++-
 arch/arm/mach-omap2/clockdomains.h        |    2 +-
 arch/arm/mach-omap2/cm-regbits-34xx.h     |   14 +
 arch/arm/mach-omap2/irq.c                 |   18 +-
 arch/arm/mach-omap2/pm-debug.c            |  152 ++++++
 arch/arm/mach-omap2/pm.c                  |  134 +++----
 arch/arm/mach-omap2/pm.h                  |   40 ++
 arch/arm/mach-omap2/pm24xx.c              |  549 ++++++++++++++++++++++
 arch/arm/mach-omap2/pm34xx.c              |  710 +++++++++++++++++++++++++++++
 arch/arm/mach-omap2/prcm-common.h         |    2 +
 arch/arm/mach-omap2/prm.h                 |    2 +
 arch/arm/mach-omap2/sdrc.c                |    5 +-
 arch/arm/mach-omap2/serial.c              |  437 +++++++++++++++++-
 arch/arm/mach-omap2/sleep24xx.S           |    1 -
 arch/arm/mach-omap2/sleep34xx.S           |  436 ++++++++++++++++++
 arch/arm/mach-omap2/usb-musb.c            |   21 +-
 arch/arm/plat-omap/Kconfig                |    2 +-
 arch/arm/plat-omap/common.c               |    1 -
 arch/arm/plat-omap/include/mach/common.h  |    2 -
 arch/arm/plat-omap/include/mach/control.h |   13 +
 arch/arm/plat-omap/include/mach/irqs.h    |    1 +
 arch/arm/plat-omap/include/mach/pm.h      |  345 --------------
 arch/arm/plat-omap/include/mach/serial.h  |    9 +
 arch/arm/plat-omap/include/mach/usb.h     |    6 -
 drivers/mtd/onenand/omap2.c               |    1 -
 27 files changed, 2475 insertions(+), 469 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pm-debug.c
 create mode 100644 arch/arm/mach-omap2/pm.h
 create mode 100644 arch/arm/mach-omap2/pm24xx.c
 create mode 100644 arch/arm/mach-omap2/pm34xx.c
 create mode 100644 arch/arm/mach-omap2/sleep34xx.S
 delete mode 100644 arch/arm/plat-omap/include/mach/pm.h
#1 lore raw

PATCH v2 1/13 Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2"

This reverts commit 5461af5af5c6a7fee78978aafe720541bf3a2f55.

Adding a disable hook to the irq_chip is not the way to fix the problem being addressed by this patch. Instead, we need to fix support for [enable|disable]_irq_wake().

---
 arch/arm/mach-omap2/irq.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/irq.c +0 -1
index 998c5c4..08a3b99 100644
@@ -134,7 +134,6 @@ static struct irq_chip omap_irq_chip = {
 	.ack	= omap_mask_ack_irq,
 	.mask	= omap_mask_irq,
 	.unmask	= omap_unmask_irq,
-	.disable = omap_mask_irq,
 };
 
 static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
Signature · 1 line
1.6.2.2
#2 lore raw

PATCH v2 2/13 OMAP2/3: PM: push core PM code from linux-omap

This patch is to sync the core linux-omap PM code with mainline. This code has evolved and been used for a while the linux-omap tree, but the attempt here is to finally get this into mainline.

Following this will be a series of patches from the 'PM branch' of the linux-omap tree to add full PM hardware support from the linux-omap tree.

Much of this PM core code was written by Jouni Hogander with significant contributions from Paul Walmsley as well as many others from Nokia, Texas Instruments and linux-omap community.

---
 arch/arm/mach-omap2/Makefile         |    3 +
 arch/arm/mach-omap2/pm-debug.c       |  152 +++++++++
 arch/arm/mach-omap2/pm.c             |  134 ++++-----
 arch/arm/mach-omap2/pm.h             |   40 +++
 arch/arm/mach-omap2/pm24xx.c         |  548 ++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/pm34xx.c         |  606 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/prcm-common.h    |    2 +
 arch/arm/mach-omap2/sdrc.c           |    5 +-
 arch/arm/mach-omap2/sleep24xx.S      |    1 -
 arch/arm/mach-omap2/sleep34xx.S      |  436 ++++++++++++++++++++++++
 arch/arm/mach-omap2/usb-musb.c       |    1 -
 arch/arm/plat-omap/Kconfig           |    2 +-
 arch/arm/plat-omap/common.c          |    1 -
 arch/arm/plat-omap/include/mach/pm.h |  345 -------------------
 drivers/mtd/onenand/omap2.c          |    1 -
 15 files changed, 1848 insertions(+), 429 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pm-debug.c
 create mode 100644 arch/arm/mach-omap2/pm.h
 create mode 100644 arch/arm/mach-omap2/pm24xx.c
 create mode 100644 arch/arm/mach-omap2/pm34xx.c
 create mode 100644 arch/arm/mach-omap2/sleep34xx.S
 delete mode 100644 arch/arm/plat-omap/include/mach/pm.h
arch/arm/mach-omap2/Makefile +3 -0
index dd1c0c5..c8f1505 100644
@@ -26,7 +26,10 @@ obj-$(CONFIG_ARCH_OMAP2)		+= sdrc2xxx.o
 # Power Management
 ifeq ($(CONFIG_PM),y)
 obj-y					+= pm.o
+obj-$(CONFIG_ARCH_OMAP2)		+= pm24xx.o
 obj-$(CONFIG_ARCH_OMAP24XX)		+= sleep24xx.o
+obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o
+obj-$(CONFIG_PM_DEBUG)			+= pm-debug.o
 endif
 
 # Clock framework
arch/arm/mach-omap2/pm-debug.c new file +152 -0

152 lines not on this page · raw message

arch/arm/mach-omap2/pm.c +56 -78

164 lines not on this page · raw message

arch/arm/mach-omap2/pm.h new file +40 -0
new file mode 100644
index 0000000..784027b
@@ -0,0 +1,40 @@
+/*
+ * OMAP2/3 Power Management Routines
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Jouni Hogander
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __ARCH_ARM_MACH_OMAP2_PM_H
+#define __ARCH_ARM_MACH_OMAP2_PM_H
+
+extern int omap2_pm_init(void);
+extern int omap3_pm_init(void);
+
+extern unsigned short enable_dyn_sleep;
+
+#ifdef CONFIG_PM_DEBUG
+extern void omap2_pm_dump(int mode, int resume, unsigned int us);
+extern int omap2_pm_debug;
+#else
+#define omap2_pm_dump(mode, resume, us)		do {} while (0);
+#define omap2_pm_debug				0
+#endif /* CONFIG_PM_DEBUG */
+
+extern void omap24xx_idle_loop_suspend(void);
+
+extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
+					void __iomem *sdrc_power);
+extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
+extern void save_secure_ram_context(u32 *addr);
+
+extern unsigned int omap24xx_idle_loop_suspend_sz;
+extern unsigned int omap34xx_suspend_sz;
+extern unsigned int save_secure_ram_context_sz;
+extern unsigned int omap24xx_cpu_suspend_sz;
+extern unsigned int omap34xx_cpu_suspend_sz;
+
+#endif
arch/arm/mach-omap2/pm24xx.c new file +548 -0

548 lines not on this page · raw message

arch/arm/mach-omap2/pm34xx.c new file +606 -0

606 lines not on this page · raw message

arch/arm/mach-omap2/prcm-common.h +2 -0
index 812d50e..cb1ae84 100644
@@ -276,6 +276,8 @@
 /* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
 #define OMAP3430_EN_GPIO1				(1 << 3)
 #define OMAP3430_EN_GPIO1_SHIFT				3
+#define OMAP3430_EN_GPT12				(1 << 1)
+#define OMAP3430_EN_GPT12_SHIFT				1
 #define OMAP3430_EN_GPT1				(1 << 0)
 #define OMAP3430_EN_GPT1_SHIFT				0
 
arch/arm/mach-omap2/sdrc.c +4 -1
index 2a30060..993fd25 100644
@@ -56,9 +56,12 @@ struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r)
 {
 	struct omap_sdrc_params *sp;
 
+	if (!sdrc_init_params)
+		return NULL;
+
 	sp = sdrc_init_params;
 
-	while (sp->rate != r)
+	while (sp->rate && sp->rate != r)
 		sp++;
 
 	if (!sp->rate)
arch/arm/mach-omap2/sleep24xx.S +0 -1
index bf9e961..130aadb 100644
@@ -28,7 +28,6 @@
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <mach/io.h>
-#include <mach/pm.h>
 
 #include <mach/omap24xx.h>
 
arch/arm/mach-omap2/sleep34xx.S new file +436 -0

436 lines not on this page · raw message

arch/arm/mach-omap2/usb-musb.c +0 -1
index 34a56a1..215d463 100644
@@ -28,7 +28,6 @@
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
-#include <mach/pm.h>
 #include <mach/mux.h>
 #include <mach/usb.h>
 
arch/arm/plat-omap/Kconfig +1 -1
index 9dd68fa..4bc9ed7 100644
@@ -171,7 +171,7 @@ endchoice
 
 config OMAP_SERIAL_WAKE
 	bool "Enable wake-up events for serial ports"
-	depends on OMAP_MUX
+	depends on ARCH_OMAP1 && OMAP_MUX
 	default y
 	help
 	  Select this option if you want to have your system wake up
arch/arm/plat-omap/common.c +0 -1
index 70b68ef..86ee23d 100644
@@ -11,7 +11,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
-#include <linux/pm.h>
 #include <linux/console.h>
 #include <linux/serial.h>
 #include <linux/tty.h>
arch/arm/plat-omap/include/mach/pm.h deleted +0 -345

345 lines not on this page · raw message

drivers/mtd/onenand/omap2.c +0 -1
index f2e9de1..6391e3d 100644
@@ -39,7 +39,6 @@
 #include <mach/gpmc.h>
 #include <mach/onenand.h>
 #include <mach/gpio.h>
-#include <mach/pm.h>
 
 #include <mach/dma.h>
 
Signature · 1 line
1.6.2.2
#3 lore raw

PATCH v2 3/13 OMAP: Add new function to check wether there is irq pending

From: Jouni Hogander <[email protected]>

Add common omap2/3 function to check wether there is irq pending. Switch to use it in omap2 pm code instead of its own.

---
 arch/arm/mach-omap2/irq.c              |   17 ++++++++++++++++-
 arch/arm/mach-omap2/pm24xx.c           |   19 +++----------------
 arch/arm/plat-omap/include/mach/irqs.h |    1 +
 3 files changed, 20 insertions(+), 17 deletions(-)
arch/arm/mach-omap2/irq.c +16 -1
index 08a3b99..b828638 100644
@@ -28,7 +28,6 @@
 #define INTC_MIR_CLEAR0		0x0088
 #define INTC_MIR_SET0		0x008c
 #define INTC_PENDING_IRQ0	0x0098
-
 /* Number of IRQ state bits in each MIR register */
 #define IRQ_BITS_PER_REG	32
 
@@ -156,6 +155,22 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
 	intc_bank_write_reg(1 << 0, bank, INTC_SYSCONFIG);
 }
 
+int omap_irq_pending(void)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(irq_banks); i++) {
+		struct omap_irq_bank *bank = irq_banks + i;
+		int irq;
+
+		for (irq = 0; irq < bank->nr_irqs; irq += 32)
+			if (intc_bank_read_reg(bank, INTC_PENDING_IRQ0 +
+					       ((irq >> 5) << 5)))
+				return 1;
+	}
+	return 0;
+}
+
 void __init omap_init_irq(void)
 {
 	unsigned long nr_of_irqs = 0;
arch/arm/mach-omap2/pm24xx.c +3 -16
index 384a5b5..3fa9c7c 100644
@@ -77,19 +77,6 @@ static int omap2_fclks_active(void)
 	return 0;
 }
 
-static int omap2_irq_pending(void)
-{
-	u32 pending_reg = 0x480fe098;
-	int i;
-
-	for (i = 0; i < 4; i++) {
-		if (omap_readl(pending_reg))
-			return 1;
-		pending_reg += 0x20;
-	}
-	return 0;
-}
-
 static void omap2_enter_full_retention(void)
 {
 	u32 l;
@@ -128,7 +115,7 @@ static void omap2_enter_full_retention(void)
 
 	/* One last check for pending IRQs to avoid extra latency due
 	 * to sleeping unnecessarily. */
-	if (omap2_irq_pending())
+	if (omap_irq_pending())
 		goto no_sleep;
 
 	/* Jump to SRAM suspend code */
@@ -265,13 +252,13 @@ static void omap2_pm_idle(void)
 	local_fiq_disable();
 
 	if (!omap2_can_sleep()) {
-		if (omap2_irq_pending())
+		if (omap_irq_pending())
 			goto out;
 		omap2_enter_mpu_retention();
 		goto out;
 	}
 
-	if (omap2_irq_pending())
+	if (omap_irq_pending())
 		goto out;
 
 	omap2_enter_full_retention();
arch/arm/plat-omap/include/mach/irqs.h +1 -0
index 7f57ee6..f5f7c92 100644
@@ -467,6 +467,7 @@
 
 #ifndef __ASSEMBLY__
 extern void omap_init_irq(void);
+extern int omap_irq_pending(void);
 #endif
 
 #include <mach/hardware.h>
Signature · 1 line
1.6.2.2
#4 lore raw

PATCH v2 4/13 OMAP3: PM: Force IVA2 into idle during bootup

---
 arch/arm/mach-omap2/pm34xx.c              |   50 +++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/control.h |    5 +++
 2 files changed, 55 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +50 -0
index 61ccaf3..2340869 100644
@@ -357,6 +357,54 @@ 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);
+
+	/* if no clock activity, nothing else to do */
+	if (!(cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSTST) &
+	      OMAP3430_CLKACTIVITY_IVA2_MASK))
+		return;
+
+	/* 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 */
@@ -516,6 +564,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, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
+
+	omap3_iva_idle();
 }
 
 static int __init pwrdms_setup(struct powerdomain *pwrdm)
arch/arm/plat-omap/include/mach/control.h +5 -0
index 269147f..d38697b 100644
@@ -189,6 +189,11 @@
 #define OMAP2_PBIASLITEPWRDNZ0		(1 << 1)
 #define OMAP2_PBIASLITEVMODE0		(1 << 0)
 
+/* 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);
Signature · 1 line
1.6.2.2
#5 lore raw

PATCH v2 5/13 OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X

---
 arch/arm/plat-omap/include/mach/control.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/plat-omap/include/mach/control.h +4 -0
index d38697b..a9f05e5 100644
@@ -194,6 +194,10 @@
 #define OMAP3_IVA2_BOOTMOD_MASK		(0xf << 0)
 #define OMAP3_IVA2_BOOTMOD_IDLE		(0x1 << 0)
 
+/* CONTROL_PADCONF_X bits */
+#define OMAP3_PADCONF_WAKEUPEVENT0	(1 << 15)
+#define OMAP3_PADCONF_WAKEUPENABLE0	(1 << 14)
+
 #ifndef __ASSEMBLY__
 #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
 extern void __iomem *omap_ctrl_base_get(void);
Signature · 1 line
1.6.2.2
#6 lore raw

PATCH v2 6/13 OMAP3: PM: UART: disable clocks when idle and off-mode support

This patch allows the UART clocks to be disabled when the OMAP UARTs are inactive, thus permitting the chip to hit retention in idle. After the timeout of an activity timer, each UART is allowed to disable its clocks so the system can enter retention. The activity timer is (re)activated on any UART interrupt, UART wake event or any IO pad wakeup. The actual disable of the UART clocks is done in the 'prepare_idle' hook called from the OMAP idle loop.

While the activity timer is active, the smart-idle mode of the UART is also disabled. This is due to a "feature" of the UART module that after a UART wakeup, the smart-idle mode may be entered before the UART has communicated the interrupt, or upon TX, an idle mode may be entered before the TX FIFOs are emptied.

Upon suspend, the 'prepare_suspend' hook cancels any pending activity timers and allows the clocks to be disabled.

In addition, upon disabling clocks the UART state is saved in case of an off-mode transition while clocks are off.

Special thanks to Tero Kristo for the initial ideas and first versions of UART idle support, and to Jouni Hogander for extra testing and bugfixes.

Tested on OMAP3 (Beagle, custom HW) and OMAP2 (n810)

Cc Tero Kristo <[email protected]>
Cc Jouni Hogander <[email protected]>
---
 arch/arm/mach-omap2/pm24xx.c             |   16 ++-
 arch/arm/mach-omap2/pm34xx.c             |   15 ++
 arch/arm/mach-omap2/serial.c             |  388 ++++++++++++++++++++++++++++--
 arch/arm/plat-omap/include/mach/common.h |    2 -
 arch/arm/plat-omap/include/mach/serial.h |    9 +
 5 files changed, 403 insertions(+), 27 deletions(-)
arch/arm/mach-omap2/pm24xx.c +15 -1
index 3fa9c7c..4ef8a0d 100644
@@ -72,6 +72,11 @@ static int omap2_fclks_active(void)
 
 	f1 = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
 	f2 = cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
+
+	/* Ignore UART clocks.  These are handled by UART core (serial.c) */
+	f1 &= ~(OMAP24XX_EN_UART1 | OMAP24XX_EN_UART2);
+	f2 &= ~OMAP24XX_EN_UART3;
+
 	if (f1 | f2)
 		return 1;
 	return 0;
@@ -118,12 +123,20 @@ static void omap2_enter_full_retention(void)
 	if (omap_irq_pending())
 		goto no_sleep;
 
+	omap_uart_prepare_idle(0);
+	omap_uart_prepare_idle(1);
+	omap_uart_prepare_idle(2);
+
 	/* Jump to SRAM suspend code */
 	omap2_sram_suspend(sdrc_read_reg(SDRC_DLLA_CTRL),
 			   OMAP_SDRC_REGADDR(SDRC_DLLA_CTRL),
 			   OMAP_SDRC_REGADDR(SDRC_POWER));
-no_sleep:
 
+	omap_uart_resume_idle(2);
+	omap_uart_resume_idle(1);
+	omap_uart_resume_idle(0);
+
+no_sleep:
 	if (omap2_pm_debug) {
 		unsigned long long tmp;
 
@@ -288,6 +301,7 @@ static int omap2_pm_suspend(void)
 	mir1 = omap_readl(0x480fe0a4);
 	omap_writel(1 << 5, 0x480fe0ac);
 
+	omap_uart_prepare_suspend();
 	omap2_enter_full_retention();
 
 	omap_writel(mir1, 0x480fe0a4);
arch/arm/mach-omap2/pm34xx.c +15 -0
index 2340869..6c91e43 100644
@@ -27,6 +27,7 @@
 #include <mach/clockdomain.h>
 #include <mach/powerdomain.h>
 #include <mach/control.h>
+#include <mach/serial.h>
 
 #include "cm.h"
 #include "cm-regbits-34xx.h"
@@ -170,10 +171,16 @@ static void omap_sram_idle(void)
 		return;
 	}
 	omap2_gpio_prepare_for_retention();
+	omap_uart_prepare_idle(0);
+	omap_uart_prepare_idle(1);
+	omap_uart_prepare_idle(2);
 
 	_omap_sram_idle(NULL, save_state);
 	cpu_init();
 
+	omap_uart_resume_idle(2);
+	omap_uart_resume_idle(1);
+	omap_uart_resume_idle(0);
 	omap2_gpio_resume_after_retention();
 }
 
@@ -206,6 +213,11 @@ static int omap3_fclks_active(void)
 				  CM_FCLKEN);
 	fck_per = cm_read_mod_reg(OMAP3430_PER_MOD,
 				  CM_FCLKEN);
+
+	/* Ignore UART clocks.  These are handled by UART core (serial.c) */
+	fck_core1 &= ~(OMAP3430_EN_UART1 | OMAP3430_EN_UART2);
+	fck_per &= ~OMAP3430_EN_UART3;
+
 	if (fck_core1 | fck_core3 | fck_sgx | fck_dss |
 	    fck_cam | fck_per | fck_usbhost)
 		return 1;
@@ -216,6 +228,8 @@ static int omap3_can_sleep(void)
 {
 	if (!enable_dyn_sleep)
 		return 0;
+	if (!omap_uart_can_sleep())
+		return 0;
 	if (omap3_fclks_active())
 		return 0;
 	return 1;
@@ -306,6 +320,7 @@ static int omap3_pm_suspend(void)
 			goto restore;
 	}
 
+	omap_uart_prepare_suspend();
 	omap_sram_idle();
 
 restore:
arch/arm/mach-omap2/serial.c +364 -24

437 lines not on this page · raw message

arch/arm/plat-omap/include/mach/common.h +0 -2
index 0ecf36d..834f0b3 100644
@@ -33,8 +33,6 @@ struct sys_timer;
 
 extern void omap_map_common_io(void);
 extern struct sys_timer omap_timer;
-extern void omap_serial_init(void);
-extern void omap_serial_enable_clocks(int enable);
 #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
 extern int omap_register_i2c_bus(int bus_id, u32 clkrate,
 				 struct i2c_board_info const *info,
arch/arm/plat-omap/include/mach/serial.h +9 -0
index 8a676a0..8e89585 100644
@@ -40,4 +40,13 @@
 			__ret;						\
 			})
 
+#ifndef __ASSEMBLER__
+extern void omap_serial_init(void);
+extern int omap_uart_can_sleep(void);
+extern void omap_uart_check_wakeup(void);
+extern void omap_uart_prepare_suspend(void);
+extern void omap_uart_prepare_idle(int num);
+extern void omap_uart_resume_idle(int num);
+#endif
+
 #endif
Signature · 1 line
1.6.2.2
#7 lore raw

PATCH v2 7/13 OMAP: UART: Add sysfs interface for adjusting UART sleep timeout

From: Jouni Hogander <[email protected]>

This patch makes it possible to change uart sleep timeout. New sysfs entry is added (/sys/devices/platform/serial8250.<uart>/sleep_timeout) Writing zero will disable the timeout feature and prevent UART clocks from being disabled.

Also default timeout is increased to 5 second to make serial console more usable.

Original patch was written by Tero Kristo.

---
 arch/arm/mach-omap2/serial.c |   55 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 51 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/serial.c +51 -4
index 50bff3d..854ac94 100644
@@ -30,7 +30,7 @@
 #include "pm.h"
 #include "prm-regbits-34xx.h"
 
-#define DEFAULT_TIMEOUT (2 * HZ)
+#define DEFAULT_TIMEOUT (5 * HZ)
 
 struct omap_uart_state {
 	int num;
@@ -233,7 +233,10 @@ static void omap_uart_block_sleep(struct omap_uart_state *uart)
 
 	omap_uart_smart_idle_enable(uart, 0);
 	uart->can_sleep = 0;
-	mod_timer(&uart->timer, jiffies + uart->timeout);
+	if (uart->timeout)
+		mod_timer(&uart->timer, jiffies + uart->timeout);
+	else
+		del_timer(&uart->timer);
 }
 
 static void omap_uart_allow_sleep(struct omap_uart_state *uart)
@@ -338,6 +341,8 @@ static irqreturn_t omap_uart_interrupt(int irq, void *dev_id)
 	return IRQ_NONE;
 }
 
+static u32 sleep_timeout = DEFAULT_TIMEOUT;
+
 static void omap_uart_idle_init(struct omap_uart_state *uart)
 {
 	u32 v;
@@ -345,7 +350,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
 	int ret;
 
 	uart->can_sleep = 0;
-	uart->timeout = DEFAULT_TIMEOUT;
+	uart->timeout = sleep_timeout;
 	setup_timer(&uart->timer, omap_uart_idle_timer,
 		    (unsigned long) uart);
 	mod_timer(&uart->timer, jiffies + uart->timeout);
@@ -425,6 +430,39 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
 	WARN_ON(ret);
 }
 
+static ssize_t sleep_timeout_show(struct kobject *kobj,
+				  struct kobj_attribute *attr,
+				  char *buf)
+{
+	return sprintf(buf, "%u\n", sleep_timeout / HZ);
+}
+
+static ssize_t sleep_timeout_store(struct kobject *kobj,
+				   struct kobj_attribute *attr,
+				   const char *buf, size_t n)
+{
+	struct omap_uart_state *uart;
+	unsigned int value;
+
+	if (sscanf(buf, "%u", &value) != 1) {
+		printk(KERN_ERR "sleep_timeout_store: Invalid value\n");
+		return -EINVAL;
+	}
+	sleep_timeout = value * HZ;
+	list_for_each_entry(uart, &uart_list, node) {
+		uart->timeout = sleep_timeout;
+		if (uart->timeout)
+			mod_timer(&uart->timer, jiffies + uart->timeout);
+		else
+			/* A zero value means disable timeout feature */
+			omap_uart_block_sleep(uart);
+	}
+	return n;
+}
+
+static struct kobj_attribute sleep_timeout_attr =
+	__ATTR(sleep_timeout, 0644, sleep_timeout_show, sleep_timeout_store);
+
 #else
 static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
 #endif /* CONFIG_PM */
@@ -494,6 +532,15 @@ static struct platform_device serial_device = {
 
 static int __init omap_init(void)
 {
-	return platform_device_register(&serial_device);
+	int ret;
+
+	ret = platform_device_register(&serial_device);
+
+#ifdef CONFIG_PM
+	if (!ret)
+		ret = sysfs_create_file(&serial_device.dev.kobj,
+					&sleep_timeout_attr.attr);
+#endif
+	return ret;
 }
 arch_initcall(omap_init);
Signature · 1 line
1.6.2.2
#8 lore raw

PATCH v2 8/13 OMAP3: PM: Add D2D clocks and auto-idle setup to PRCM init

Add D2D clocks (modem_fck, sad2d_ick, mad2d_ick) to clock framework and ensure that auto-idle bits are set for these clocks during PRCM init.

Also add omap3_d2d_idle() function called durint PRCM setup which ensures D2D pins are MUX'd correctly to enable retention for standalone (no-modem) devices.

---
 arch/arm/mach-omap2/clock34xx.c           |    3 ++
 arch/arm/mach-omap2/clock34xx.h           |   33 +++++++++++++++++++++++++++-
 arch/arm/mach-omap2/cm-regbits-34xx.h     |   14 ++++++++++++
 arch/arm/mach-omap2/pm34xx.c              |   25 ++++++++++++++++++++-
 arch/arm/plat-omap/include/mach/control.h |    4 +++
 5 files changed, 75 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/clock34xx.c +3 -0
index ba05aa4..13a36cf 100644
@@ -129,6 +129,9 @@ static struct omap_clk omap34xx_clks[] = {
 	CLK(NULL,	"sgx_fck",	&sgx_fck,	CK_3430ES2),
 	CLK(NULL,	"sgx_ick",	&sgx_ick,	CK_3430ES2),
 	CLK(NULL,	"d2d_26m_fck",	&d2d_26m_fck,	CK_3430ES1),
+	CLK(NULL,	"modem_fck",	&modem_fck,	CK_343X),
+	CLK(NULL,	"sad2d_ick",	&sad2d_ick,	CK_343X),
+	CLK(NULL,	"mad2d_ick",	&mad2d_ick,	CK_343X),
 	CLK(NULL,	"gpt10_fck",	&gpt10_fck,	CK_343X),
 	CLK(NULL,	"gpt11_fck",	&gpt11_fck,	CK_343X),
 	CLK(NULL,	"cpefuse_fck",	&cpefuse_fck,	CK_3430ES2),
arch/arm/mach-omap2/clock34xx.h +31 -2
index 496f0e9..e433aec 100644
@@ -1230,6 +1230,37 @@ static struct clk d2d_26m_fck = {
 	.recalc		= &followparent_recalc,
 };
 
+static struct clk modem_fck = {
+	.name		= "modem_fck",
+	.ops		= &clkops_omap2_dflt_wait,
+	.parent		= &sys_ck,
+	.init		= &omap2_init_clk_clkdm,
+	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+	.enable_bit	= OMAP3430_EN_MODEM_SHIFT,
+	.clkdm_name	= "d2d_clkdm",
+	.recalc		= &followparent_recalc,
+};
+
+static struct clk sad2d_ick = {
+	.name		= "sad2d_ick",
+	.ops		= &clkops_omap2_dflt_wait,
+	.parent		= &l3_ick,
+	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+	.enable_bit	= OMAP3430_EN_SAD2D_SHIFT,
+	.clkdm_name	= "d2d_clkdm",
+	.recalc		= &followparent_recalc,
+};
+
+static struct clk mad2d_ick = {
+	.name		= "mad2d_ick",
+	.ops		= &clkops_omap2_dflt_wait,
+	.parent		= &l3_ick,
+	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
+	.enable_bit	= OMAP3430_EN_MAD2D_SHIFT,
+	.clkdm_name	= "d2d_clkdm",
+	.recalc		= &followparent_recalc,
+};
+
 static const struct clksel omap343x_gpt_clksel[] = {
 	{ .parent = &omap_32k_fck, .rates = gpt_32k_rates },
 	{ .parent = &sys_ck,	   .rates = gpt_sys_rates },
@@ -1947,8 +1978,6 @@ static struct clk usb_l4_ick = {
 	.recalc		= &omap2_clksel_recalc,
 };
 
-/* XXX MDM_INTC_ICK, SAD2D_ICK ?? */
-
 /* SECURITY_L4_ICK2 based clocks */
 
 static struct clk security_l4_ick2 = {
arch/arm/mach-omap2/cm-regbits-34xx.h +14 -0
index 6f3f5a3..6923deb 100644
@@ -145,6 +145,8 @@
 #define OMAP3430_CLKACTIVITY_MPU_MASK			(1 << 0)
 
 /* CM_FCLKEN1_CORE specific bits */
+#define OMAP3430_EN_MODEM				(1 << 31)
+#define OMAP3430_EN_MODEM_SHIFT				31
 
 /* CM_ICLKEN1_CORE specific bits */
 #define OMAP3430_EN_ICR					(1 << 29)
@@ -161,6 +163,8 @@
 #define OMAP3430_EN_MAILBOXES_SHIFT			7
 #define OMAP3430_EN_OMAPCTRL				(1 << 6)
 #define OMAP3430_EN_OMAPCTRL_SHIFT			6
+#define OMAP3430_EN_SAD2D				(1 << 3)
+#define OMAP3430_EN_SAD2D_SHIFT				3
 #define OMAP3430_EN_SDRC				(1 << 1)
 #define OMAP3430_EN_SDRC_SHIFT				1
 
@@ -176,6 +180,10 @@
 #define OMAP3430_EN_DES1				(1 << 0)
 #define OMAP3430_EN_DES1_SHIFT				0
 
+/* CM_ICLKEN3_CORE */
+#define OMAP3430_EN_MAD2D_SHIFT				3
+#define OMAP3430_EN_MAD2D				(1 << 3)
+
 /* CM_FCLKEN3_CORE specific bits */
 #define OMAP3430ES2_EN_TS_SHIFT				1
 #define OMAP3430ES2_EN_TS_MASK				(1 << 1)
@@ -231,6 +239,8 @@
 #define OMAP3430ES2_ST_CPEFUSE_MASK			(1 << 0)
 
 /* CM_AUTOIDLE1_CORE */
+#define OMAP3430_AUTO_MODEM				(1 << 31)
+#define OMAP3430_AUTO_MODEM_SHIFT			31
 #define OMAP3430ES2_AUTO_MMC3				(1 << 30)
 #define OMAP3430ES2_AUTO_MMC3_SHIFT			30
 #define OMAP3430ES2_AUTO_ICR				(1 << 29)
@@ -287,6 +297,8 @@
 #define OMAP3430_AUTO_HSOTGUSB_SHIFT			4
 #define OMAP3430ES1_AUTO_D2D				(1 << 3)
 #define OMAP3430ES1_AUTO_D2D_SHIFT			3
+#define OMAP3430_AUTO_SAD2D				(1 << 3)
+#define OMAP3430_AUTO_SAD2D_SHIFT			3
 #define OMAP3430_AUTO_SSI				(1 << 0)
 #define OMAP3430_AUTO_SSI_SHIFT				0
 
@@ -308,6 +320,8 @@
 #define	OMAP3430ES2_AUTO_USBTLL				(1 << 2)
 #define OMAP3430ES2_AUTO_USBTLL_SHIFT			2
 #define OMAP3430ES2_AUTO_USBTLL_MASK			(1 << 2)
+#define OMAP3430_AUTO_MAD2D_SHIFT			3
+#define OMAP3430_AUTO_MAD2D				(1 << 3)
 
 /* CM_CLKSEL_CORE */
 #define OMAP3430_CLKSEL_SSI_SHIFT			8
arch/arm/mach-omap2/pm34xx.c +23 -2
index 6c91e43..d41e2c5 100644
@@ -420,14 +420,32 @@ static void __init omap3_iva_idle(void)
 			  OMAP3430_IVA2_MOD, RM_RSTCTRL);
 }
 
-static void __init prcm_setup_regs(void)
+static void __init omap3_d2d_idle(void)
 {
+	u16 mask, padconf;
+
+	/* In a stand alone OMAP3430 where there is not a stacked
+	 * modem for the D2D Idle Ack and D2D MStandby must be pulled
+	 * high. S CONTROL_PADCONF_SAD2D_IDLEACK and
+	 * CONTROL_PADCONF_SAD2D_MSTDBY to have a pull up. */
+	mask = (1 << 4) | (1 << 3); /* pull-up, enabled */
+	padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_MSTANDBY);
+	padconf |= mask;
+	omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_MSTANDBY);
+
+	padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_IDLEACK);
+	padconf |= mask;
+	omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK);
+
 	/* reset modem */
 	prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON |
 			  OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST,
 			  CORE_MOD, RM_RSTCTRL);
 	prm_write_mod_reg(0, CORE_MOD, RM_RSTCTRL);
+}
 
+static void __init prcm_setup_regs(void)
+{
 	/* XXX Reset all wkdeps. This should be done when initializing
 	 * powerdomains */
 	prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
@@ -447,6 +465,7 @@ static void __init prcm_setup_regs(void)
 	 * Note that in the long run this should be done by clockfw
 	 */
 	cm_write_mod_reg(
+		OMAP3430_AUTO_MODEM |
 		OMAP3430ES2_AUTO_MMC3 |
 		OMAP3430ES2_AUTO_ICR |
 		OMAP3430_AUTO_AES2 |
@@ -474,7 +493,7 @@ static void __init prcm_setup_regs(void)
 		OMAP3430_AUTO_OMAPCTRL |
 		OMAP3430ES1_AUTO_FSHOSTUSB |
 		OMAP3430_AUTO_HSOTGUSB |
-		OMAP3430ES1_AUTO_D2D | /* This is es1 only */
+		OMAP3430_AUTO_SAD2D |
 		OMAP3430_AUTO_SSI,
 		CORE_MOD, CM_AUTOIDLE1);
 
@@ -488,6 +507,7 @@ static void __init prcm_setup_regs(void)
 
 	if (omap_rev() > OMAP3430_REV_ES1_0) {
 		cm_write_mod_reg(
+			OMAP3430_AUTO_MAD2D |
 			OMAP3430ES2_AUTO_USBTLL,
 			CORE_MOD, CM_AUTOIDLE3);
 	}
@@ -581,6 +601,7 @@ static void __init prcm_setup_regs(void)
 			  OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
 
 	omap3_iva_idle();
+	omap3_d2d_idle();
 }
 
 static int __init pwrdms_setup(struct powerdomain *pwrdm)
arch/arm/plat-omap/include/mach/control.h +4 -0
index a9f05e5..fcc5a9b 100644
@@ -144,6 +144,10 @@
 #define OMAP343X_CONTROL_PBIAS_LITE	(OMAP2_CONTROL_GENERAL + 0x02b0)
 #define OMAP343X_CONTROL_TEMP_SENSOR	(OMAP2_CONTROL_GENERAL + 0x02b4)
 
+/* 34xx D2D idle-related pins, handled by PM core */
+#define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
+#define OMAP3_PADCONF_SAD2D_IDLEACK    0x254
+
 /*
  * REVISIT: This list of registers is not comprehensive - there are more
  * that should be added.
Signature · 1 line
1.6.2.2
#9 lore raw

PATCH v2 9/13 OMAP3: PM: D2D clockdomain supports SW supervised transitions

---
 arch/arm/mach-omap2/clockdomains.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/clockdomains.h +1 -1
index 281d5da..fe319ae 100644
@@ -195,7 +195,7 @@ static struct clockdomain sgx_clkdm = {
 static struct clockdomain d2d_clkdm = {
 	.name		= "d2d_clkdm",
 	.pwrdm		= { .name = "core_pwrdm" },
-	.flags		= CLKDM_CAN_HWSUP,
+	.flags		= CLKDM_CAN_HWSUP_SWSUP,
 	.clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
Signature · 1 line
1.6.2.2
#10 lore raw

PATCH v2 10/13 OMAP3: PM: Ensure MUSB block can idle when driver not loaded

From: Peter 'p2' De Schrijver <[email protected]>

Otherwise, bootloaders may leave MUSB in a state which prevents retention.

---
 arch/arm/mach-omap2/Makefile          |    2 --
 arch/arm/mach-omap2/usb-musb.c        |   20 ++++++++++++++++++++
 arch/arm/plat-omap/include/mach/usb.h |    6 ------
 3 files changed, 20 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/Makefile +0 -2
index c8f1505..201214f 100644
@@ -60,9 +60,7 @@ obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51.o \
 					   mmc-twl4030.o
 
 # Platform specific device init code
-ifeq ($(CONFIG_USB_MUSB_SOC),y)
 obj-y					+= usb-musb.o
-endif
 
 onenand-$(CONFIG_MTD_ONENAND_OMAP2)	:= gpmc-onenand.o
 obj-y					+= $(onenand-m) $(onenand-y)
arch/arm/mach-omap2/usb-musb.c +20 -0
index 215d463..d85296d 100644
@@ -31,6 +31,17 @@
 #include <mach/mux.h>
 #include <mach/usb.h>
 
+#define OTG_SYSCONFIG	(OMAP34XX_HSUSB_OTG_BASE + 0x404)
+
+static void __init usb_musb_pm_init(void)
+{
+	/* Ensure force-idle mode for OTG controller */
+	if (cpu_is_omap34xx())
+		omap_writel(0, OTG_SYSCONFIG);
+}
+
+#ifdef CONFIG_USB_MUSB_SOC
+
 static struct resource musb_resources[] = {
 	[0] = { /* start and end set dynamically */
 		.flags	= IORESOURCE_MEM,
@@ -183,4 +194,13 @@ void __init usb_musb_init(void)
 		printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
 		return;
 	}
+
+	usb_musb_pm_init();
+}
+
+#else
+void __init usb_musb_init(void)
+{
+	usb_musb_pm_init();
 }
+#endif /* CONFIG_USB_MUSB_SOC */
arch/arm/plat-omap/include/mach/usb.h +0 -6
index 69f0cee..f337e17 100644
@@ -27,13 +27,7 @@
 #define UDC_BASE			OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE			OMAP2_OHCI_BASE
 
-#ifdef CONFIG_USB_MUSB_SOC
 extern void usb_musb_init(void);
-#else
-static inline void usb_musb_init(void)
-{
-}
-#endif
 
 #endif
 
Signature · 1 line
1.6.2.2
#11 lore raw

PATCH v2 11/13 OMAP3: PM: Ensure PRCM interrupts are cleared at boot

---
 arch/arm/mach-omap2/pm34xx.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +3 -0
index d41e2c5..57d33f9 100644
@@ -600,6 +600,9 @@ static void __init prcm_setup_regs(void)
 	prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN,
 			  OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
 
+	/* Clear any pending PRCM interrupts */
+	prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
+
 	omap3_iva_idle();
 	omap3_d2d_idle();
 }
Signature · 1 line
1.6.2.2
#12 lore raw

PATCH v2 12/13 OMAP3: PM: Clear pending PRCM reset flags on init

---
 arch/arm/mach-omap2/pm34xx.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +9 -0
index 57d33f9..8442286 100644
@@ -600,6 +600,15 @@ static void __init prcm_setup_regs(void)
 	prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN,
 			  OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
 
+	/* Clear any pending 'reset' flags */
+	prm_write_mod_reg(0xffffffff, MPU_MOD, RM_RSTST);
+	prm_write_mod_reg(0xffffffff, CORE_MOD, RM_RSTST);
+	prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, RM_RSTST);
+	prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, RM_RSTST);
+	prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, RM_RSTST);
+	prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, RM_RSTST);
+	prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, RM_RSTST);
+
 	/* Clear any pending PRCM interrupts */
 	prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
 
Signature · 1 line
1.6.2.2
#13 lore raw

PATCH v2 13/13 OMAP3: PM: prevent module wakeups from waking IVA2

By default, prevent functional wakeups from inside a module from waking up the IVA2. Let DSP Bridge code handle this when loaded.

---
 arch/arm/mach-omap2/pm34xx.c |    6 ++++++
 arch/arm/mach-omap2/prm.h    |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +6 -0
index 8442286..deffafd 100644
@@ -600,6 +600,12 @@ static void __init prcm_setup_regs(void)
 	prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN,
 			  OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
 
+	/* Don't attach IVA interrupts */
+	prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
+	prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1);
+	prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
+	prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
+
 	/* Clear any pending 'reset' flags */
 	prm_write_mod_reg(0xffffffff, MPU_MOD, RM_RSTST);
 	prm_write_mod_reg(0xffffffff, CORE_MOD, RM_RSTST);
arch/arm/mach-omap2/prm.h +2 -0
index 7c8e0c4..9937e28 100644
@@ -203,9 +203,11 @@
 
 #define OMAP3430_PM_MPUGRPSEL				0x00a4
 #define OMAP3430_PM_MPUGRPSEL1				OMAP3430_PM_MPUGRPSEL
+#define OMAP3430ES2_PM_MPUGRPSEL3			0x00f8
 
 #define OMAP3430_PM_IVAGRPSEL				0x00a8
 #define OMAP3430_PM_IVAGRPSEL1				OMAP3430_PM_IVAGRPSEL
+#define OMAP3430ES2_PM_IVAGRPSEL3			0x00f4
 
 #define OMAP3430_PM_PREPWSTST				0x00e8
 
Signature · 1 line
1.6.2.2
#14 lore raw

Re: [PATCH 02/13] OMAP2/3: PM: push core PM code from linux-omap

In reply to Kevin Hilman
Quoted 3 lines · Kevin Hilman

This patch is to sync the core linux-omap PM code with mainline. This code has evolved and been used for a while the linux-omap tree, but the attempt here is to finally get this into mainline.

Hmm..

arch/arm/mach-omap2/pm.c line 75

Quoted 9 lines
arch/arm/mach-omap2/pm.c +7 -1
+static int __init omap_pm_init(void)
 {
-	return 0;
+	int error = -1;
+
+	if (cpu_is_omap24xx())
+		error = omap2_pm_init();
+	if (cpu_is_omap34xx())
+		error = omap3_pm_init();

Experience with PXA has shown that this tends to be the wrong way up of doing things. It seems to be much better to have the SoC specific code call the SoC generic code instead.

So, eg, omap2_pm_init() becomes:

static int omap2_pm_init(void)

{
	if (!cpu_is_omap24xx())
		return -ENODEV;

	... omap24xx initialisation ...

	return omap_pm_init();
}

late_initcall(omap2_pm_init);

(and, since this is always built-in, there's no point doing cleanup if omap_pm_init() fails - you're not going to be able to re-run that initialization again.)

#15 lore raw

Re: [PATCH 02/13] OMAP2/3: PM: push core PM code from linux-omap

Quoted 7 lines · Russell King - ARM Linux
Quoted 3 lines · Kevin Hilman

This patch is to sync the core linux-omap PM code with mainline. This code has evolved and been used for a while the linux-omap tree, but the attempt here is to finally get this into mainline.

Hmm..

Quoted 13 lines

arch/arm/mach-omap2/pm.c line 75

Quoted 9 lines
arch/arm/mach-omap2/pm.c +7 -1
+static int __init omap_pm_init(void)
 {
-	return 0;
+	int error = -1;
+
+	if (cpu_is_omap24xx())
+		error = omap2_pm_init();
+	if (cpu_is_omap34xx())
+		error = omap3_pm_init();

Experience with PXA has shown that this tends to be the wrong way up of doing things. It seems to be much better to have the SoC specific code call the SoC generic code instead.

OK.

Quoted 11 lines

So, eg, omap2_pm_init() becomes:

static int omap2_pm_init(void)

{
	if (!cpu_is_omap24xx())
		return -ENODEV;

	... omap24xx initialisation ...

	return omap_pm_init();
}
Quoted 5 lines

late_initcall(omap2_pm_init);

(and, since this is always built-in, there's no point doing cleanup if omap_pm_init() fails - you're not going to be able to re-run that initialization again.)

Sounds good, I'll make this change and upate the pm-upstream branch for Tony.

This will leave the common omap_pm_init() and pm.c basically empty, so I'll just remove them.

Kevin

#16 lore raw

Re: [PATCH 02/13] OMAP2/3: PM: push core PM code from linux-omap

Quoted 42 lines · Kevin Hilman
Quoted 7 lines · Russell King - ARM Linux
Quoted 3 lines · Kevin Hilman

This patch is to sync the core linux-omap PM code with mainline. This code has evolved and been used for a while the linux-omap tree, but the attempt here is to finally get this into mainline.

Hmm..

Quoted 13 lines

arch/arm/mach-omap2/pm.c line 75

Quoted 9 lines
arch/arm/mach-omap2/pm.c +7 -1
+static int __init omap_pm_init(void)
 {
-	return 0;
+	int error = -1;
+
+	if (cpu_is_omap24xx())
+		error = omap2_pm_init();
+	if (cpu_is_omap34xx())
+		error = omap3_pm_init();

Experience with PXA has shown that this tends to be the wrong way up of doing things. It seems to be much better to have the SoC specific code call the SoC generic code instead.

OK.

Quoted 11 lines

So, eg, omap2_pm_init() becomes:

static int omap2_pm_init(void)

{
	if (!cpu_is_omap24xx())
		return -ENODEV;

	... omap24xx initialisation ...

	return omap_pm_init();
}
Quoted 5 lines

late_initcall(omap2_pm_init);

(and, since this is always built-in, there's no point doing cleanup if omap_pm_init() fails - you're not going to be able to re-run that initialization again.)

Quoted 5 lines

Sounds good, I'll make this change and upate the pm-upstream branch for Tony.

This will leave the common omap_pm_init() and pm.c basically empty, so I'll just remove them.

OK, pushed an updated version of this patch into a new pm-upstream branch of my omap-pm tree[1]

Kevin

[1] http://git.kernel.org/?p=linux/kernel/git/khilman/linux-omap-pm.git

#17 lore raw

Re: [PATCH 01/13] Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2"

In reply to Kevin Hilman
Quoted 5 lines · Kevin Hilman

This reverts commit 5461af5af5c6a7fee78978aafe720541bf3a2f55.

Adding a disable hook to the irq_chip is not the way to fix the problem being addressed by this patch. Instead, we need to fix support for [enable|disable]_irq_wake().

Agree with you if we can use disable_irq_wake for MPU Interrupt with not masking the IRQ. Can you explain how we can fix support for disable_irq_wake() for omap_irq_chip?

Quoted 17 lines
---
 arch/arm/mach-omap2/irq.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/irq.c +0 -1
index 998c5c4..08a3b99 100644
@@ -134,7 +134,6 @@ static struct irq_chip omap_irq_chip = {
 	.ack	= omap_mask_ack_irq,
 	.mask	= omap_mask_irq,
 	.unmask	= omap_unmask_irq,
-	.disable = omap_mask_irq,
 };
 
 static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
#18 lore raw

Re: [PATCH 01/13] Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2"

Quoted 10 lines · Kim Kyuwon
Quoted 5 lines · Kevin Hilman

This reverts commit 5461af5af5c6a7fee78978aafe720541bf3a2f55.

Adding a disable hook to the irq_chip is not the way to fix the problem being addressed by this patch. Instead, we need to fix support for [enable|disable]_irq_wake().

Agree with you if we can use disable_irq_wake for MPU Interrupt with not masking the IRQ. Can you explain how we can fix support for disable_irq_wake() for omap_irq_chip?

Yes. The PRCM has a wake-enable per device bit that can be set (see PM_WKEN_<pwrdm>) to control device wakeup enables.

But the implemenation of that should not hold up this revert because this patch breaks *all* wakeups since the PRCM interrupt itself is disabled in the suspend path.

As a workaround for your USB problem that this patch was initially intended to fix you could manually disable USB OTG wakeups like this:

	wken = prm_read_mod_reg(CORE_MOD, PM_WKEN);
        wken &= ~OMAP3430_EN_HSOTGUSB; 
	prm_write_mod_reg(wken, CORE_MOD, PM_WKEN);

At least until the irq_wake stuff is fixed.

Kevin

#19 lore raw

Re: [PATCH 01/13] Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2"

Quoted 9 lines · Kevin Hilman
Quoted 7 lines · Kim Kyuwon
Quoted 5 lines · Kevin Hilman

This reverts commit 5461af5af5c6a7fee78978aafe720541bf3a2f55.

Adding a disable hook to the irq_chip is not the way to fix the problem being addressed by this patch.  Instead, we need to fix support for [enable|disable]_irq_wake().

Quoted 6 lines
Quoted 3 lines

Agree with you if we can use disable_irq_wake for MPU Interrupt with not masking the IRQ. Can you explain how we can fix support for disable_irq_wake() for omap_irq_chip?

Yes.  The PRCM has a wake-enable per device bit that can be set (see PM_WKEN_<pwrdm>) to control device wakeup enables.

PM_WKEN_<pwrdm> is not entirely matched to each MPU interrupt. If you want to use disable_irq_wake() with enabling PRCM_Interrupt, you should disable all PM_WKEN_<pwrdm> bits.
And how can you make support of disable_irq_wake() for other MPU interrupts?

Quoted 3 lines

But the implemenation of that should not hold up this revert because this patch breaks *all* wakeups since the PRCM interrupt itself is disabled in the suspend path.

Yes, I saw the same problem. This is caused by resume_device_irqs() recently added by Rafael not by my patch. I'm asking him that he made a right decision.

Quoted 6 lines

As a workaround for your USB problem that this patch was initially intended to fix you could manually disable USB OTG wakeups like this:

       wken = prm_read_mod_reg(CORE_MOD, PM_WKEN); wken &= ~OMAP3430_EN_HSOTGUSB; prm_write_mod_reg(wken, CORE_MOD, PM_WKEN);

Did you checked this masking prevent waking up from the interrupt of USB HOST?

Regards,
Kyuwon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#20 lore raw

Re: [PATCH 01/13] Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2"

Quoted 11 lines · Kim Kyuwon
Quoted 9 lines · Kevin Hilman
Quoted 7 lines · Kim Kyuwon
Quoted 5 lines · Kevin Hilman

This reverts commit 5461af5af5c6a7fee78978aafe720541bf3a2f55.

Adding a disable hook to the irq_chip is not the way to fix the problem being addressed by this patch.  Instead, we need to fix support for [enable|disable]_irq_wake().

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Agree with you if we can use disable_irq_wake for MPU Interrupt with not masking the IRQ. Can you explain how we can fix support for disable_irq_wake() for omap_irq_chip?

Yes.  The PRCM has a wake-enable per device bit that can be set (see PM_WKEN_<pwrdm>) to control device wakeup enables.

PM_WKEN_<pwrdm> is not entirely matched to each MPU interrupt.

Correct. This bit disables the module from generating any wakeup event to the PRCM.

Quoted 3 lines

If you want to use disable_irq_wake() with enabling PRCM_Interrupt, you should disable all PM_WKEN_<pwrdm> bits.
And how can you make support of disable_irq_wake() for other MPU interrupts?

To control the ability of a module to wake the MPU directly, we would need to use the PM_MPUGRPSEL_<pwrdm> regs.

Quoted 6 lines
Quoted 3 lines

But the implemenation of that should not hold up this revert because this patch breaks *all* wakeups since the PRCM interrupt itself is disabled in the suspend path.

Yes, I saw the same problem. This is caused by resume_device_irqs() recently added by Rafael not by my patch.

The point is, with your patch applied, *all* OMAP wakeups are broken upstream.

You're right, your patch didn't cause the broken wakeup problem by itself, but your patch on top of Rafael's in combination with the new lazy-disable support which are both already in mainline breaks *all* OMAP wakeup capabilities. Therefore it should be reverted and the OMAP specific IRQ wake support fixed.

I am working on fixing the OMAP IRQ wake support, but I do not want that to hold up this series getting upstream.

Quoted 1 line

I'm asking him that he made a right decision.

Yes, we had a long discussion on that on linux-pm and I came to the conclusion that while his change was probably premature, it's the right decision and platforms with wakeup capabilities should use/fix their set_irq_wakeup() functionality.

Quoted 8 lines
Quoted 6 lines

As a workaround for your USB problem that this patch was initially intended to fix you could manually disable USB OTG wakeups like this:

       wken = prm_read_mod_reg(CORE_MOD, PM_WKEN); wken &= ~OMAP3430_EN_HSOTGUSB; prm_write_mod_reg(wken, CORE_MOD, PM_WKEN);

Did you checked this masking prevent waking up from the interrupt of USB HOST?

No I did not test, nor was I able to reproduce your original problem since the description wasn't that clear to me.

This will disable the USB OTG controller module from generating wakeups for any reason. If disabling the device wakeup in PM_WKEN is still resutling in interrupts, then the powerdomain with that device is most likely not in retention/off.

I do know that disabling PM_WKEN for UARTs in the same powerdomain as USB OTG (CORE) will stop the UART from waking, and thus from generating interrupts, as long as the powerdomain has actually transitioned to retention/off.

Re: USB HOST. The problem you reported in your original patch was that you were waking from IRQ 92, which is the USB OTG interrupt. If your problem is with USBHOST, that is in a different powerdomain.

Kevin

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#21 lore raw

Re: [PATCH 01/13] Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2"

Quoted 25 lines · Kevin Hilman
Quoted 11 lines · Kim Kyuwon
Quoted 9 lines · Kevin Hilman
Quoted 7 lines · Kim Kyuwon
Quoted 5 lines · Kevin Hilman

This reverts commit 5461af5af5c6a7fee78978aafe720541bf3a2f55.

Adding a disable hook to the irq_chip is not the way to fix the problem being addressed by this patch.  Instead, we need to fix support for [enable|disable]_irq_wake().

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Agree with you if we can use disable_irq_wake for MPU Interrupt with not masking the IRQ. Can you explain how we can fix support for disable_irq_wake() for omap_irq_chip?

Yes.  The PRCM has a wake-enable per device bit that can be set (see PM_WKEN_<pwrdm>) to control device wakeup enables.

PM_WKEN_<pwrdm> is not entirely matched to each MPU interrupt.

Correct.  This bit disables the module from generating any wakeup event to the PRCM.

Quoted 6 lines
Quoted 3 lines

If you want to use disable_irq_wake() with enabling PRCM_Interrupt, you should disable all PM_WKEN_<pwrdm> bits.
And how can you make support of disable_irq_wake() for other MPU interrupts?

To control the ability of a module to wake the MPU directly, we would need to use the PM_MPUGRPSEL_<pwrdm> regs.

Sorry but I can't believe until it is implemented in OMAP and I can confirm it.

Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

But the implemenation of that should not hold up this revert because this patch breaks *all* wakeups since the PRCM interrupt itself is disabled in the suspend path.

Yes, I saw the same problem. This is caused by resume_device_irqs() recently added by Rafael not by my patch.

The point is, with your patch applied, *all* OMAP wakeups are broken upstream.

Quoted 8 lines

You're right, your patch didn't cause the broken wakeup problem by itself, but your patch on top of Rafael's in combination with the new lazy-disable support which are both already in mainline breaks *all* OMAP wakeup capabilities.  Therefore it should be reverted and the OMAP specific IRQ wake support fixed.

I am working on fixing the OMAP IRQ wake support, but I do not want that to hold up this series getting upstream.

However, we don't know yet OMAP IRQ wake support is well implemented or not.

Quoted 6 lines
Quoted 1 line

I'm asking him that he made a right decision.

Yes, we had a long discussion on that on linux-pm and I came to the conclusion that while his change was probably premature, it's the right decision and platforms with wakeup capabilities should use/fix their set_irq_wakeup() functionality.

I know... I jumped into that discussion. But you insisted as following... --

Quoted 4 lines

Interrupt wakeups can be disabled at the PRCM level. Or more simply we can keep a mask of wakeup-enable interrupts and use that.

I will experiment with getting disable_irq_wake() working.

--
So I quited. But I think we should have this discussion again.

Quoted 17 lines
Quoted 8 lines
Quoted 6 lines

As a workaround for your USB problem that this patch was initially intended to fix you could manually disable USB OTG wakeups like this:

       wken = prm_read_mod_reg(CORE_MOD, PM_WKEN); wken &= ~OMAP3430_EN_HSOTGUSB; prm_write_mod_reg(wken, CORE_MOD, PM_WKEN);

Did you checked this masking prevent waking up from the interrupt of USB HOST?

No I did not test, nor was I able to reproduce your original problem since the description wasn't that clear to me.

This will disable the USB OTG controller module from generating wakeups for any reason.  If disabling the device wakeup in PM_WKEN is still resutling in interrupts, then the powerdomain with that device is most likely not in retention/off.

Quoted 8 lines

I do know that disabling PM_WKEN for UARTs in the same powerdomain as USB OTG (CORE) will stop the UART from waking, and thus from generating interrupts, as long as the powerdomain has actually transitioned to retention/off.

Re: USB HOST.  The problem you reported in your original patch was that you were waking from IRQ 92, which is the USB OTG interrupt.  If your problem is with USBHOST, that is in a different powerdomain.

OK I will check it when I'm in my office. Now it's great weekend. Have a good weekend!.

Regards,
Kyuwon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#22 lore raw

Re: [PATCH 01/13] Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2"

In reply to Kevin Hilman
Quoted 25 lines · Kevin Hilman
Quoted 11 lines · Kim Kyuwon
Quoted 9 lines · Kevin Hilman
Quoted 7 lines · Kim Kyuwon
Quoted 5 lines · Kevin Hilman

This reverts commit 5461af5af5c6a7fee78978aafe720541bf3a2f55.

Adding a disable hook to the irq_chip is not the way to fix the problem being addressed by this patch.  Instead, we need to fix support for [enable|disable]_irq_wake().

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Agree with you if we can use disable_irq_wake for MPU Interrupt with not masking the IRQ. Can you explain how we can fix support for disable_irq_wake() for omap_irq_chip?

Yes.  The PRCM has a wake-enable per device bit that can be set (see PM_WKEN_<pwrdm>) to control device wakeup enables.

PM_WKEN_<pwrdm> is not entirely matched to each MPU interrupt.

Correct.  This bit disables the module from generating any wakeup event to the PRCM.

Quoted 6 lines
Quoted 3 lines

If you want to use disable_irq_wake() with enabling PRCM_Interrupt, you should disable all PM_WKEN_<pwrdm> bits.
And how can you make support of disable_irq_wake() for other MPU interrupts?

To control the ability of a module to wake the MPU directly, we would need to use the PM_MPUGRPSEL_<pwrdm> regs.

PM_MPUGRPSEL_<pwrdm> regs can't disable irq wakeup, it is just related wake-up dependencies.
I tested with this code:

prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_MPUGRPSEL); prm_write_mod_reg(0, MPU_MOD, OMAP3430_PM_MPUGRPSEL); prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_MPUGRPSEL); prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);

But USB interrupt have continuously woken up the system.
I checked with my omap wakeup source driver and wake-up source was shown below

# cat /sys/power/omap_resume_irq
92
Quoted 19 lines
Quoted 6 lines
Quoted 3 lines

But the implemenation of that should not hold up this revert because this patch breaks *all* wakeups since the PRCM interrupt itself is disabled in the suspend path.

Yes, I saw the same problem. This is caused by resume_device_irqs() recently added by Rafael not by my patch.

The point is, with your patch applied, *all* OMAP wakeups are broken upstream.

You're right, your patch didn't cause the broken wakeup problem by itself, but your patch on top of Rafael's in combination with the new lazy-disable support which are both already in mainline breaks *all* OMAP wakeup capabilities.  Therefore it should be reverted and the OMAP specific IRQ wake support fixed.

I am working on fixing the OMAP IRQ wake support, but I do not want that to hold up this series getting upstream.

Quoted 13 lines
Quoted 1 line

I'm asking him that he made a right decision.

Yes, we had a long discussion on that on linux-pm and I came to the conclusion that while his change was probably premature, it's the right decision and platforms with wakeup capabilities should use/fix their set_irq_wakeup() functionality.

Quoted 6 lines
Quoted 6 lines

As a workaround for your USB problem that this patch was initially intended to fix you could manually disable USB OTG wakeups like this:

       wken = prm_read_mod_reg(CORE_MOD, PM_WKEN); wken &= ~OMAP3430_EN_HSOTGUSB; prm_write_mod_reg(wken, CORE_MOD, PM_WKEN);

I also confirmed this code can't help disabling interrupt wakeup.

Quoted 15 lines
Quoted 1 line

Did you checked this masking prevent waking up from the interrupt of USB HOST?

No I did not test, nor was I able to reproduce your original problem since the description wasn't that clear to me.

This will disable the USB OTG controller module from generating wakeups for any reason.  If disabling the device wakeup in PM_WKEN is still resutling in interrupts, then the powerdomain with that device is most likely not in retention/off.

I do know that disabling PM_WKEN for UARTs in the same powerdomain as USB OTG (CORE) will stop the UART from waking, and thus from generating interrupts, as long as the powerdomain has actually transitioned to retention/off.

Quoted 7 lines

Re: USB HOST.  The problem you reported in your original patch was that you were waking from IRQ 92, which is the USB OTG interrupt.  If your problem is with USBHOST, that is in a different powerdomain.

Kevin

Kevin,

I'm terribly sorry to hold up your work. I will not disturb you anymore in relation to this revert patch. However, please keep in mind that adding a disable hook to the irq_chip was the best way to fix the problem addressed by my original patch.

Regards,
Kyuwon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#23 lore raw

Re: [PATCH 01/13] Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2"

In reply to Kevin Hilman
Quoted 3 lines · Kevin Hilman

But the implemenation of that should not hold up this revert because this patch breaks *all* wakeups since the PRCM interrupt itself is disabled in the suspend path.

That is not mentioned in the patch description (and it should be). What this paragraph is saying is that this revert is most definitely fixing a regression.

Any "fix" which causes other breakage is not a fix, and therefore this revert needs to go in no matter what.

#24 lore raw

Re: [PATCH 01/13] Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2"

Quoted 11 lines · Russell King - ARM Linux
Quoted 3 lines · Kevin Hilman

But the implemenation of that should not hold up this revert because this patch breaks *all* wakeups since the PRCM interrupt itself is disabled in the suspend path.

That is not mentioned in the patch description (and it should be). What this paragraph is saying is that this revert is most definitely fixing a regression.

Any "fix" which causes other breakage is not a fix, and therefore this revert needs to go in no matter what.

The problem is that this patch(which is written by me) was merged much earlier than Rafael's patch. So I think Rafael's patch causes other breakage.

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Kyuwon (규원)
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#25 lore raw
In reply to Kevin Hilman
Quoted 6 lines · Kevin Hilman

This series is intended to push the core PM support from linux-omap into mainline.

Upon review/acceptance, Tony will merge into his for-next branch for the next merge window so all OMAP stuff can come from one place.

Quoted 7 lines

In addition to the linux-omap PM core sync, several OMAP3 init fixes are required to ensure that the chip can hit full-chip retention on idle and suspend.

Currently based on Tony's omap3-upstream branch. Compile tested on OMAP2, Boot tested on OMAP3430SDP and can hit full-chip retention in suspend and in idle.

I've pulled these to omap for-next branch.

Tony

Quoted 70 lines

Changes since v1:
- updated "push core PM" patch with review comments
- dropped all /sys/power/* knobs
- will use hlt_counter when it's exported to platform code
- dropped save/restore of abort mode regs in favor of cpu_init()
- MUSB idle patch fixed to work even when MUSB not enabled in Kconfig
- 2 new patches
- added UART-specific timeout feature under uart platform device. this replaces the need for /sys/power/clocks_off_while_idle
- revert of irq_chip->disable patch which is the wrong solution for the bug it was trying to fix

Jouni Hogander (2):
OMAP: Add new function to check wether there is irq pending
OMAP: UART: Add sysfs interface for adjusting UART sleep timeout

Kevin Hilman (10):
Revert "ARM: OMAP: Mask interrupts when disabling interrupts, v2" OMAP2/3: PM: push core PM code from linux-omap
OMAP3: PM: Force IVA2 into idle during bootup
OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X
OMAP3: PM: UART: disable clocks when idle and off-mode support
OMAP3: PM: Add D2D clocks and auto-idle setup to PRCM init
OMAP3: PM: D2D clockdomain supports SW supervised transitions
OMAP3: PM: Ensure PRCM interrupts are cleared at boot
OMAP3: PM: Clear pending PRCM reset flags on init
OMAP3: PM: prevent module wakeups from waking IVA2

Peter 'p2' De Schrijver (1):
OMAP3: PM: Ensure MUSB block can idle when driver not loaded

 arch/arm/mach-omap2/Makefile              |    5 +-
 arch/arm/mach-omap2/clock34xx.c           |    3 +
 arch/arm/mach-omap2/clock34xx.h           |   33 ++-
 arch/arm/mach-omap2/clockdomains.h        |    2 +-
 arch/arm/mach-omap2/cm-regbits-34xx.h     |   14 +
 arch/arm/mach-omap2/irq.c                 |   18 +-
 arch/arm/mach-omap2/pm-debug.c            |  152 ++++++
 arch/arm/mach-omap2/pm.c                  |  134 +++----
 arch/arm/mach-omap2/pm.h                  |   40 ++
 arch/arm/mach-omap2/pm24xx.c              |  549 ++++++++++++++++++++++
 arch/arm/mach-omap2/pm34xx.c              |  710 +++++++++++++++++++++++++++++
 arch/arm/mach-omap2/prcm-common.h         |    2 +
 arch/arm/mach-omap2/prm.h                 |    2 +
 arch/arm/mach-omap2/sdrc.c                |    5 +-
 arch/arm/mach-omap2/serial.c              |  437 +++++++++++++++++-
 arch/arm/mach-omap2/sleep24xx.S           |    1 -
 arch/arm/mach-omap2/sleep34xx.S           |  436 ++++++++++++++++++
 arch/arm/mach-omap2/usb-musb.c            |   21 +-
 arch/arm/plat-omap/Kconfig                |    2 +-
 arch/arm/plat-omap/common.c               |    1 -
 arch/arm/plat-omap/include/mach/common.h  |    2 -
 arch/arm/plat-omap/include/mach/control.h |   13 +
 arch/arm/plat-omap/include/mach/irqs.h    |    1 +
 arch/arm/plat-omap/include/mach/pm.h      |  345 --------------
 arch/arm/plat-omap/include/mach/serial.h  |    9 +
 arch/arm/plat-omap/include/mach/usb.h     |    6 -
 drivers/mtd/onenand/omap2.c               |    1 -
 27 files changed, 2475 insertions(+), 469 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pm-debug.c
 create mode 100644 arch/arm/mach-omap2/pm.h
 create mode 100644 arch/arm/mach-omap2/pm24xx.c
 create mode 100644 arch/arm/mach-omap2/pm34xx.c
 create mode 100644 arch/arm/mach-omap2/sleep34xx.S
 delete mode 100644 arch/arm/plat-omap/include/mach/pm.h

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html