From patchwork Fri Oct 30 04:23:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 56557 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 n9U4Soe4030451 for ; Fri, 30 Oct 2009 04:28:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435AbZJ3E2w (ORCPT ); Fri, 30 Oct 2009 00:28:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752526AbZJ3E2w (ORCPT ); Fri, 30 Oct 2009 00:28:52 -0400 Received: from mail-yx0-f187.google.com ([209.85.210.187]:46526 "EHLO mail-yx0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752435AbZJ3E2w (ORCPT ); Fri, 30 Oct 2009 00:28:52 -0400 Received: by mail-yx0-f187.google.com with SMTP id 17so2380788yxe.33 for ; Thu, 29 Oct 2009 21:28:57 -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=i+1FPfyI5LpStin6AFiy0PD5oNbujcJWEL4Lc7rczsk=; b=naglnUu+MzHApoMezhbsIjRbPV8Lr04YKTMT7biiuXH/EA666U0eg8pFpM08RhJVnZ spcNTzmnTueYOHpwf2B+EmVKTEwOnkUl1lTQX3DIZsaFkj2vMmTQuiqaAxAj/LTc8F0w irU+qE8MLzq55FjoP5LiSCWuh2DoHFW+/oCrc= 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=jCxtqg40Cf1w3CYf7k7kG3yNMMfdv1KEmascPu92BvZxHBDHuGTWcntx4PTxIaWzo1 iyYVtS6qqwKK/XkD5AHFwUChOf9c9u5O+nlW11lFC+XqzZjaZI8hFWbH47DmxzD5sL5l DMEZbyu1q+ajnvwxf6I2y5qYK4G2KRInEISjw= Received: by 10.90.217.11 with SMTP id p11mr2855151agg.82.1256876937271; Thu, 29 Oct 2009 21:28:57 -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 5sm1203008yxg.64.2009.10.29.21.28.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 21:28:56 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Fri, 30 Oct 2009 13:23:59 +0900 Message-Id: <20091030042359.11783.23483.sendpatchset@rxone.opensource.se> In-Reply-To: <20091030042331.11783.88942.sendpatchset@rxone.opensource.se> References: <20091030042331.11783.88942.sendpatchset@rxone.opensource.se> Subject: [PATCH 03/09] sh: Add Ecovec24 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-ecovec24/Makefile +++ work/arch/sh/boards/mach-ecovec24/Makefile 2009-10-30 12:51:03.000000000 +0900 @@ -6,4 +6,4 @@ # for more details. # -obj-y := setup.o \ No newline at end of file +obj-y := setup.o sdram.o \ No newline at end of file --- /dev/null +++ work/arch/sh/boards/mach-ecovec24/sdram.S 2009-10-30 12:49:39.000000000 +0900 @@ -0,0 +1,52 @@ +/* + * Ecovec24 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(ecovec24_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(ecovec24_sdram_enter_end) + + .balign 4 +ENTRY(ecovec24_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(ecovec24_sdram_leave_end) --- 0001/arch/sh/boards/mach-ecovec24/setup.c +++ work/arch/sh/boards/mach-ecovec24/setup.c 2009-10-30 12:50:48.000000000 +0900 @@ -26,6 +26,7 @@ #include #include #include +#include #include /* @@ -526,8 +527,21 @@ static void __init sh_eth_init(struct sh #define PORT_HIZA 0xA4050158 #define IODRIVEA 0xA405018A + +extern char ecovec24_sdram_enter_start; +extern char ecovec24_sdram_enter_end; +extern char ecovec24_sdram_leave_start; +extern char ecovec24_sdram_leave_end; + static int __init arch_setup(void) { + /* register board specific self-refresh code */ + sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, + &ecovec24_sdram_enter_start, + &ecovec24_sdram_enter_end, + &ecovec24_sdram_leave_start, + &ecovec24_sdram_leave_end); + /* enable STATUS0, STATUS2 and PDSTATUS */ gpio_request(GPIO_FN_STATUS0, NULL); gpio_request(GPIO_FN_STATUS2, NULL);