ARM: mach-shmobile: sh7372 A4S Mackerel debug hack
Magnus Damm
maintainerPATCH 1/1 ARM: mach-shmobile: sh7372 A4S Mackerel debug hack
From: Magnus Damm <[email protected]>
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 <[email protected]>
---
arch/arm/mach-shmobile/pm-sh7372.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/pm-sh7372.c +15 -2
@@ -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" );