From patchwork Thu Jan 8 10:58:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Belisko Marek X-Patchwork-Id: 426569 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 38F871400D5 for ; Thu, 8 Jan 2015 21:59:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F1E024B601; Thu, 8 Jan 2015 11:59:36 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d005iqA2lTht; Thu, 8 Jan 2015 11:59:36 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 815244B5EB; Thu, 8 Jan 2015 11:59:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5ED274B5EB for ; Thu, 8 Jan 2015 11:59:34 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JRFB3RNiTgzz for ; Thu, 8 Jan 2015 11:59:34 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by theia.denx.de (Postfix) with ESMTPS id 337C44B5D3 for ; Thu, 8 Jan 2015 11:59:30 +0100 (CET) Received: by mail-we0-f174.google.com with SMTP id k48so1788686wev.5 for ; Thu, 08 Jan 2015 02:59:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=DLQPgkdicVrdZC/OZncs0DhJyzqJlqGftBX1vUwuijw=; b=Qjey8HLdt5bgyGMrShfMa3tNJgnMmUU69kOfKS8BusaVOvw+Ty1I4eIiT6wUReoozs i6eXMOSR4qbRkS3ZqhhVhEtxPlLhciXkAgG3qBva/NmfLvRldxFUchAz8hlJ4h6Ihl5F cusnIWakU7IXlerTqHwQPwjBi8jX7UIbZ3BgtgSaJqUMFiXXzABYXdAULGfvP7xenhEE /gDeBXkxcl5vg9LCBOodgQeToFLQ2lK6Surq3kIuqD7ru/RGwdQDnghfdZ1Rs61jPqTF SgemrqnkW862Gx/NuDtqK7UEdethmWV83OS27dIpdhjQtP5e/4duTYO4v/xDgmaU3M/4 JUFg== X-Received: by 10.180.206.47 with SMTP id ll15mr18744017wic.34.1420714769961; Thu, 08 Jan 2015 02:59:29 -0800 (PST) Received: from mbuntu.sueba (81.89.61.168.vnet.sk. [81.89.61.168]) by mx.google.com with ESMTPSA id je12sm6062136wic.22.2015.01.08.02.59.28 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Jan 2015 02:59:29 -0800 (PST) From: Marek Belisko To: u-boot@lists.denx.de Date: Thu, 8 Jan 2015 11:58:53 +0100 Message-Id: <1420714734-32635-1-git-send-email-marek.belisko@gmail.com> X-Mailer: git-send-email 1.7.9.5 Subject: [U-Boot] [PATCH] watchdog: omap: Add handling for CONFIG_WATCHDOG_TIMEOUT_MSECS X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This change add possibility to change watchdog timeout compile time. Previous default value is kept when CONFIG_WATCHDOG_TIMEOUT_MSECS is not defined in config file. Signed-off-by: Marek Belisko --- drivers/watchdog/omap_wdt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 7ea4b60..26774d6 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -44,9 +44,6 @@ #include #include -/* Hardware timeout in seconds */ -#define WDT_HW_TIMEOUT 60 - static unsigned int wdt_trgr_pattern = 0x1234; void hw_watchdog_reset(void) @@ -92,8 +89,15 @@ void hw_watchdog_init(void) writel(WDT_WCLR_PRE | (PTV << WDT_WCLR_PTV_OFF), &wdt->wdtwclr); while (readl(&wdt->wdtwwps) & WDT_WWPS_PEND_WCLR) ; + /* + * If timeuot is not defined in config file + * use default 60 seconds + */ +#ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS +#define CONFIG_WATCHDOG_TIMEOUT_MSECS 60000 +#endif - omap_wdt_set_timeout(WDT_HW_TIMEOUT); + omap_wdt_set_timeout(CONFIG_WATCHDOG_TIMEOUT_MSECS); /* Sequence to enable the watchdog */ writel(0xBBBB, &wdt->wdtwspr);