Path: blob/master/arch/sh/boards/mach-kfr2r09/sdram.S
15126 views
/*1* KFR2R09 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(kfr2r09_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(kfr2r09_sdram_enter_end)3536.balign 437ENTRY(kfr2r09_sdram_leave_start)3839/* DBSC: put memory in auto-refresh mode */4041mov.l @(SH_SLEEP_MODE, r5), r042tst #SUSP_SH_RSTANDBY, r043bf resume_rstandby4445ED 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, 0x40000301 /* DBPDCNT0 */60ED 0xFD000020, 0x011B0002 /* DBCONF */61ED 0xFD000030, 0x03060E02 /* DBTR0 */62ED 0xFD000034, 0x01020102 /* DBTR1 */63ED 0xFD000038, 0x01090406 /* DBTR2 */64ED 0xFD000008, 0x00000004 /* DBKIND */65ED 0xFD000040, 0x00000001 /* DBRFPDN0 */66ED 0xFD000040, 0x00000000 /* DBRFPDN0 */67ED 0xFD000018, 0x00000001 /* DBCKECNT */68WAIT 169ED 0xFD000010, 0x00000001 /* DBEN */70ED 0xFD000044, 0x000004AF /* DBRFPDN1 */71ED 0xFD000048, 0x20CF0037 /* DBRFPDN2 */72ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */73ED 0xFD000108, 0x40000300 /* DBPDCNT0 */74ED 0xFD000040, 0x00010000 /* DBRFPDN0 */7576rts77nop7879ENTRY(kfr2r09_sdram_leave_end)808182