From patchwork Mon Jul 6 21:14:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 34324 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n66LJ1jK016873 for ; Mon, 6 Jul 2009 21:19:02 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n66LHc4d025911; Mon, 6 Jul 2009 16:17:43 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n66LHafO023172; Mon, 6 Jul 2009 16:17:37 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4D41980647; Mon, 6 Jul 2009 16:17:16 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 39B8B80651 for ; Mon, 6 Jul 2009 16:16:26 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n66LGPJG025606 for ; Mon, 6 Jul 2009 16:16:25 -0500 (CDT) Received: from mail179-wa4-R.bigfish.com (mail-wa4.bigfish.com [216.32.181.114]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n66LGKQ8032255 for ; Mon, 6 Jul 2009 16:16:25 -0500 Received: from mail179-wa4 (localhost.localdomain [127.0.0.1]) by mail179-wa4-R.bigfish.com (Postfix) with ESMTP id 9F12B1E809B for ; Mon, 6 Jul 2009 21:16:20 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh62h) X-Spam-TCS-SCL: 1:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.222.185; Service: EHS Received: by mail179-wa4 (MessageSwitch) id 1246914977901914_2010; Mon, 6 Jul 2009 21:16:17 +0000 (UCT) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mail179-wa4.bigfish.com (Postfix) with ESMTP id D3D84D80058 for ; Mon, 6 Jul 2009 21:16:17 +0000 (UTC) Received: by mail-pz0-f185.google.com with SMTP id 15so474410pzk.4 for ; Mon, 06 Jul 2009 14:16:17 -0700 (PDT) Received: by 10.114.192.3 with SMTP id p3mr8114045waf.166.1246914977778; Mon, 06 Jul 2009 14:16:17 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id d20sm11917067waa.47.2009.07.06.14.16.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 06 Jul 2009 14:16:17 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Date: Mon, 6 Jul 2009 14:14:42 -0700 Message-Id: <1246914900-9034-9-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1246914900-9034-8-git-send-email-khilman@deeprootsystems.com> References: <1246914900-9034-1-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-2-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-3-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-4-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-5-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-6-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-7-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-8-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com, David Griego Subject: [PATCH 08/26] davinci: Fix watchdog reset code X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: David Griego The davinci reset routine, davinci_watchdog_reset(), sets the TCR register instead of the TGCR register as it should to put the WDT into its "Initial State". It also writes the WDTCR register without the proper WDKEY which is pointless since the register will be write-protected. Signed-off-by: David Griego Signed-off-by: Mark A. Greer Signed-off-by: Kevin Hilman --- arch/arm/mach-davinci/time.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index 0884ca5..ca85d18 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c @@ -420,11 +420,11 @@ void davinci_watchdog_reset(void) /* reset timer, set mode to 64-bit watchdog, and unreset */ tgcr = 0; - __raw_writel(tgcr, base + TCR); + __raw_writel(tgcr, base + TGCR); tgcr = TGCR_TIMMODE_64BIT_WDOG << TGCR_TIMMODE_SHIFT; tgcr |= (TGCR_UNRESET << TGCR_TIM12RS_SHIFT) | (TGCR_UNRESET << TGCR_TIM34RS_SHIFT); - __raw_writel(tgcr, base + TCR); + __raw_writel(tgcr, base + TGCR); /* clear counter and period regs */ __raw_writel(0, base + TIM12); @@ -432,12 +432,8 @@ void davinci_watchdog_reset(void) __raw_writel(0, base + PRD12); __raw_writel(0, base + PRD34); - /* enable */ - wdtcr = __raw_readl(base + WDTCR); - wdtcr |= WDTCR_WDEN_ENABLE << WDTCR_WDEN_SHIFT; - __raw_writel(wdtcr, base + WDTCR); - /* put watchdog in pre-active state */ + wdtcr = __raw_readl(base + WDTCR); wdtcr = (WDTCR_WDKEY_SEQ0 << WDTCR_WDKEY_SHIFT) | (WDTCR_WDEN_ENABLE << WDTCR_WDEN_SHIFT); __raw_writel(wdtcr, base + WDTCR);