All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: Kevin Hilman <khilman@deeprootsystems.com>,
	Tero Kristo <t-kristo@ti.com>
Cc: linux-omap@vger.kernel.org, b-cousson@ti.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv4 8/8] ARM: OMAP3: do not delete per_clkdm autodeps during idle
Date: Tue, 16 Oct 2012 07:29:21 +0000 (UTC)	[thread overview]
Message-ID: <alpine.DEB.2.00.1210160603390.9767@utopia.booyaka.com> (raw)
In-Reply-To: <87k3vpek28.fsf@deeprootsystems.com>


Hi Kevin,

Here's an updated version of this one, with the erratum coverage expanded 
to include OMAP34xx/35xx.

I think this one can replace Tero's "[PATCHv6 06/11] ARM: OMAP: 
clockdomain: add support for preventing autodep delete" and "[PATCHv6 
07/11] ARM: OMAP3: do not delete per_clkdm autodeps during idle".  Tero, 
please let us know if you feel otherwise.

The patch seems to pass testing on 37xx.  Was not able to really test it 
on 35xx due to PM regressions in v3.7-rc1.


- Paul

From: Paul Walmsley <paul@pwsan.com>
Date: Tue, 16 Oct 2012 00:08:53 -0600
Subject: [PATCH] ARM: OMAP3: PM: apply part of the erratum i582 workaround

On OMAP34xx/35xx, and OMAP36xx chips with ES < 1.2, if the PER
powerdomain goes to OSWR or OFF while CORE stays at CSWR or ON, or if,
upon chip wakeup from OSWR or OFF, the CORE powerdomain goes ON before
PER, the UART3/4 FIFOs and McBSP2/3 SIDETONE memories will be
unusable.  This is erratum i582 in the OMAP36xx Silicon Errata
document.

This patch implements one of several parts of the workaround: the
addition of the wakeup dependency between the PER and WKUP
clockdomains, such that PER will wake up at the same time CORE_L3
does.

This is not a complete workaround.  For it to be complete:

1. the PER powerdomain's next power state must not be set to OSWR or
   OFF if the CORE powerdomain's next power state is set to CSWR or
   ON;

2. the UART3/4 FIFO and McBSP2/3 SIDETONE loopback tests should be run
   if the LASTPOWERSTATEENTERED bits for PER and CORE indicate that
   PER went OFF while CORE stayed on.  If loopback tests fail, then
   those devices will be unusable until PER and CORE can undergo a
   transition from ON to OSWR/OFF and back ON.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/pm.h     |    1 +
 arch/arm/mach-omap2/pm34xx.c |   30 ++++++++++++++++++++++++++++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 686137d..67d6613 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -91,6 +91,7 @@ extern void omap3_save_scratchpad_contents(void);
 
 #define PM_RTA_ERRATUM_i608		(1 << 0)
 #define PM_SDRC_WAKEUP_ERRATUM_i583	(1 << 1)
+#define PM_PER_MEMORIES_ERRATUM_i582	(1 << 2)
 
 #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
 extern u16 pm34xx_errata;
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index c0f8a78..2e0c9e8 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -651,14 +651,17 @@ static void __init pm_errata_configure(void)
 		/* Enable the l2 cache toggling in sleep logic */
 		enable_omap3630_toggle_l2_on_restore();
 		if (omap_rev() < OMAP3630_REV_ES1_2)
-			pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583;
+			pm34xx_errata |= (PM_SDRC_WAKEUP_ERRATUM_i583 |
+					  PM_PER_MEMORIES_ERRATUM_i582);
+	} else if (cpu_is_omap34xx()) {
+		pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582;
 	}
 }
 
 int __init omap3_pm_init(void)
 {
 	struct power_state *pwrst, *tmp;
-	struct clockdomain *neon_clkdm, *mpu_clkdm;
+	struct clockdomain *neon_clkdm, *mpu_clkdm, *per_clkdm, *wkup_clkdm;
 	int ret;
 
 	if (!omap3_has_io_chain_ctrl())
@@ -710,6 +713,8 @@ int __init omap3_pm_init(void)
 
 	neon_clkdm = clkdm_lookup("neon_clkdm");
 	mpu_clkdm = clkdm_lookup("mpu_clkdm");
+	per_clkdm = clkdm_lookup("per_clkdm");
+	wkup_clkdm = clkdm_lookup("wkup_clkdm");
 
 #ifdef CONFIG_SUSPEND
 	omap_pm_suspend = omap3_pm_suspend;
@@ -726,6 +731,27 @@ int __init omap3_pm_init(void)
 	if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608))
 		omap3630_ctrl_disable_rta();
 
+	/*
+	 * The UART3/4 FIFO and the sidetone memory in McBSP2/3 are
+	 * not correctly reset when the PER powerdomain comes back
+	 * from OFF or OSWR when the CORE powerdomain is kept active.
+	 * See OMAP36xx Erratum i582 "PER Domain reset issue after
+	 * Domain-OFF/OSWR Wakeup".  This wakeup dependency is not a
+	 * complete workaround.  The kernel must also prevent the PER
+	 * powerdomain from going to OSWR/OFF while the CORE
+	 * powerdomain is not going to OSWR/OFF.  And if PER last
+	 * power state was off while CORE last power state was ON, the
+	 * UART3/4 and McBSP2/3 SIDETONE devices need to run a
+	 * self-test using their loopback tests; if that fails, those
+	 * devices are unusable until the PER/CORE can complete a transition
+	 * from ON to OSWR/OFF and then back to ON.
+	 *
+	 * XXX Technically this workaround is only needed if off-mode
+	 * or OSWR is enabled.
+	 */
+	if (IS_PM34XX_ERRATUM(PM_PER_MEMORIES_ERRATUM_i582))
+		clkdm_add_wkdep(per_clkdm, wkup_clkdm);
+
 	clkdm_add_wkdep(neon_clkdm, mpu_clkdm);
 	if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
 		omap3_secure_ram_storage =
-- 
1.7.10.4


WARNING: multiple messages have this Message-ID (diff)
From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv4 8/8] ARM: OMAP3: do not delete per_clkdm autodeps during idle
Date: Tue, 16 Oct 2012 07:29:21 +0000 (UTC)	[thread overview]
Message-ID: <alpine.DEB.2.00.1210160603390.9767@utopia.booyaka.com> (raw)
In-Reply-To: <87k3vpek28.fsf@deeprootsystems.com>


Hi Kevin,

Here's an updated version of this one, with the erratum coverage expanded 
to include OMAP34xx/35xx.

I think this one can replace Tero's "[PATCHv6 06/11] ARM: OMAP: 
clockdomain: add support for preventing autodep delete" and "[PATCHv6 
07/11] ARM: OMAP3: do not delete per_clkdm autodeps during idle".  Tero, 
please let us know if you feel otherwise.

The patch seems to pass testing on 37xx.  Was not able to really test it 
on 35xx due to PM regressions in v3.7-rc1.


- Paul

From: Paul Walmsley <paul@pwsan.com>
Date: Tue, 16 Oct 2012 00:08:53 -0600
Subject: [PATCH] ARM: OMAP3: PM: apply part of the erratum i582 workaround

On OMAP34xx/35xx, and OMAP36xx chips with ES < 1.2, if the PER
powerdomain goes to OSWR or OFF while CORE stays at CSWR or ON, or if,
upon chip wakeup from OSWR or OFF, the CORE powerdomain goes ON before
PER, the UART3/4 FIFOs and McBSP2/3 SIDETONE memories will be
unusable.  This is erratum i582 in the OMAP36xx Silicon Errata
document.

This patch implements one of several parts of the workaround: the
addition of the wakeup dependency between the PER and WKUP
clockdomains, such that PER will wake up at the same time CORE_L3
does.

This is not a complete workaround.  For it to be complete:

1. the PER powerdomain's next power state must not be set to OSWR or
   OFF if the CORE powerdomain's next power state is set to CSWR or
   ON;

2. the UART3/4 FIFO and McBSP2/3 SIDETONE loopback tests should be run
   if the LASTPOWERSTATEENTERED bits for PER and CORE indicate that
   PER went OFF while CORE stayed on.  If loopback tests fail, then
   those devices will be unusable until PER and CORE can undergo a
   transition from ON to OSWR/OFF and back ON.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/pm.h     |    1 +
 arch/arm/mach-omap2/pm34xx.c |   30 ++++++++++++++++++++++++++++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 686137d..67d6613 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -91,6 +91,7 @@ extern void omap3_save_scratchpad_contents(void);
 
 #define PM_RTA_ERRATUM_i608		(1 << 0)
 #define PM_SDRC_WAKEUP_ERRATUM_i583	(1 << 1)
+#define PM_PER_MEMORIES_ERRATUM_i582	(1 << 2)
 
 #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
 extern u16 pm34xx_errata;
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index c0f8a78..2e0c9e8 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -651,14 +651,17 @@ static void __init pm_errata_configure(void)
 		/* Enable the l2 cache toggling in sleep logic */
 		enable_omap3630_toggle_l2_on_restore();
 		if (omap_rev() < OMAP3630_REV_ES1_2)
-			pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583;
+			pm34xx_errata |= (PM_SDRC_WAKEUP_ERRATUM_i583 |
+					  PM_PER_MEMORIES_ERRATUM_i582);
+	} else if (cpu_is_omap34xx()) {
+		pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582;
 	}
 }
 
 int __init omap3_pm_init(void)
 {
 	struct power_state *pwrst, *tmp;
-	struct clockdomain *neon_clkdm, *mpu_clkdm;
+	struct clockdomain *neon_clkdm, *mpu_clkdm, *per_clkdm, *wkup_clkdm;
 	int ret;
 
 	if (!omap3_has_io_chain_ctrl())
@@ -710,6 +713,8 @@ int __init omap3_pm_init(void)
 
 	neon_clkdm = clkdm_lookup("neon_clkdm");
 	mpu_clkdm = clkdm_lookup("mpu_clkdm");
+	per_clkdm = clkdm_lookup("per_clkdm");
+	wkup_clkdm = clkdm_lookup("wkup_clkdm");
 
 #ifdef CONFIG_SUSPEND
 	omap_pm_suspend = omap3_pm_suspend;
@@ -726,6 +731,27 @@ int __init omap3_pm_init(void)
 	if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608))
 		omap3630_ctrl_disable_rta();
 
+	/*
+	 * The UART3/4 FIFO and the sidetone memory in McBSP2/3 are
+	 * not correctly reset when the PER powerdomain comes back
+	 * from OFF or OSWR when the CORE powerdomain is kept active.
+	 * See OMAP36xx Erratum i582 "PER Domain reset issue after
+	 * Domain-OFF/OSWR Wakeup".  This wakeup dependency is not a
+	 * complete workaround.  The kernel must also prevent the PER
+	 * powerdomain from going to OSWR/OFF while the CORE
+	 * powerdomain is not going to OSWR/OFF.  And if PER last
+	 * power state was off while CORE last power state was ON, the
+	 * UART3/4 and McBSP2/3 SIDETONE devices need to run a
+	 * self-test using their loopback tests; if that fails, those
+	 * devices are unusable until the PER/CORE can complete a transition
+	 * from ON to OSWR/OFF and then back to ON.
+	 *
+	 * XXX Technically this workaround is only needed if off-mode
+	 * or OSWR is enabled.
+	 */
+	if (IS_PM34XX_ERRATUM(PM_PER_MEMORIES_ERRATUM_i582))
+		clkdm_add_wkdep(per_clkdm, wkup_clkdm);
+
 	clkdm_add_wkdep(neon_clkdm, mpu_clkdm);
 	if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
 		omap3_secure_ram_storage =
-- 
1.7.10.4

  reply	other threads:[~2012-10-16  7:29 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 14:19 [PATCHv4 0/8] ARM: OMAP: pm: usecounting changes Tero Kristo
2012-07-13 14:19 ` Tero Kristo
2012-07-13 14:19 ` [PATCHv4 1/8] ARM: OMAP: clk: add support for omap_clk_for_each Tero Kristo
2012-07-13 14:19   ` Tero Kristo
2012-07-16 10:04   ` Rajendra Nayak
2012-07-16 10:04     ` Rajendra Nayak
2012-07-16 11:42     ` Tero Kristo
2012-07-16 11:42       ` Tero Kristo
2012-07-13 14:19 ` [PATCHv4 2/8] ARM: OMAP3+: voltage/pwrdm/clkdm/clock add recursive usecount tracking Tero Kristo
2012-07-13 14:19   ` Tero Kristo
2012-07-16 10:15   ` Rajendra Nayak
2012-07-16 10:15     ` Rajendra Nayak
2012-07-27 19:14   ` Kevin Hilman
2012-07-27 19:14     ` Kevin Hilman
2012-08-06 23:31   ` Kevin Hilman
2012-08-06 23:31     ` Kevin Hilman
2012-09-07  9:23     ` Tero Kristo
2012-09-07  9:23       ` Tero Kristo
2012-07-13 14:19 ` [PATCHv4 3/8] ARM: OMAP3+: voltage: add support for voltagedomain usecounts Tero Kristo
2012-07-13 14:19   ` Tero Kristo
2012-07-16 10:23   ` Rajendra Nayak
2012-07-16 10:23     ` Rajendra Nayak
2012-07-24 20:58   ` Vishwanath Sripathy
2012-07-24 20:58     ` Vishwanath Sripathy
2012-07-25  8:07     ` Tero Kristo
2012-07-25  8:07       ` Tero Kristo
2012-07-13 14:19 ` [PATCHv4 4/8] ARM: OMAP3: add manual control for mpu / core pwrdm usecounting Tero Kristo
2012-07-13 14:19   ` Tero Kristo
2012-07-16 10:30   ` Rajendra Nayak
2012-07-16 10:30     ` Rajendra Nayak
2012-07-27 19:36   ` Kevin Hilman
2012-07-27 19:36     ` Kevin Hilman
2012-07-30  8:40     ` Tero Kristo
2012-07-30  8:40       ` Tero Kristo
2012-08-06 10:14       ` Jean Pihet
2012-08-06 10:14         ` Jean Pihet
2012-09-07  9:30         ` Tero Kristo
2012-09-07  9:30           ` Tero Kristo
2012-09-07 21:48           ` Kevin Hilman
2012-09-07 21:48             ` Kevin Hilman
2012-08-06 23:32     ` Kevin Hilman
2012-08-06 23:32       ` Kevin Hilman
2012-07-13 14:19 ` [PATCHv4 5/8] ARM: OMAP3: set autoidle flag for sdrc_ick Tero Kristo
2012-07-13 14:19   ` Tero Kristo
2012-07-16 10:39   ` Rajendra Nayak
2012-07-16 10:39     ` Rajendra Nayak
2012-07-13 14:19 ` [PATCHv4 6/8] ARM: OMAP: pm-debug: enhanced usecount debug support Tero Kristo
2012-07-13 14:19   ` Tero Kristo
2012-07-16 10:50   ` Rajendra Nayak
2012-07-16 10:50     ` Rajendra Nayak
2012-07-16 11:45     ` Tero Kristo
2012-07-16 11:45       ` Tero Kristo
2012-07-16 12:14       ` Rajendra Nayak
2012-07-16 12:14         ` Rajendra Nayak
2012-07-27 19:55   ` Kevin Hilman
2012-07-27 19:55     ` Kevin Hilman
2012-07-30  8:36     ` Tero Kristo
2012-07-30  8:36       ` Tero Kristo
2012-07-13 14:19 ` [PATCHv4 7/8] ARM: OMAP: clockdomain: add support for preventing autodep delete Tero Kristo
2012-07-13 14:19   ` Tero Kristo
2012-07-16 11:00   ` Rajendra Nayak
2012-07-16 11:00     ` Rajendra Nayak
2012-07-17 14:56     ` Tero Kristo
2012-07-17 14:56       ` Tero Kristo
2012-07-17 21:31       ` Paul Walmsley
2012-07-17 21:31         ` Paul Walmsley
2012-07-18  7:15       ` Rajendra Nayak
2012-07-18  7:15         ` Rajendra Nayak
2012-07-18  8:05         ` Tero Kristo
2012-07-18  8:05           ` Tero Kristo
2012-07-18  9:04           ` Rajendra Nayak
2012-07-18  9:04             ` Rajendra Nayak
2012-07-18  9:16             ` Tero Kristo
2012-07-18  9:16               ` Tero Kristo
2012-07-27 20:12             ` Kevin Hilman
2012-07-27 20:12               ` Kevin Hilman
2012-07-13 14:19 ` [PATCHv4 8/8] ARM: OMAP3: do not delete per_clkdm autodeps during idle Tero Kristo
2012-07-13 14:19   ` Tero Kristo
2012-09-18 22:25   ` Paul Walmsley
2012-09-18 22:25     ` Paul Walmsley
2012-09-18 22:43     ` Paul Walmsley
2012-09-18 22:43       ` Paul Walmsley
2012-09-19 22:15       ` Kevin Hilman
2012-09-19 22:15         ` Kevin Hilman
2012-10-16  7:29         ` Paul Walmsley [this message]
2012-10-16  7:29           ` Paul Walmsley
2012-10-17  0:39           ` Kevin Hilman
2012-10-17  0:39             ` Kevin Hilman
2012-10-31 11:59           ` Tero Kristo
2012-10-31 11:59             ` Tero Kristo
2012-09-19  9:06     ` Tero Kristo
2012-09-19  9:06       ` Tero Kristo

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=alpine.DEB.2.00.1210160603390.9767@utopia.booyaka.com \
    --to=paul@pwsan.com \
    --cc=b-cousson@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=t-kristo@ti.com \
    /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.