From patchwork Mon Nov 2 09:31:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 56953 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 nA29aFmU009129 for ; Mon, 2 Nov 2009 09:36:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753934AbZKBJgI (ORCPT ); Mon, 2 Nov 2009 04:36:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754047AbZKBJgI (ORCPT ); Mon, 2 Nov 2009 04:36:08 -0500 Received: from mail-yw0-f202.google.com ([209.85.211.202]:61865 "EHLO mail-yw0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753934AbZKBJgH (ORCPT ); Mon, 2 Nov 2009 04:36:07 -0500 Received: by ywh40 with SMTP id 40so4335578ywh.33 for ; Mon, 02 Nov 2009 01:36:12 -0800 (PST) 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 :subject; bh=vL9xNiylek3ii4SyQDnJmczy2EmDYMXUMMPrKpsLk1k=; b=bCgDrZsAW3Tn6g3qJt6gBnEf44u1Qhu6c4/EzvXNyzlKP7Q4VzChZhg4jzTDkdxhnD IyrZc9hI/f/LT6QQljAqzLRUbVFNGnyvhciHxIiRogdC2NnU9rUEdDQOFe4ZuTzo2eGO V9ZvPjkF6Jw8QFxRHTdXnCgRSQZt8V36orAgk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=QwvT1WOGG7rebKcapodB5lgwI7kBlGefJE9kkOkAvKghbrZKbs+kpuljh804WVkgSD ARNO8PvwkD3DCqAKUdd1yPoGFIGxJlIIbs2mFBxB2Sqx2KTzqtttkDMRcQy/9nYeXJAP Z9LuE1m8R/RMFUcy/NKUjbWtLS166PN0ZHtPM= Received: by 10.150.47.12 with SMTP id u12mr7578932ybu.332.1257154568024; Mon, 02 Nov 2009 01:36:08 -0800 (PST) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 14sm1088520gxk.14.2009.11.02.01.36.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 01:36:07 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Mon, 02 Nov 2009 18:31:03 +0900 Message-Id: <20091102093103.19544.17850.sendpatchset@rxone.opensource.se> Subject: [PATCH] sh: Add RWDT save/restore code for sh7724 R-standby Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0003/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7724.c 2009-10-30 16:48:05.000000000 +0900 @@ -870,6 +870,9 @@ static struct { unsigned char imr10; unsigned char imr11; unsigned char imr12; + /* RWDT */ + unsigned short rwtcnt; + unsigned short rwtcsr; } sh7724_rstandby_state; static int sh7724_pre_sleep_notifier_call(struct notifier_block *nb, @@ -920,6 +923,13 @@ static int sh7724_pre_sleep_notifier_cal sh7724_rstandby_state.imr11 = __raw_readb(0xa40800ac); /* IMR11 */ sh7724_rstandby_state.imr12 = __raw_readb(0xa40800b0); /* IMR12 */ + /* RWDT */ + sh7724_rstandby_state.rwtcnt = __raw_readb(0xa4520000); /* RWTCNT */ + sh7724_rstandby_state.rwtcnt |= 0x5a00; + sh7724_rstandby_state.rwtcsr = __raw_readb(0xa4520004); /* RWTCSR */ + sh7724_rstandby_state.rwtcsr |= 0xa500; + __raw_writew(sh7724_rstandby_state.rwtcsr & 0x07, 0xa4520004); + return NOTIFY_DONE; } @@ -970,6 +980,10 @@ static int sh7724_post_sleep_notifier_ca __raw_writeb(sh7724_rstandby_state.imr11, 0xa40800ac); /* IMR11 */ __raw_writeb(sh7724_rstandby_state.imr12, 0xa40800b0); /* IMR12 */ + /* RWDT */ + __raw_writew(sh7724_rstandby_state.rwtcnt, 0xa4520000); /* RWTCNT */ + __raw_writew(sh7724_rstandby_state.rwtcsr, 0xa4520004); /* RWTCSR */ + return NOTIFY_DONE; }