From patchwork Thu Oct 29 10:52:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 56450 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 n9TAue7i016657 for ; Thu, 29 Oct 2009 10:57:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754056AbZJ2K5Y (ORCPT ); Thu, 29 Oct 2009 06:57:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754076AbZJ2K5Y (ORCPT ); Thu, 29 Oct 2009 06:57:24 -0400 Received: from mail-yx0-f187.google.com ([209.85.210.187]:61187 "EHLO mail-yx0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754056AbZJ2K5X (ORCPT ); Thu, 29 Oct 2009 06:57:23 -0400 Received: by mail-yx0-f187.google.com with SMTP id 17so1523692yxe.33 for ; Thu, 29 Oct 2009 03:57:28 -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=Gry4nQxLmHX96HcTV0CR9N3o5LK3CkBQq7ycXXMlkJc=; b=Yd60XFPFe0PWNrdUkYITl/5r+N4rbyy2Wqo18Zm1GLclaiXFfOnOCCHdqtEssrlGbl mAmzB5wsUPpZyZE8MlipBENYybNA8g4CYlpp+qp6aNxzyMH3NFt87mchwnDCHcaoV9A0 zRSHPTp3iGcfNXCekaDI8s9vmX2z/SVDj3qug= 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=p6Y0+u2404YCBNokpifVYSsKAYu1yiBNO8dybe3FQLe5dljw4ELP4gNGq4jI3UYdyO q9qSsCC3pydEsrx01WnVwa84lpzBKN28iBxwiVxbHL/g6E85NARmPEZ/khBshYmBdbaN Dn955rxIsfC/64IwdHGh/KrlsYvhTJkLr+c6w= Received: by 10.151.92.9 with SMTP id u9mr14758ybl.158.1256813848580; Thu, 29 Oct 2009 03:57:28 -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 8sm698319ywg.4.2009.10.29.03.57.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 03:57:28 -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:31 +0900 Message-Id: <20091029105231.29078.66383.sendpatchset@rxone.opensource.se> In-Reply-To: <20091029105131.29078.26418.sendpatchset@rxone.opensource.se> References: <20091029105131.29078.26418.sendpatchset@rxone.opensource.se> Subject: [PATCH 07/07] sh: Add migor 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-migor/Makefile +++ work/arch/sh/boards/mach-migor/Makefile 2009-10-29 19:09:03.000000000 +0900 @@ -1,2 +1,2 @@ -obj-y := setup.o +obj-y := setup.o sdram.o obj-$(CONFIG_SH_MIGOR_QVGA) += lcd_qvga.o --- /dev/null +++ work/arch/sh/boards/mach-migor/sdram.S 2009-10-29 19:14:42.000000000 +0900 @@ -0,0 +1,69 @@ +/* + * Migo-R 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(migor_sdram_enter_start) + + /* SBSC: disable power down and put in self-refresh mode */ + mov.l 1f, r4 + mov.l 2f, r1 + mov.l @r4, r2 + or r1, r2 + mov.l 3f, r3 + and r3, r2 + mov.l r2, @r4 + + rts + nop + + .balign 4 +1: .long 0xfe400008 /* SDCR0 */ +2: .long 0x00000400 +3: .long 0xffff7fff +ENTRY(migor_sdram_enter_end) + + .balign 4 +ENTRY(migor_sdram_leave_start) + + /* SBSC: set auto-refresh mode */ + mov.l 1f, r4 + mov.l @r4, r0 + mov.l 4f, r1 + and r1, r0 + mov.l r0, @r4 + mov.l 6f, r4 + mov.l 8f, r0 + mov.l @r4, r1 + mov #-1, r4 + add r4, r1 + or r1, r0 + mov.l 7f, r1 + mov.l r0, @r1 + + rts + nop + + .balign 4 +1: .long 0xfe400008 /* SDCR0 */ +4: .long 0xfffffbff +6: .long 0xfe40001c /* RTCOR */ +7: .long 0xfe400018 /* RTCNT */ +8: .long 0xa55a0000 +ENTRY(migor_sdram_leave_end) --- 0001/arch/sh/boards/mach-migor/setup.c +++ work/arch/sh/boards/mach-migor/setup.c 2009-10-29 19:13:53.000000000 +0900 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -478,9 +479,19 @@ static struct platform_device *migor_dev &migor_camera[1], }; +extern char migor_sdram_enter_start; +extern char migor_sdram_enter_end; +extern char migor_sdram_leave_start; +extern char migor_sdram_leave_end; + static int __init migor_devices_setup(void) { - + /* register board specific self-refresh code */ + sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, + &migor_sdram_enter_start, + &migor_sdram_enter_end, + &migor_sdram_leave_start, + &migor_sdram_leave_end); #ifdef CONFIG_PM /* Let D11 LED show STATUS0 */ gpio_request(GPIO_FN_STATUS0, NULL);