* [PATCH] ARM: mach-shmobile: sh7372 A4S Mackerel debug hack
@ 2011-12-18 17:03 Magnus Damm
0 siblings, 0 replies; only message in thread
From: Magnus Damm @ 2011-12-18 17:03 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm@opensource.se>
Add some quick debugging code on top of the A4S power domain
patch to allow serial printouts before and soon after the power
has been cut/restored. Duplicates the context restore code
located in the SCIF driver in a board specific fashion. Will
only work on Mackerel. Not for upstream inclusion.
Not-signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/pm-sh7372.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
--- 0004/arch/arm/mach-shmobile/pm-sh7372.c
+++ work/arch/arm/mach-shmobile/pm-sh7372.c 2011-12-19 01:50:11.000000000 +0900
@@ -7,7 +7,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
-
+#define DEBUG
#include <linux/pm.h>
#include <linux/suspend.h>
#include <linux/cpuidle.h>
@@ -323,7 +323,9 @@ static int sh7372_sysc_valid(unsigned lo
mstpsr2 = __raw_readl(MSTPSR2);
if ((mstpsr2 & 0x000741ff) != 0x000741ff) {
pr_debug("sh7372 mstpsr2 0x%08lx\n", mstpsr2);
+#if 0 /* SCIF console clock will be on, ignore to debug low level A4S code */
return 0;
+#endif
}
mstpsr3 = __raw_readl(MSTPSR3);
@@ -475,11 +477,22 @@ static int sh7372_enter_suspend(suspend_
/* convert INTC mask and sense to SYSC mask and sense */
sh7372_setup_sysc(msk, msk2);
- if (!sh7372_a3sp.stay_on &&
+ if (/*!sh7372_a3sp.stay_on && */
sh7372_a4s.genpd.status = GPD_STATE_POWER_OFF) {
/* enter A4S sleep with PLLC0 off */
pr_debug("entering A4S\n");
sh7372_enter_a4s_common(0);
+
+ /* power up A3SP and setup SCIF console */
+ if (sh7372_a3sp.stay_on) {
+ sh7372_a3sp.stay_on = 0;
+ pd_power_up(&sh7372_a3sp.genpd);
+ sh7372_a3sp.stay_on = 1;
+ __raw_writew(0, 0xE6C40000); /* setup SCIF */
+ __raw_writeb(0x19, 0xE6C40004);
+ __raw_writew(0x0030, 0xE6C40008);
+ pr_debug("SCIF alive and kicking!\n");
+ }
} else {
/* enter A3SM sleep with PLLC0 off */
pr_debug("entering A3SM\n");
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-12-18 17:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-18 17:03 [PATCH] ARM: mach-shmobile: sh7372 A4S Mackerel debug hack Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).