[PATCH] Invalid setting for SYS_WAKEMSK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

the following patch fix setting of register SYS_WAKEMSK.

Without this patch when you reset the board via hardware reset, and
your bootloader supports wake up code, the board will execute wake up
code instead of reset one.

Ciao,

Rodolfo


-- 

GNU/Linux Solutions                  e-mail:    giometti@xxxxxxxxxxxx
Linux Device Driver                             giometti@xxxxxxxxx
Embedded Systems                     		giometti@xxxxxxxx
UNIX programming                     phone:     +39 349 2432127
diff --git a/arch/mips/au1000/common/power.c b/arch/mips/au1000/common/power.c
index 4175396..9b47082 100644
--- a/arch/mips/au1000/common/power.c
+++ b/arch/mips/au1000/common/power.c
@@ -281,8 +281,8 @@ int au_sleep(int reason, int force)
 	DPRINTK("reason %d force %d wakeup %lX ticks %d\n",
 	        reason, force, wakeup, ticks);
 
-	au_writel(wakeup, SYS_WAKEMSK);
 	au_writel(~0, SYS_WAKESRC);	/* clear cause */
+	au_writel(wakeup, SYS_WAKEMSK);
 	au_sync();
 
 	DPRINTK("Zzz...\n");
@@ -301,6 +301,10 @@ int au_sleep(int reason, int force)
 	if (reason&(1<<8))		/* Wake up thanks to TOY */
 		reason = -ticks*HZ;
 
+	au_writel(~0, SYS_WAKESRC);	/* clear cause */
+	au_writel(0, SYS_WAKEMSK);	/* clear mask */
+	au_sync();
+
 	/* Call specific board routine */
 	if (board_after_sleep)
 		board_after_sleep(reason);
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index 177606b..e807e1b 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -442,8 +442,8 @@ #ifdef CONFIG_PM
 		au_writel(0, SYS_TOYWRITE);
 		while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
 
-		au_writel(au_readl(SYS_WAKEMSK) | (1<<8), SYS_WAKEMSK);
 		au_writel(~0, SYS_WAKESRC);
+		au_writel(0, SYS_WAKEMSK);
 		au_sync();
 		while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
 

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux