aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2009-10-29 06:52:23 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-10-29 22:59:26 -0400
commit3b9f2952a3eda738f5f2d7610b76e284cbac581f (patch)
tree23937cebe892efcb3d5d8767c0b5606f61aece4a /arch
parent67e522d0f91349127b3e0e536578be484cdb3367 (diff)
sh: Add ms7724se specific memory pre/post sleep code
Add self-refresh handling code for the MS7724SE board. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/boards/mach-se/7724/Makefile2
-rw-r--r--arch/sh/boards/mach-se/7724/sdram.S52
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c12
3 files changed, 65 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-se/7724/Makefile b/arch/sh/boards/mach-se/7724/Makefile
index 349cbd6ce82d..a08b36830f0e 100644
--- a/arch/sh/boards/mach-se/7724/Makefile
+++ b/arch/sh/boards/mach-se/7724/Makefile
@@ -7,4 +7,4 @@
7# 7#
8# 8#
9 9
10obj-y := setup.o irq.o \ No newline at end of file 10obj-y := setup.o irq.o sdram.o
diff --git a/arch/sh/boards/mach-se/7724/sdram.S b/arch/sh/boards/mach-se/7724/sdram.S
new file mode 100644
index 000000000000..9040167d5022
--- /dev/null
+++ b/arch/sh/boards/mach-se/7724/sdram.S
@@ -0,0 +1,52 @@
1/*
2 * MS7724SE 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
22ENTRY(ms7724se_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
35ENTRY(ms7724se_sdram_enter_end)
36
37 .balign 4
38ENTRY(ms7724se_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
52ENTRY(ms7724se_sdram_leave_end)
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index ffb97f22783c..ae23fa970e6d 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -28,6 +28,7 @@
28#include <asm/sh_eth.h> 28#include <asm/sh_eth.h>
29#include <asm/clock.h> 29#include <asm/clock.h>
30#include <asm/sh_keysc.h> 30#include <asm/sh_keysc.h>
31#include <asm/suspend.h>
31#include <cpu/sh7724.h> 32#include <cpu/sh7724.h>
32#include <mach-se/mach/se7724.h> 33#include <mach-se/mach/se7724.h>
33 34
@@ -566,11 +567,22 @@ static void __init sh_eth_init(void)
566#define SW41_G 0x4000 567#define SW41_G 0x4000
567#define SW41_H 0x8000 568#define SW41_H 0x8000
568 569
570extern char ms7724se_sdram_enter_start;
571extern char ms7724se_sdram_enter_end;
572extern char ms7724se_sdram_leave_start;
573extern char ms7724se_sdram_leave_end;
574
569static int __init devices_setup(void) 575static int __init devices_setup(void)
570{ 576{
571 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ 577 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */
572 struct clk *fsia_clk; 578 struct clk *fsia_clk;
573 579
580 /* register board specific self-refresh code */
581 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF,
582 &ms7724se_sdram_enter_start,
583 &ms7724se_sdram_enter_end,
584 &ms7724se_sdram_leave_start,
585 &ms7724se_sdram_leave_end);
574 /* Reset Release */ 586 /* Reset Release */
575 ctrl_outw(ctrl_inw(FPGA_OUT) & 587 ctrl_outw(ctrl_inw(FPGA_OUT) &
576 ~((1 << 1) | /* LAN */ 588 ~((1 << 1) | /* LAN */