Path: blob/master/arch/sh/boards/mach-ecovec24/sdram.S
15126 views
/*1* Ecovec24 sdram self/auto-refresh setup code2*3* Copyright (C) 2009 Magnus Damm4*5* This file is subject to the terms and conditions of the GNU General Public6* License. See the file "COPYING" in the main directory of this archive7* for more details.8*/910#include <linux/sys.h>11#include <linux/errno.h>12#include <linux/linkage.h>13#include <asm/asm-offsets.h>14#include <asm/suspend.h>15#include <asm/romimage-macros.h>1617/* code to enter and leave self-refresh. must be self-contained.18* this code will be copied to on-chip memory and executed from there.19*/20.balign 421ENTRY(ecovec24_sdram_enter_start)2223/* DBSC: put memory in self-refresh mode */2425ED 0xFD000010, 0x00000000 /* DBEN */26ED 0xFD000040, 0x00000000 /* DBRFPDN0 */27ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */28ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */29ED 0xFD000040, 0x00000001 /* DBRFPDN0 */3031rts32nop3334ENTRY(ecovec24_sdram_enter_end)3536.balign 437ENTRY(ecovec24_sdram_leave_start)3839mov.l @(SH_SLEEP_MODE, r5), r040tst #SUSP_SH_RSTANDBY, r041bf resume_rstandby4243/* DBSC: put memory in auto-refresh mode */4445ED 0xFD000040, 0x00000000 /* DBRFPDN0 */46WAIT 147ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */48ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */49ED 0xFD000010, 0x00000001 /* DBEN */50ED 0xFD000040, 0x00010000 /* DBRFPDN0 */5152rts53nop5455resume_rstandby:5657/* DBSC: re-initialize and put in auto-refresh */5859ED 0xFD000108, 0x00000181 /* DBPDCNT0 */60ED 0xFD000020, 0x015B0002 /* DBCONF */61ED 0xFD000030, 0x03071502 /* DBTR0 */62ED 0xFD000034, 0x02020102 /* DBTR1 */63ED 0xFD000038, 0x01090405 /* DBTR2 */64ED 0xFD00003C, 0x00000002 /* DBTR3 */65ED 0xFD000008, 0x00000005 /* DBKIND */66ED 0xFD000040, 0x00000001 /* DBRFPDN0 */67ED 0xFD000040, 0x00000000 /* DBRFPDN0 */68ED 0xFD000018, 0x00000001 /* DBCKECNT */6970mov #100,r071WAIT_400NS:72dt r073bf WAIT_400NS7475ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */76ED 0xFD000060, 0x00020000 /* DBMRCNT (EMR2) */77ED 0xFD000060, 0x00030000 /* DBMRCNT (EMR3) */78ED 0xFD000060, 0x00010004 /* DBMRCNT (EMR) */79ED 0xFD000060, 0x00000532 /* DBMRCNT (MRS) */80ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */81ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */82ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */83ED 0xFD000060, 0x00000432 /* DBMRCNT (MRS) */84ED 0xFD000060, 0x000103c0 /* DBMRCNT (EMR) */85ED 0xFD000060, 0x00010040 /* DBMRCNT (EMR) */8687mov #100,r088WAIT_400NS_2:89dt r090bf WAIT_400NS_29192ED 0xFD000010, 0x00000001 /* DBEN */93ED 0xFD000044, 0x0000050f /* DBRFPDN1 */94ED 0xFD000048, 0x236800e6 /* DBRFPDN2 */9596mov.l DUMMY,r097mov.l @r0, r1 /* force single dummy read */9899ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */100ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */101ED 0xFD000108, 0x00000080 /* DBPDCNT0 */102ED 0xFD000040, 0x00010000 /* DBRFPDN0 */103104rts105nop106107.balign 4108DUMMY: .long 0xac400000109110ENTRY(ecovec24_sdram_leave_end)111112113