2 * Copyright 2002 Embedded Edge, LLC
3 * Author: dan@embeddededge.com
5 * Sleep helper for Au1xxx sleep mode.
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
12 #include <linux/config.h>
14 #include <asm/mipsregs.h>
15 #include <asm/addrspace.h>
16 #include <asm/regdef.h>
17 #include <asm/stackframe.h>
24 /* Save all of the processor general registers and go to sleep.
25 * A wakeup condition will get us back here to restore the registers.
70 /* Now set up the scratch registers so the boot rom will
71 * return to this point upon wakeup.
80 /* Put SDRAM into self refresh. Preload instructions into cache,
81 * issue a precharge, then auto refresh, then sleep commands to it.
93 sw zero, 0x001c(k0) /* Precharge */
94 sw zero, 0x0020(k0) /* Auto refresh */
95 sw zero, 0x0030(k0) /* SDRAM sleep */
99 sw zero, 0x0078(k1) /* get ready to sleep */
101 sw zero, 0x007c(k1) /* Put processor to sleep */
104 /* This is where we return upon wakeup.
105 * Reload all of the registers and return.
113 mtc0 k0, CP0_PAGEMASK