diff options
author | Magnus Damm <damm@opensource.se> | 2009-10-29 06:52:15 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-29 22:59:26 -0400 |
commit | 67e522d0f91349127b3e0e536578be484cdb3367 (patch) | |
tree | 5fc3a227aaf681509995c629e7b3835a33eb15f0 /arch/sh/boards | |
parent | 159f8cd99ea0e3613cbb6aeea574af438f33d8d7 (diff) |
sh: Add kfr2r09 specific memory pre/post sleep code
Add self-refresh handling code for the KFR2R09 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-kfr2r09/Makefile | 2 | ||||
-rw-r--r-- | arch/sh/boards/mach-kfr2r09/sdram.S | 52 | ||||
-rw-r--r-- | arch/sh/boards/mach-kfr2r09/setup.c | 13 |
3 files changed, 66 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-kfr2r09/Makefile b/arch/sh/boards/mach-kfr2r09/Makefile index 5d5867826e3b..4e577a3bf658 100644 --- a/arch/sh/boards/mach-kfr2r09/Makefile +++ b/arch/sh/boards/mach-kfr2r09/Makefile | |||
@@ -1,2 +1,2 @@ | |||
1 | obj-y := setup.o | 1 | obj-y := setup.o sdram.o |
2 | obj-$(CONFIG_FB_SH_MOBILE_LCDC) += lcd_wqvga.o | 2 | obj-$(CONFIG_FB_SH_MOBILE_LCDC) += lcd_wqvga.o |
diff --git a/arch/sh/boards/mach-kfr2r09/sdram.S b/arch/sh/boards/mach-kfr2r09/sdram.S new file mode 100644 index 000000000000..4ce78fcf5674 --- /dev/null +++ b/arch/sh/boards/mach-kfr2r09/sdram.S | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * KFR2R09 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(kfr2r09_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(kfr2r09_sdram_enter_end) | ||
36 | |||
37 | .balign 4 | ||
38 | ENTRY(kfr2r09_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(kfr2r09_sdram_leave_end) | ||
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index 43d75ee93358..5dae632092f2 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <media/soc_camera.h> | 21 | #include <media/soc_camera.h> |
22 | #include <media/sh_mobile_ceu.h> | 22 | #include <media/sh_mobile_ceu.h> |
23 | #include <video/sh_mobile_lcdc.h> | 23 | #include <video/sh_mobile_lcdc.h> |
24 | #include <asm/suspend.h> | ||
24 | #include <asm/clock.h> | 25 | #include <asm/clock.h> |
25 | #include <asm/machvec.h> | 26 | #include <asm/machvec.h> |
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
@@ -444,8 +445,20 @@ static int kfr2r09_usb0_gadget_setup(void) | |||
444 | return 0; | 445 | return 0; |
445 | } | 446 | } |
446 | 447 | ||
448 | extern char kfr2r09_sdram_enter_start; | ||
449 | extern char kfr2r09_sdram_enter_end; | ||
450 | extern char kfr2r09_sdram_leave_start; | ||
451 | extern char kfr2r09_sdram_leave_end; | ||
452 | |||
447 | static int __init kfr2r09_devices_setup(void) | 453 | static int __init kfr2r09_devices_setup(void) |
448 | { | 454 | { |
455 | /* register board specific self-refresh code */ | ||
456 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, | ||
457 | &kfr2r09_sdram_enter_start, | ||
458 | &kfr2r09_sdram_enter_end, | ||
459 | &kfr2r09_sdram_leave_start, | ||
460 | &kfr2r09_sdram_leave_end); | ||
461 | |||
449 | /* enable SCIF1 serial port for YC401 console support */ | 462 | /* enable SCIF1 serial port for YC401 console support */ |
450 | gpio_request(GPIO_FN_SCIF1_RXD, NULL); | 463 | gpio_request(GPIO_FN_SCIF1_RXD, NULL); |
451 | gpio_request(GPIO_FN_SCIF1_TXD, NULL); | 464 | gpio_request(GPIO_FN_SCIF1_TXD, NULL); |