From: Rodolfo Giometti <giometti@linux.it>
To: linux-mips@linux-mips.org, u-boot-users@lists.sourceforge.net
Subject: Freezing & Unfreezing the au11000
Date: Fri, 16 Dec 2005 16:32:03 +0100 [thread overview]
Message-ID: <20051216153203.GK14341@gundam.enneenne.com> (raw)
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
next reply other threads:[~2005-12-16 15:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-16 15:32 Rodolfo Giometti [this message]
2005-12-16 16:31 ` Freezing & Unfreezing the au11000 Sergei Shtylylov
2006-03-29 14:36 ` Rodolfo Giometti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051216153203.GK14341@gundam.enneenne.com \
--to=giometti@linux.it \
--cc=linux-mips@linux-mips.org \
--cc=u-boot-users@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox