xref: /linux/arch/sh/boards/mach-ecovec24/sdram.S (revision eb0cd9e88c6a6561055b32a17d44d8918aecc3c7)
1*eb0cd9e8SMagnus Damm/*
2*eb0cd9e8SMagnus Damm * Ecovec24 sdram self/auto-refresh setup code
3*eb0cd9e8SMagnus Damm *
4*eb0cd9e8SMagnus Damm *  Copyright (C) 2009 Magnus Damm
5*eb0cd9e8SMagnus Damm *
6*eb0cd9e8SMagnus Damm * This file is subject to the terms and conditions of the GNU General Public
7*eb0cd9e8SMagnus Damm * License.  See the file "COPYING" in the main directory of this archive
8*eb0cd9e8SMagnus Damm * for more details.
9*eb0cd9e8SMagnus Damm */
10*eb0cd9e8SMagnus Damm
11*eb0cd9e8SMagnus Damm#include <linux/sys.h>
12*eb0cd9e8SMagnus Damm#include <linux/errno.h>
13*eb0cd9e8SMagnus Damm#include <linux/linkage.h>
14*eb0cd9e8SMagnus Damm#include <asm/asm-offsets.h>
15*eb0cd9e8SMagnus Damm#include <asm/suspend.h>
16*eb0cd9e8SMagnus Damm#include <asm/romimage-macros.h>
17*eb0cd9e8SMagnus Damm
18*eb0cd9e8SMagnus Damm/* code to enter and leave self-refresh. must be self-contained.
19*eb0cd9e8SMagnus Damm * this code will be copied to on-chip memory and executed from there.
20*eb0cd9e8SMagnus Damm */
21*eb0cd9e8SMagnus Damm	.balign 4
22*eb0cd9e8SMagnus DammENTRY(ecovec24_sdram_enter_start)
23*eb0cd9e8SMagnus Damm
24*eb0cd9e8SMagnus Damm	/* DBSC: put memory in self-refresh mode */
25*eb0cd9e8SMagnus Damm
26*eb0cd9e8SMagnus Damm	ED 0xFD000010, 0x00000000 /* DBEN */
27*eb0cd9e8SMagnus Damm	ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
28*eb0cd9e8SMagnus Damm	ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
29*eb0cd9e8SMagnus Damm	ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
30*eb0cd9e8SMagnus Damm	ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
31*eb0cd9e8SMagnus Damm
32*eb0cd9e8SMagnus Damm	rts
33*eb0cd9e8SMagnus Damm	 nop
34*eb0cd9e8SMagnus Damm
35*eb0cd9e8SMagnus DammENTRY(ecovec24_sdram_enter_end)
36*eb0cd9e8SMagnus Damm
37*eb0cd9e8SMagnus Damm	.balign 4
38*eb0cd9e8SMagnus DammENTRY(ecovec24_sdram_leave_start)
39*eb0cd9e8SMagnus Damm
40*eb0cd9e8SMagnus Damm	/* DBSC: put memory in auto-refresh mode */
41*eb0cd9e8SMagnus Damm
42*eb0cd9e8SMagnus Damm	ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
43*eb0cd9e8SMagnus Damm	WAIT 1
44*eb0cd9e8SMagnus Damm	ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
45*eb0cd9e8SMagnus Damm	ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
46*eb0cd9e8SMagnus Damm	ED 0xFD000010, 0x00000001 /* DBEN */
47*eb0cd9e8SMagnus Damm	ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
48*eb0cd9e8SMagnus Damm
49*eb0cd9e8SMagnus Damm	rts
50*eb0cd9e8SMagnus Damm	 nop
51*eb0cd9e8SMagnus Damm
52*eb0cd9e8SMagnus DammENTRY(ecovec24_sdram_leave_end)
53