From patchwork Fri Oct 30 04:23:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 56556 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 n9U4Soe3030451 for ; Fri, 30 Oct 2009 04:28:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbZJ3E2p (ORCPT ); Fri, 30 Oct 2009 00:28:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752435AbZJ3E2p (ORCPT ); Fri, 30 Oct 2009 00:28:45 -0400 Received: from mail-yw0-f202.google.com ([209.85.211.202]:61348 "EHLO mail-yw0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbZJ3E2o (ORCPT ); Fri, 30 Oct 2009 00:28:44 -0400 Received: by mail-yw0-f202.google.com with SMTP id 40so2375906ywh.33 for ; Thu, 29 Oct 2009 21:28:49 -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=SSL4rNAHRaWyU4G8evwC+2N0QX8ZcMVIuwlEskFSSfg=; b=QDq+9ck8ihnRsB8bOHm/+AiUj+oB2uALzQopCns5Tjfs4uBLikCDbNlOirHvGaj2Ps MzQlyGkGuLYZLW/na/164QsiXemXzjvyyCFHlzNDsWbXD9LwAzPCqdASjcPRsblrqCpe SfbKmnwmWZh323ryc2foHt8wErCj1CsnOCH8s= 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=OV5n+tzaDHj0A1B6Ag2j78Vyca6BPl3DGsM9h2nz/Y1HDTqJYACK2sIXtZ5+uuSZ+2 rPekk58V054WYenVhC8Gpo+ynA4wWYIpBGO4gMEjxTaxqgmhmRCoU6ZkIQ/ERFnPe0He nn/3gUIF2isMGFxHMHg8TaWZOYaz7cd0A3dAw= Received: by 10.91.18.5 with SMTP id v5mr2898316agi.91.1256876929212; Thu, 29 Oct 2009 21:28:49 -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 34sm1209084yxf.47.2009.10.29.21.28.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Oct 2009 21:28:48 -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:51 +0900 Message-Id: <20091030042351.11783.58274.sendpatchset@rxone.opensource.se> In-Reply-To: <20091030042331.11783.88942.sendpatchset@rxone.opensource.se> References: <20091030042331.11783.88942.sendpatchset@rxone.opensource.se> Subject: [PATCH 02/09] sh: Add ap325rxa 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 --- 0002/arch/sh/boards/mach-ap325rxa/Makefile +++ work/arch/sh/boards/mach-ap325rxa/Makefile 2009-10-30 12:17:18.000000000 +0900 @@ -1,2 +1,2 @@ -obj-y := setup.o +obj-y := setup.o sdram.o --- /dev/null +++ work/arch/sh/boards/mach-ap325rxa/sdram.S 2009-10-30 12:13:19.000000000 +0900 @@ -0,0 +1,69 @@ +/* + * AP325RXA 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(ap325rxa_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(ap325rxa_sdram_enter_end) + + .balign 4 +ENTRY(ap325rxa_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(ap325rxa_sdram_leave_end) --- 0002/arch/sh/boards/mach-ap325rxa/setup.c +++ work/arch/sh/boards/mach-ap325rxa/setup.c 2009-10-30 12:14:50.000000000 +0900 @@ -27,6 +27,7 @@ #include