/* SPDX-License-Identifier: GPL-2.01*2* KFR2R09 sdram self/auto-refresh setup code3*4* Copyright (C) 2009 Magnus Damm5*/67#include <linux/sys.h>8#include <linux/errno.h>9#include <linux/linkage.h>10#include <asm/asm-offsets.h>11#include <asm/suspend.h>12#include <asm/romimage-macros.h>1314/* code to enter and leave self-refresh. must be self-contained.15* this code will be copied to on-chip memory and executed from there.16*/17.balign 418ENTRY(kfr2r09_sdram_enter_start)1920/* DBSC: put memory in self-refresh mode */2122ED 0xFD000010, 0x00000000 /* DBEN */23ED 0xFD000040, 0x00000000 /* DBRFPDN0 */24ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */25ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */26ED 0xFD000040, 0x00000001 /* DBRFPDN0 */2728rts29nop3031ENTRY(kfr2r09_sdram_enter_end)3233.balign 434ENTRY(kfr2r09_sdram_leave_start)3536/* DBSC: put memory in auto-refresh mode */3738mov.l @(SH_SLEEP_MODE, r5), r039tst #SUSP_SH_RSTANDBY, r040bf resume_rstandby4142ED 0xFD000040, 0x00000000 /* DBRFPDN0 */43WAIT 144ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */45ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */46ED 0xFD000010, 0x00000001 /* DBEN */47ED 0xFD000040, 0x00010000 /* DBRFPDN0 */4849rts50nop5152resume_rstandby:5354/* DBSC: re-initialize and put in auto-refresh */5556ED 0xFD000108, 0x40000301 /* DBPDCNT0 */57ED 0xFD000020, 0x011B0002 /* DBCONF */58ED 0xFD000030, 0x03060E02 /* DBTR0 */59ED 0xFD000034, 0x01020102 /* DBTR1 */60ED 0xFD000038, 0x01090406 /* DBTR2 */61ED 0xFD000008, 0x00000004 /* DBKIND */62ED 0xFD000040, 0x00000001 /* DBRFPDN0 */63ED 0xFD000040, 0x00000000 /* DBRFPDN0 */64ED 0xFD000018, 0x00000001 /* DBCKECNT */65WAIT 166ED 0xFD000010, 0x00000001 /* DBEN */67ED 0xFD000044, 0x000004AF /* DBRFPDN1 */68ED 0xFD000048, 0x20CF0037 /* DBRFPDN2 */69ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */70ED 0xFD000108, 0x40000300 /* DBPDCNT0 */71ED 0xFD000040, 0x00010000 /* DBRFPDN0 */7273rts74nop7576ENTRY(kfr2r09_sdram_leave_end)777879