From patchwork Thu Oct 29 10:52:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 56449 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9TAue7h016657 for ; Thu, 29 Oct 2009 10:57:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753910AbZJ2K5Q (ORCPT ); Thu, 29 Oct 2009 06:57:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754056AbZJ2K5Q (ORCPT ); Thu, 29 Oct 2009 06:57:16 -0400 Received: from mail-gx0-f216.google.com ([209.85.217.216]:59160 "EHLO mail-gx0-f216.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753910AbZJ2K5P (ORCPT ); Thu, 29 Oct 2009 06:57:15 -0400 Received: by gxk8 with SMTP id 8so2034676gxk.1 for ; Thu, 29 Oct 2009 03:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=1nyPGPBSUU3AmI3KA0Dle7mU2r9/lV4xMWXLH8XwR+8=; b=ULTCWejkVSoUpASj55ywQP8k20PiTsHeEmPtRiw0bk0juG8UkrVyueEp4e/HjNy/fX XKjd25UzF6IW55rlDdElvwK0tqYGabuVzct8WS9/q8WoCCjSTtSTUCNIr9oAhzDIibjm 6ex6znJSbwaAT86OQlE3bWSLtKN3a2XwkQfhI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=qg56qBXPZNS3hracKCx1+f0tbhP0HngT1y76VCKmF01FsFhI0aLPyTsRzlRPxp/xmU 0uyQn2ptdCdJUbXW5sexcRgo+87Eued6mQ+soJ3feR9q12laH/RarPHfnSB7FM5xsKBj G+o3bxR/uyVItC/MhCPLmhiolU4gvmxjS7y4s= Received: by 10.150.16.14 with SMTP id 14mr1308294ybp.246.1256813840517; Thu, 29 Oct 2009 03:57:20 -0700 (PDT) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 22sm695049ywh.15.2009.10.29.03.57.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 03:57:20 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Thu, 29 Oct 2009 19:52:23 +0900 Message-Id: <20091029105223.29078.85437.sendpatchset@rxone.opensource.se> In-Reply-To: <20091029105131.29078.26418.sendpatchset@rxone.opensource.se> References: <20091029105131.29078.26418.sendpatchset@rxone.opensource.se> Subject: [PATCH 06/07] sh: Add ms7724se specific memory pre/post sleep code Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0001/arch/sh/boards/mach-se/7724/Makefile +++ work/arch/sh/boards/mach-se/7724/Makefile 2009-10-29 18:08:47.000000000 +0900 @@ -7,4 +7,4 @@ # # -obj-y := setup.o irq.o \ No newline at end of file +obj-y := setup.o irq.o sdram.o --- /dev/null +++ work/arch/sh/boards/mach-se/7724/sdram.S 2009-10-29 18:12:13.000000000 +0900 @@ -0,0 +1,52 @@ +/* + * MS7724SE sdram self/auto-refresh setup code + * + * Copyright (C) 2009 Magnus Damm + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#include +#include +#include +#include +#include +#include + +/* code to enter and leave self-refresh. must be self-contained. + * this code will be copied to on-chip memory and executed from there. + */ + .balign 4 +ENTRY(ms7724se_sdram_enter_start) + + /* DBSC: put memory in self-refresh mode */ + + ED 0xFD000010, 0x00000000 /* DBEN */ + ED 0xFD000040, 0x00000000 /* DBRFPDN0 */ + ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */ + ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */ + ED 0xFD000040, 0x00000001 /* DBRFPDN0 */ + + rts + nop + +ENTRY(ms7724se_sdram_enter_end) + + .balign 4 +ENTRY(ms7724se_sdram_leave_start) + + /* DBSC: put memory in auto-refresh mode */ + + ED 0xFD000040, 0x00000000 /* DBRFPDN0 */ + WAIT 1 + ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */ + ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */ + ED 0xFD000010, 0x00000001 /* DBEN */ + ED 0xFD000040, 0x00010000 /* DBRFPDN0 */ + + rts + nop + +ENTRY(ms7724se_sdram_leave_end) --- 0001/arch/sh/boards/mach-se/7724/setup.c +++ work/arch/sh/boards/mach-se/7724/setup.c 2009-10-29 18:14:18.000000000 +0900 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -566,11 +567,22 @@ static void __init sh_eth_init(void) #define SW41_G 0x4000 #define SW41_H 0x8000 +extern char ms7724se_sdram_enter_start; +extern char ms7724se_sdram_enter_end; +extern char ms7724se_sdram_leave_start; +extern char ms7724se_sdram_leave_end; + static int __init devices_setup(void) { u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ struct clk *fsia_clk; + /* register board specific self-refresh code */ + sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, + &ms7724se_sdram_enter_start, + &ms7724se_sdram_enter_end, + &ms7724se_sdram_leave_start, + &ms7724se_sdram_leave_end); /* Reset Release */ ctrl_outw(ctrl_inw(FPGA_OUT) & ~((1 << 1) | /* LAN */