From patchwork Tue Mar 9 20:19:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1450163 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=sR1LDPGC; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dw65C6bzQz9sVt for ; Wed, 10 Mar 2021 07:19:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 468D8812B7; Tue, 9 Mar 2021 21:19:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="sR1LDPGC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2A2AD825F1; Tue, 9 Mar 2021 21:19:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 41C70803AB for ; Tue, 9 Mar 2021 21:19:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 6318B64DD1; Tue, 9 Mar 2021 20:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615321179; bh=Mu08UvNEqRGwQP3AbcmGjX+4MGnS59FtazER7DL5fBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sR1LDPGC2rXMFVvPPzVVOz787bHnVbIqsGE3if8YGorLZjtXQ+j38qrac31EYA/6v aHCnTKCzemhA7ZMUUItVeh0eCQLPFZf558OBXH+PGc1NHaVTqpUWDw1+a+lgMcB7My wZL191kiZYBFiTcjjVitaeC13SgUc1TQuxz8t9bXMmJ80h9OmwpequMAC2D9jIQ0BU 89R6Nx7BWZbclanvAt9KE97pOIBVqgv73NqWs7DaxN7Lv56JMuS315p4wuiFF2XSV2 2Im2w54C7G0waD/9o5lnAT/mxEdxzjQH2DGNhanTJjJhDkMIZSgpAg3DmnE2mRT02E iDny6eo04/5uw== Received: by pali.im (Postfix) id 61DE989E; Tue, 9 Mar 2021 21:19:37 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Lokesh Vutla , Tom Rini Cc: u-boot@lists.denx.de Subject: [PATCH v2] Nokia RX-51: Enable CONFIG_WDT to remove deprecation warning Date: Tue, 9 Mar 2021 21:19:15 +0100 Message-Id: <20210309201915.16586-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210306221653.31593-1-pali@kernel.org> References: <20210306221653.31593-1-pali@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Also convert CONFIG_HW_WATCHDOG to CONFIG_WATCHDOG. Signed-off-by: Pali Rohár --- This patch increase u-boot.bin binary size above maximal limit. So this patch cannot be applied yet. But it can be applied on top of the LTO patches. So please put this patch into the queue and include it into U-Boot after LTO patches are merged. Changes in v2: * converted CONFIG_HW_WATCHDOG to CONFIG_WATCHDOG --- board/nokia/rx51/rx51.c | 37 ++++++++++++++++++++++++++++++++---- configs/nokia_rx51_defconfig | 2 ++ include/configs/nokia_rx51.h | 3 --- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 7bd5fbd71520..fd3cec8358aa 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -487,20 +488,20 @@ static unsigned long int twl_wd_time; /* last time of watchdog reset */ static unsigned long int twl_i2c_lock; /* - * Routine: hw_watchdog_reset + * Routine: rx51_watchdog_reset * Description: Reset timeout of twl4030 watchdog. */ -void hw_watchdog_reset(void) +static int rx51_watchdog_reset(struct udevice *dev) { u8 timeout = 0; /* do not reset watchdog too often - max every 4s */ if (get_timer(twl_wd_time) < 4 * CONFIG_SYS_HZ) - return; + return 0; /* localy lock twl4030 i2c bus */ if (test_and_set_bit(0, &twl_i2c_lock)) - return; + return 0; /* read actual watchdog timeout */ twl4030_i2c_read_u8(TWL4030_CHIP_PM_RECEIVER, @@ -517,8 +518,32 @@ void hw_watchdog_reset(void) /* localy unlock twl4030 i2c bus */ test_and_clear_bit(0, &twl_i2c_lock); + + return 0; +} + +static int rx51_watchdog_start(struct udevice *dev, u64 timeout_ms, ulong flags) +{ + return 0; } +static int rx51_watchdog_probe(struct udevice *dev) +{ + return 0; +} + +static const struct wdt_ops rx51_watchdog_ops = { + .start = rx51_watchdog_start, + .reset = rx51_watchdog_reset, +}; + +U_BOOT_DRIVER(rx51_watchdog) = { + .name = "rx51_watchdog", + .id = UCLASS_WDT, + .ops = &rx51_watchdog_ops, + .probe = rx51_watchdog_probe, +}; + /* * TWL4030 keypad handler for cfb_console */ @@ -722,3 +747,7 @@ U_BOOT_DRVINFOS(rx51_i2c) = { { "i2c_omap", &rx51_i2c[1] }, { "i2c_omap", &rx51_i2c[2] }, }; + +U_BOOT_DRVINFOS(rx51_watchdog) = { + { "rx51_watchdog" }, +}; diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 312ca3a1a991..80b18e435105 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -67,4 +67,6 @@ CONFIG_CFB_CONSOLE=y CONFIG_CFB_CONSOLE_ANSI=y # CONFIG_VGA_AS_SINGLE_DEVICE is not set CONFIG_SPLASH_SCREEN=y +CONFIG_WATCHDOG_TIMEOUT_MSECS=31000 +CONFIG_WDT=y # CONFIG_GZIP is not set diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index 23368de624e1..fe991ea03991 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -85,9 +85,6 @@ #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP -/* Watchdog support */ -#define CONFIG_HW_WATCHDOG - /* * Framebuffer */