All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: Scott Wood <scottwood@freescale.com>,
	linuxppc-dev@ozlabs.org, Timur Tabi <timur@freescale.com>
Subject: [PATCH 2/7] powerpc/qe: QE also shuts down on MPC8568
Date: Wed, 16 Sep 2009 01:43:54 +0400	[thread overview]
Message-ID: <20090915214354.GB24821@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20090915214321.GA19377@oksana.dev.rtsoft.ru>

It appears that QE shuts down on all MPC85xx CPUs (i.e. MPC8568 and
MPC8569) and thus needs reset upon resume.

So modify qe_alive_during_sleep() to account that.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/include/asm/qe.h   |   23 ++++++++++++++++++++++-
 arch/powerpc/sysdev/qe_lib/qe.c |   13 -------------
 2 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h
index fe507ff..0947b36 100644
--- a/arch/powerpc/include/asm/qe.h
+++ b/arch/powerpc/include/asm/qe.h
@@ -163,7 +163,28 @@ int qe_get_snum(void);
 void qe_put_snum(u8 snum);
 unsigned int qe_get_num_of_risc(void);
 unsigned int qe_get_num_of_snums(void);
-int qe_alive_during_sleep(void);
+
+static inline int qe_alive_during_sleep(void)
+{
+	/*
+	 * MPC8568E reference manual says:
+	 *
+	 * "...power down sequence waits for all I/O interfaces to become idle.
+	 *  In some applications this may happen eventually without actively
+	 *  shutting down interfaces, but most likely, software will have to
+	 *  take steps to shut down the eTSEC, QUICC Engine Block, and PCI
+	 *  interfaces before issuing the command (either the write to the core
+	 *  MSR[WE] as described above or writing to POWMGTCSR) to put the
+	 *  device into sleep state."
+	 *
+	 * MPC8569E reference manual has a similar paragraph.
+	 */
+#ifdef CONFIG_PPC_85xx
+	return 0;
+#else
+	return 1;
+#endif
+}
 
 /* we actually use cpm_muram implementation, define this for convenience */
 #define qe_muram_init cpm_muram_init
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1ed1a9f..4eaf2a9 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -65,19 +65,6 @@ static unsigned int qe_num_of_snum;
 
 static phys_addr_t qebase = -1;
 
-int qe_alive_during_sleep(void)
-{
-	static int ret = -1;
-
-	if (ret != -1)
-		return ret;
-
-	ret = !of_find_compatible_node(NULL, NULL, "fsl,mpc8569-pmc");
-
-	return ret;
-}
-EXPORT_SYMBOL(qe_alive_during_sleep);
-
 phys_addr_t get_qe_base(void)
 {
 	struct device_node *qe;
-- 
1.6.3.3

  parent reply	other threads:[~2009-09-15 21:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-15 21:43 [PATCH v4 0/7] Suspend/resume support for some 83xx/85xx/86xx boards Anton Vorontsov
2009-09-15 21:43 ` [PATCH 1/7] powerpc/qe: Make qe_reset() code path safe for repeated invocation Anton Vorontsov
2009-11-05 13:15   ` Kumar Gala
2009-09-15 21:43 ` Anton Vorontsov [this message]
2009-11-05 13:15   ` [PATCH 2/7] powerpc/qe: QE also shuts down on MPC8568 Kumar Gala
2009-09-15 21:43 ` [PATCH 3/7] powerpc/qe: Implement QE driver for handling resume on MPC85xx Anton Vorontsov
2009-11-05 14:11   ` Kumar Gala
2009-09-15 21:43 ` [PATCH 4/7] powerpc/85xx/86xx: Add suspend/resume support Anton Vorontsov
2009-11-05 14:11   ` Kumar Gala
2009-09-15 21:43 ` [PATCH 5/7] powerpc/85xx: Add power management support for MPC85xxMDS boards Anton Vorontsov
2009-11-05 13:58   ` Kumar Gala
2009-11-05 14:02     ` Kumar Gala
2009-11-05 14:08       ` Anton Vorontsov
2009-11-05 14:04     ` Anton Vorontsov
2009-11-05 14:06       ` Kumar Gala
2009-11-05 16:53         ` Scott Wood
2009-11-05 14:11   ` Kumar Gala
2009-09-15 21:44 ` [PATCH 6/7] powerpc/86xx: Add power management support for MPC8610HPCD boards Anton Vorontsov
2009-11-05 14:11   ` Kumar Gala
2009-09-15 21:44 ` [PATCH 7/7] powerpc/83xx: Add power management support for MPC83xx QE boards Anton Vorontsov
2009-11-05 14:11   ` Kumar Gala

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=20090915214354.GB24821@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.com \
    --cc=timur@freescale.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.