diff options
author | Magnus Damm <damm@opensource.se> | 2009-10-30 00:23:51 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-30 01:33:44 -0400 |
commit | 86c7d03a0fe4241e64eb19b86544647c8ee4bac9 (patch) | |
tree | 8c73bac966ed65aafadd52e0b18ad8c20ab11c05 /arch/sh/boards/mach-ap325rxa/sdram.S | |
parent | 53528928d1260747c294b63218d9886c74df4c31 (diff) |
sh: Add ap325rxa specific memory pre/post sleep code
Add self-refresh handling code for the AP325RXA board.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/mach-ap325rxa/sdram.S')
-rw-r--r-- | arch/sh/boards/mach-ap325rxa/sdram.S | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-ap325rxa/sdram.S b/arch/sh/boards/mach-ap325rxa/sdram.S new file mode 100644 index 000000000000..db24fbed4fca --- /dev/null +++ b/arch/sh/boards/mach-ap325rxa/sdram.S | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * AP325RXA sdram self/auto-refresh setup code | ||
3 | * | ||
4 | * Copyright (C) 2009 Magnus Damm | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/sys.h> | ||
12 | #include <linux/errno.h> | ||
13 | #include <linux/linkage.h> | ||
14 | #include <asm/asm-offsets.h> | ||
15 | #include <asm/suspend.h> | ||
16 | #include <asm/romimage-macros.h> | ||
17 | |||
18 | /* code to enter and leave self-refresh. must be self-contained. | ||
19 | * this code will be copied to on-chip memory and executed from there. | ||
20 | */ | ||
21 | .balign 4 | ||
22 | ENTRY(ap325rxa_sdram_enter_start) | ||
23 | |||
24 | /* SBSC: disable power down and put in self-refresh mode */ | ||
25 | mov.l 1f, r4 | ||
26 | mov.l 2f, r1 | ||
27 | mov.l @r4, r2 | ||
28 | or r1, r2 | ||
29 | mov.l 3f, r3 | ||
30 | and r3, r2 | ||
31 | mov.l r2, @r4 | ||
32 | |||
33 | rts | ||
34 | nop | ||
35 | |||
36 | .balign 4 | ||
37 | 1: .long 0xfe400008 /* SDCR0 */ | ||
38 | 2: .long 0x00000400 | ||
39 | 3: .long 0xffff7fff | ||
40 | ENTRY(ap325rxa_sdram_enter_end) | ||
41 | |||
42 | .balign 4 | ||
43 | ENTRY(ap325rxa_sdram_leave_start) | ||
44 | |||
45 | /* SBSC: set auto-refresh mode */ | ||
46 | mov.l 1f, r4 | ||
47 | mov.l @r4, r0 | ||
48 | mov.l 4f, r1 | ||
49 | and r1, r0 | ||
50 | mov.l r0, @r4 | ||
51 | mov.l 6f, r4 | ||
52 | mov.l 8f, r0 | ||
53 | mov.l @r4, r1 | ||
54 | mov #-1, r4 | ||
55 | add r4, r1 | ||
56 | or r1, r0 | ||
57 | mov.l 7f, r1 | ||
58 | mov.l r0, @r1 | ||
59 | |||
60 | rts | ||
61 | nop | ||
62 | |||
63 | .balign 4 | ||
64 | 1: .long 0xfe400008 /* SDCR0 */ | ||
65 | 4: .long 0xfffffbff | ||
66 | 6: .long 0xfe40001c /* RTCOR */ | ||
67 | 7: .long 0xfe400018 /* RTCNT */ | ||
68 | 8: .long 0xa55a0000 | ||
69 | ENTRY(ap325rxa_sdram_leave_end) | ||