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 | |
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')
-rw-r--r-- | arch/sh/boards/mach-ap325rxa/Makefile | 2 | ||||
-rw-r--r-- | arch/sh/boards/mach-ap325rxa/sdram.S | 69 | ||||
-rw-r--r-- | arch/sh/boards/mach-ap325rxa/setup.c | 13 |
3 files changed, 83 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-ap325rxa/Makefile b/arch/sh/boards/mach-ap325rxa/Makefile index 0ad249dbd351..4cf1774d2613 100644 --- a/arch/sh/boards/mach-ap325rxa/Makefile +++ b/arch/sh/boards/mach-ap325rxa/Makefile | |||
@@ -1,2 +1,2 @@ | |||
1 | obj-y := setup.o | 1 | obj-y := setup.o sdram.o |
2 | 2 | ||
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) | ||
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index b95deee35e0f..be8da973f00f 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <video/sh_mobile_lcdc.h> | 27 | #include <video/sh_mobile_lcdc.h> |
28 | #include <asm/io.h> | 28 | #include <asm/io.h> |
29 | #include <asm/clock.h> | 29 | #include <asm/clock.h> |
30 | #include <asm/suspend.h> | ||
30 | #include <cpu/sh7723.h> | 31 | #include <cpu/sh7723.h> |
31 | 32 | ||
32 | static struct smsc911x_platform_config smsc911x_config = { | 33 | static struct smsc911x_platform_config smsc911x_config = { |
@@ -481,8 +482,20 @@ static struct platform_device *ap325rxa_devices[] __initdata = { | |||
481 | &ap325rxa_camera[1], | 482 | &ap325rxa_camera[1], |
482 | }; | 483 | }; |
483 | 484 | ||
485 | extern char ap325rxa_sdram_enter_start; | ||
486 | extern char ap325rxa_sdram_enter_end; | ||
487 | extern char ap325rxa_sdram_leave_start; | ||
488 | extern char ap325rxa_sdram_leave_end; | ||
489 | |||
484 | static int __init ap325rxa_devices_setup(void) | 490 | static int __init ap325rxa_devices_setup(void) |
485 | { | 491 | { |
492 | /* register board specific self-refresh code */ | ||
493 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, | ||
494 | &ap325rxa_sdram_enter_start, | ||
495 | &ap325rxa_sdram_enter_end, | ||
496 | &ap325rxa_sdram_leave_start, | ||
497 | &ap325rxa_sdram_leave_end); | ||
498 | |||
486 | /* LD3 and LD4 LEDs */ | 499 | /* LD3 and LD4 LEDs */ |
487 | gpio_request(GPIO_PTX5, NULL); /* RUN */ | 500 | gpio_request(GPIO_PTX5, NULL); /* RUN */ |
488 | gpio_direction_output(GPIO_PTX5, 1); | 501 | gpio_direction_output(GPIO_PTX5, 1); |