Invalid setting for SYS_WAKEMSK
PATCH 1/1 Invalid setting for SYS_WAKEMSK
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
Signature · 4 lines
GNU/Linux Solutions e-mail: [email protected] Linux Device Driver [email protected] Embedded Systems [email protected] UNIX programming phone: +39 349 2432127
arch/mips/au1000/common/power.c +5 -1
@@ -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);
arch/mips/au1000/common/time.c +1 -1
@@ -442,8 +442,8 @@ #ifdef CONFIG_PMau_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 );