diff options
author | Magnus Damm <damm@opensource.se> | 2009-10-30 00:23:59 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-30 01:33:46 -0400 |
commit | eb0cd9e88c6a6561055b32a17d44d8918aecc3c7 (patch) | |
tree | 7f91f60d07f07bc5b06879ee534958eb5ebc8de5 /arch/sh/boards | |
parent | 86c7d03a0fe4241e64eb19b86544647c8ee4bac9 (diff) |
sh: Add Ecovec24 specific memory pre/post sleep code
Add self-refresh handling code for the Ecovec24 board.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/mach-ecovec24/Makefile | 2 | ||||
-rw-r--r-- | arch/sh/boards/mach-ecovec24/sdram.S | 52 | ||||
-rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 14 |
3 files changed, 67 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-ecovec24/Makefile b/arch/sh/boards/mach-ecovec24/Makefile index 51f852151655..e69bc82208fc 100644 --- a/arch/sh/boards/mach-ecovec24/Makefile +++ b/arch/sh/boards/mach-ecovec24/Makefile | |||
@@ -6,4 +6,4 @@ | |||
6 | # for more details. | 6 | # for more details. |
7 | # | 7 | # |
8 | 8 | ||
9 | obj-y := setup.o \ No newline at end of file | 9 | obj-y := setup.o sdram.o \ No newline at end of file |
diff --git a/arch/sh/boards/mach-ecovec24/sdram.S b/arch/sh/boards/mach-ecovec24/sdram.S new file mode 100644 index 000000000000..833440044407 --- /dev/null +++ b/arch/sh/boards/mach-ecovec24/sdram.S | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Ecovec24 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(ecovec24_sdram_enter_start) | ||
23 | |||
24 | /* DBSC: put memory in self-refresh mode */ | ||
25 | |||
26 | ED 0xFD000010, 0x00000000 /* DBEN */ | ||
27 | ED 0xFD000040, 0x00000000 /* DBRFPDN0 */ | ||
28 | ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */ | ||
29 | ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */ | ||
30 | ED 0xFD000040, 0x00000001 /* DBRFPDN0 */ | ||
31 | |||
32 | rts | ||
33 | nop | ||
34 | |||
35 | ENTRY(ecovec24_sdram_enter_end) | ||
36 | |||
37 | .balign 4 | ||
38 | ENTRY(ecovec24_sdram_leave_start) | ||
39 | |||
40 | /* DBSC: put memory in auto-refresh mode */ | ||
41 | |||
42 | ED 0xFD000040, 0x00000000 /* DBRFPDN0 */ | ||
43 | WAIT 1 | ||
44 | ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */ | ||
45 | ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */ | ||
46 | ED 0xFD000010, 0x00000001 /* DBEN */ | ||
47 | ED 0xFD000040, 0x00010000 /* DBRFPDN0 */ | ||
48 | |||
49 | rts | ||
50 | nop | ||
51 | |||
52 | ENTRY(ecovec24_sdram_leave_end) | ||
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index c3d05e5be2e9..2274985753a4 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <asm/sh_eth.h> | 26 | #include <asm/sh_eth.h> |
27 | #include <asm/sh_keysc.h> | 27 | #include <asm/sh_keysc.h> |
28 | #include <asm/clock.h> | 28 | #include <asm/clock.h> |
29 | #include <asm/suspend.h> | ||
29 | #include <cpu/sh7724.h> | 30 | #include <cpu/sh7724.h> |
30 | 31 | ||
31 | /* | 32 | /* |
@@ -526,8 +527,21 @@ static void __init sh_eth_init(struct sh_eth_plat_data *pd) | |||
526 | 527 | ||
527 | #define PORT_HIZA 0xA4050158 | 528 | #define PORT_HIZA 0xA4050158 |
528 | #define IODRIVEA 0xA405018A | 529 | #define IODRIVEA 0xA405018A |
530 | |||
531 | extern char ecovec24_sdram_enter_start; | ||
532 | extern char ecovec24_sdram_enter_end; | ||
533 | extern char ecovec24_sdram_leave_start; | ||
534 | extern char ecovec24_sdram_leave_end; | ||
535 | |||
529 | static int __init arch_setup(void) | 536 | static int __init arch_setup(void) |
530 | { | 537 | { |
538 | /* register board specific self-refresh code */ | ||
539 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, | ||
540 | &ecovec24_sdram_enter_start, | ||
541 | &ecovec24_sdram_enter_end, | ||
542 | &ecovec24_sdram_leave_start, | ||
543 | &ecovec24_sdram_leave_end); | ||
544 | |||
531 | /* enable STATUS0, STATUS2 and PDSTATUS */ | 545 | /* enable STATUS0, STATUS2 and PDSTATUS */ |
532 | gpio_request(GPIO_FN_STATUS0, NULL); | 546 | gpio_request(GPIO_FN_STATUS0, NULL); |
533 | gpio_request(GPIO_FN_STATUS2, NULL); | 547 | gpio_request(GPIO_FN_STATUS2, NULL); |