From patchwork Fri Jul 17 22:12:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 36096 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6HMFarX006166 for ; Fri, 17 Jul 2009 22:15:36 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMEEqb024006; Fri, 17 Jul 2009 17:14:19 -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 n6HMECRR018268; Fri, 17 Jul 2009 17:14:13 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 900178062D; Fri, 17 Jul 2009 17:14:12 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 8E77A8064F for ; Fri, 17 Jul 2009 17:13:03 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id n6HMD3mm003072 for ; Fri, 17 Jul 2009 17:13:03 -0500 (CDT) Received: from mail198-dub-R.bigfish.com (mail-dub.bigfish.com [213.199.154.10]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMCv91023806 for ; Fri, 17 Jul 2009 17:13:02 -0500 Received: from mail198-dub (localhost.localdomain [127.0.0.1]) by mail198-dub-R.bigfish.com (Postfix) with ESMTP id 6169E1300185 for ; Fri, 17 Jul 2009 22:12:57 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh62h) X-Spam-TCS-SCL: 1:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.221.174; Service: EHS Received: by mail198-dub (MessageSwitch) id 1247868776853430_27941; Fri, 17 Jul 2009 22:12:56 +0000 (UCT) Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by mail198-dub.bigfish.com (Postfix) with ESMTP id 8E50756804B for ; Fri, 17 Jul 2009 22:12:56 +0000 (UTC) Received: by mail-qy0-f174.google.com with SMTP id 4so945780qyk.4 for ; Fri, 17 Jul 2009 15:12:56 -0700 (PDT) Received: by 10.224.11.11 with SMTP id r11mr1115421qar.219.1247868776346; Fri, 17 Jul 2009 15:12:56 -0700 (PDT) Received: from localhost (deeprooted.net [216.254.16.51]) by mx.google.com with ESMTPS id 6sm2397194qwk.4.2009.07.17.15.12.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Jul 2009 15:12:55 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Date: Fri, 17 Jul 2009 15:12:19 -0700 Message-Id: <1247868758-10423-6-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1247868758-10423-5-git-send-email-khilman@deeprootsystems.com> References: <1247868758-10423-1-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-2-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-3-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-4-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-5-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com, David Griego Subject: [PATCH 05/24] 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);