All of lore.kernel.org
 help / color / mirror / Atom feed
* Freezing & Unfreezing the au11000
@ 2005-12-16 15:32 ` Rodolfo Giometti
  0 siblings, 0 replies; 4+ messages in thread
From: Rodolfo Giometti @ 2005-12-16 15:32 UTC (permalink / raw)
  To: linux-mips, u-boot-users

I'm just trying to support the save_and_sleep() support into u-boot
for an au1100 based board.

Into u-boot I added the following code:

Index: cpu/mips/start.S
===================================================================
RCS file: /home/develop/cvs_private/uboot-mips-exadron/cpu/mips/start.S,v
retrieving revision 1.2
diff -u -r1.2 start.S
--- cpu/mips/start.S	12 Oct 2005 12:55:54 -0000	1.2
+++ cpu/mips/start.S	16 Dec 2005 15:29:22 -0000
@@ -26,6 +26,7 @@
 #include <config.h>
 #include <version.h>
 #include <asm/regdef.h>
+#include <asm/au1x00.h>
 #include <asm/mipsregs.h>
 
 
@@ -273,6 +274,33 @@
 	li	t0, CONF_CM_CACHABLE_NONCOHERENT
 	mtc0	t0, CP0_CONFIG
 
+	/* Now check the wakeup cause
+	 */
+	li      t0, SYS_WAKESRC
+	lw      t1, 0(t0)
+	andi    t1, t1, 0x00000002	/* check the SW bit */
+	beq     zero, t1, 1f
+	nop
+
+	li	t0, SYS_SCRATCH0
+	lw      t1, 0(t0)
+	move	sp, t1
+	li	t0, SYS_SCRATCH1
+	lw      t1, 0(t0)
+	j	t1 			/* this cause a jump into already
+	nop				   frozen Linux (brr! :) */	
+
+	/* If we reach this point we come from a normal system power up,
+           so just clear the wakeup cause registers
+	 */
+
+1:	li      t0, SYS_WAKEMSK
+	li      t1, 0x00000000
+	sw      t1, 0(t0)
+
+	li      t0, SYS_WAKESRC
+	li      t1, 0x00000000
+	sw      t1, 0(t0)
 
 	/* Set up temporary stack.
 	 */

in order to restore the scratch registers contents as descibed into
file "linux/arch/mips/au1000/common/sleeper.S":

        /* Now set up the scratch registers so the boot rom will
         * return to this point upon wakeup.
         */     
        la      k0, 1f
        lui     k1, 0xb190
        ori     k1, 0x18
        sw      sp, 0(k1)
        ori     k1, 0x1c
        sw      k0, 0(k1)

However it seems something is wrong since the system at the end of
save_and_sleep() does not correctly continue its execution...

Unlikely my JTAG do not allow me to follow the code after the
save_and_sleep()'s return (I definitely have to buy a better one),
however I noticed that when the system tryes to resume the register 29
(the sp) doing:

        lw      $29, PT_R29(sp)

something goes wrong!

Suggestions? :)

Thanks in advance,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] Freezing & Unfreezing the au11000
@ 2005-12-16 15:32 ` Rodolfo Giometti
  0 siblings, 0 replies; 4+ messages in thread
From: Rodolfo Giometti @ 2005-12-16 15:32 UTC (permalink / raw)
  To: u-boot

I'm just trying to support the save_and_sleep() support into u-boot
for an au1100 based board.

Into u-boot I added the following code:

Index: cpu/mips/start.S
===================================================================
RCS file: /home/develop/cvs_private/uboot-mips-exadron/cpu/mips/start.S,v
retrieving revision 1.2
diff -u -r1.2 start.S
--- cpu/mips/start.S	12 Oct 2005 12:55:54 -0000	1.2
+++ cpu/mips/start.S	16 Dec 2005 15:29:22 -0000
@@ -26,6 +26,7 @@
 #include <config.h>
 #include <version.h>
 #include <asm/regdef.h>
+#include <asm/au1x00.h>
 #include <asm/mipsregs.h>
 
 
@@ -273,6 +274,33 @@
 	li	t0, CONF_CM_CACHABLE_NONCOHERENT
 	mtc0	t0, CP0_CONFIG
 
+	/* Now check the wakeup cause
+	 */
+	li      t0, SYS_WAKESRC
+	lw      t1, 0(t0)
+	andi    t1, t1, 0x00000002	/* check the SW bit */
+	beq     zero, t1, 1f
+	nop
+
+	li	t0, SYS_SCRATCH0
+	lw      t1, 0(t0)
+	move	sp, t1
+	li	t0, SYS_SCRATCH1
+	lw      t1, 0(t0)
+	j	t1 			/* this cause a jump into already
+	nop				   frozen Linux (brr! :) */	
+
+	/* If we reach this point we come from a normal system power up,
+           so just clear the wakeup cause registers
+	 */
+
+1:	li      t0, SYS_WAKEMSK
+	li      t1, 0x00000000
+	sw      t1, 0(t0)
+
+	li      t0, SYS_WAKESRC
+	li      t1, 0x00000000
+	sw      t1, 0(t0)
 
 	/* Set up temporary stack.
 	 */

in order to restore the scratch registers contents as descibed into
file "linux/arch/mips/au1000/common/sleeper.S":

        /* Now set up the scratch registers so the boot rom will
         * return to this point upon wakeup.
         */     
        la      k0, 1f
        lui     k1, 0xb190
        ori     k1, 0x18
        sw      sp, 0(k1)
        ori     k1, 0x1c
        sw      k0, 0(k1)

However it seems something is wrong since the system at the end of
save_and_sleep() does not correctly continue its execution...

Unlikely my JTAG do not allow me to follow the code after the
save_and_sleep()'s return (I definitely have to buy a better one),
however I noticed that when the system tryes to resume the register 29
(the sp) doing:

        lw      $29, PT_R29(sp)

something goes wrong!

Suggestions? :)

Thanks in advance,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Freezing & Unfreezing the au11000
  2005-12-16 15:32 ` [U-Boot-Users] " Rodolfo Giometti
  (?)
@ 2005-12-16 16:31 ` Sergei Shtylylov
  2006-03-29 14:36   ` Rodolfo Giometti
  -1 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtylylov @ 2005-12-16 16:31 UTC (permalink / raw)
  To: Linux MIPS; +Cc: Rodolfo Giometti

Rodolfo Giometti wrote:

> in order to restore the scratch registers contents as descibed into
> file "linux/arch/mips/au1000/common/sleeper.S":

    If you're talking about 2.6, the code in that file seems very incorrect in 
regard to how it deals wiht the stack frame, since it effectively trashes regs 
$1 and $2 reusing their slots for saving CP0 Status and Context regs. 2.4 
branch has more sane variant.

> Thanks in advance,
> 
> Rodolfo

WBR, Sergei

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Freezing & Unfreezing the au11000
  2005-12-16 16:31 ` Sergei Shtylylov
@ 2006-03-29 14:36   ` Rodolfo Giometti
  0 siblings, 0 replies; 4+ messages in thread
From: Rodolfo Giometti @ 2006-03-29 14:36 UTC (permalink / raw)
  To: dan; +Cc: Linux MIPS

[-- Attachment #1: Type: text/plain, Size: 1282 bytes --]

On Fri, Dec 16, 2005 at 07:31:05PM +0300, Sergei Shtylylov wrote:
> Rodolfo Giometti wrote:
> 
> >in order to restore the scratch registers contents as descibed into
> >file "linux/arch/mips/au1000/common/sleeper.S":
> 
>    If you're talking about 2.6, the code in that file seems very incorrect 
>    in regard to how it deals wiht the stack frame, since it effectively 
> trashes regs $1 and $2 reusing their slots for saving CP0 Status and 
> Context regs. 2.4 branch has more sane variant.

I'm trying to use code into sleeper.S from kernel 2.4 but I still have
a problem. The system corrctly wake up and linux restart but the
problem is that after about 600-800mS the system hangs! I've just the
time to press 2 or three times the enter key and see the console
prompt.

I've checked also the interrupts from TOY and I noticed that it stop
working!

Has anybody used the sleep mode for Au1xxx processor? Which version of
sleeper.S file has been used?

Thanks in advance,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-29 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-16 15:32 Freezing & Unfreezing the au11000 Rodolfo Giometti
2005-12-16 15:32 ` [U-Boot-Users] " Rodolfo Giometti
2005-12-16 16:31 ` Sergei Shtylylov
2006-03-29 14:36   ` Rodolfo Giometti

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.