1 /* SPDX-License-Identifier: GPL-2.0
3 * Ecovec24 sdram self/auto-refresh setup code
5 * Copyright (C) 2009 Magnus Damm
9 #include <linux/errno.h>
10 #include <linux/linkage.h>
11 #include <asm/asm-offsets.h>
12 #include <asm/suspend.h>
13 #include <asm/romimage-macros.h>
15 /* code to enter and leave self-refresh. must be self-contained.
16 * this code will be copied to on-chip memory and executed from there.
19 ENTRY(ecovec24_sdram_enter_start)
21 /* DBSC: put memory in self-refresh mode */
23 ED 0xFD000010, 0x00000000 /* DBEN */
24 ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
25 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
26 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
27 ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
32 ENTRY(ecovec24_sdram_enter_end)
35 ENTRY(ecovec24_sdram_leave_start)
37 mov.l @(SH_SLEEP_MODE, r5), r0
38 tst #SUSP_SH_RSTANDBY, r0
41 /* DBSC: put memory in auto-refresh mode */
43 ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
45 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
46 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
47 ED 0xFD000010, 0x00000001 /* DBEN */
48 ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
55 /* DBSC: re-initialize and put in auto-refresh */
57 ED 0xFD000108, 0x00000181 /* DBPDCNT0 */
58 ED 0xFD000020, 0x015B0002 /* DBCONF */
59 ED 0xFD000030, 0x03071502 /* DBTR0 */
60 ED 0xFD000034, 0x02020102 /* DBTR1 */
61 ED 0xFD000038, 0x01090405 /* DBTR2 */
62 ED 0xFD00003C, 0x00000002 /* DBTR3 */
63 ED 0xFD000008, 0x00000005 /* DBKIND */
64 ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
65 ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
66 ED 0xFD000018, 0x00000001 /* DBCKECNT */
73 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
74 ED 0xFD000060, 0x00020000 /* DBMRCNT (EMR2) */
75 ED 0xFD000060, 0x00030000 /* DBMRCNT (EMR3) */
76 ED 0xFD000060, 0x00010004 /* DBMRCNT (EMR) */
77 ED 0xFD000060, 0x00000532 /* DBMRCNT (MRS) */
78 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
79 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
80 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
81 ED 0xFD000060, 0x00000432 /* DBMRCNT (MRS) */
82 ED 0xFD000060, 0x000103c0 /* DBMRCNT (EMR) */
83 ED 0xFD000060, 0x00010040 /* DBMRCNT (EMR) */
90 ED 0xFD000010, 0x00000001 /* DBEN */
91 ED 0xFD000044, 0x0000050f /* DBRFPDN1 */
92 ED 0xFD000048, 0x236800e6 /* DBRFPDN2 */
95 mov.l @r0, r1 /* force single dummy read */
97 ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
98 ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
99 ED 0xFD000108, 0x00000080 /* DBPDCNT0 */
100 ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
106 DUMMY: .long 0xac400000
108 ENTRY(ecovec24_sdram_leave_end)