From patchwork Fri Mar 5 21:36:56 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: 1448265 X-Patchwork-Delegate: sr@denx.de 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=HeUlJnfY; 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 4Dsh0n1qjSz9sW8 for ; Sat, 6 Mar 2021 08:37:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CE06181FB4; Fri, 5 Mar 2021 22:37:24 +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="HeUlJnfY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 84BC782016; Fri, 5 Mar 2021 22:37:22 +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.0 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 AF21A80598 for ; Fri, 5 Mar 2021 22:37:19 +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 E00AE650A6; Fri, 5 Mar 2021 21:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614980237; bh=UIU57OtvfhHxpa1flmQKH0SENoBfqsEyKcViZ1LJ9rg=; h=From:To:Cc:Subject:Date:From; b=HeUlJnfYzkIcVqjm+7zfnuWJPOzUcdPyDEt1ZigO2j2p2Jz67ZFWVH4PneRmnpJ3M ixVg8lPtj0ODsl6trKUV45QZNHdRJjSkvrY5UX/NCWfBUaUpcTv5GgoWD0izhL5lP2 iO8XUtIQ34z5PxIt4hwibGAHXXW4gz4fHO569no6HkpmeZGj8m8er9BLRCqSV+dF8V e2T99fJJ3ze5pXJvnSf61u6NYnfnkqsXYl+rovkwEbR8E19q2D5z4iPazqUOvRdIsb t8BEN1ynCbB7Z/U8Asnt/P7lg+8SPbDmVeD7In5jnt6nMojk2yJlTJLQgPYnccr2bP rekdxn1PXoWLw== Received: by pali.im (Postfix) id 6A0C9105A; Fri, 5 Mar 2021 22:37:14 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , Simon Glass , Maxim Sloyko , Konstantin Porotchkin Cc: u-boot@lists.denx.de, =?utf-8?q?Marek_Beh=C3=BAn?= , Andre Heider , Luka Kovacic Subject: [PATCH 1/4] watchdog: Set/unset GD_FLG_WDT_READY flag in wdt_start()/wdt_stop() Date: Fri, 5 Mar 2021 22:36:56 +0100 Message-Id: <20210305213659.31025-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 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 Watchdog is ready after successful call of ops->start() callback in wdt_start() function. And is stopped after successful call of ops->stop() callback in wdt_stop function. So move setting of GD_FLG_WDT_READY flag from initr_watchdog() function to wdt_start() and ensure that GD_FLG_WDT_READY flag is unset in wdt_stop() function. This change ensures that GD_FLG_WDT_READY flag is set only when watchdog is running. And ensures that flag is also also when watchdog was started not only by initr_watchdog() call (e.g. by U-Boot 'wdt' command). Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- drivers/watchdog/wdt-uclass.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 28f7918c4673..3f707f61f74f 100644 --- a/drivers/watchdog/wdt-uclass.c +++ b/drivers/watchdog/wdt-uclass.c @@ -51,7 +51,6 @@ int initr_watchdog(void) } wdt_start(gd->watchdog_dev, timeout * 1000, 0); - gd->flags |= GD_FLG_WDT_READY; printf("WDT: Started with%s servicing (%ds timeout)\n", IS_ENABLED(CONFIG_WATCHDOG) ? "" : "out", timeout); @@ -61,21 +60,31 @@ int initr_watchdog(void) int wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags) { const struct wdt_ops *ops = device_get_ops(dev); + int ret; if (!ops->start) return -ENOSYS; - return ops->start(dev, timeout_ms, flags); + ret = ops->start(dev, timeout_ms, flags); + if (ret == 0) + gd->flags |= GD_FLG_WDT_READY; + + return ret; } int wdt_stop(struct udevice *dev) { const struct wdt_ops *ops = device_get_ops(dev); + int ret; if (!ops->stop) return -ENOSYS; - return ops->stop(dev); + ret = ops->stop(dev); + if (ret == 0) + gd->flags &= ~GD_FLG_WDT_READY; + + return ret; } int wdt_reset(struct udevice *dev) From patchwork Fri Mar 5 21:36:57 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: 1448264 X-Patchwork-Delegate: sr@denx.de 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=EjkuVcWU; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dsh0m4bP1z9sW1 for ; Sat, 6 Mar 2021 08:37:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6FFD882462; Fri, 5 Mar 2021 22:37:28 +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="EjkuVcWU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 02AE382016; Fri, 5 Mar 2021 22:37:24 +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.0 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 6131480F58 for ; Fri, 5 Mar 2021 22:37:21 +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 D2AF2650A9; Fri, 5 Mar 2021 21:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614980240; bh=Cjmlnth33N7e8Q4TfAVkhixk9VVXuBsRBexCSIXiyHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EjkuVcWUiE/GytOh3IkzhAFSaUjeiZFzhU2mQb8+/ukiyPnK4fW0zKIijOaPlYgLJ j6gontnGsZ28++9ldM38bwR/V1x6QMAB7EjVUGBLZvMYGf6x7k4+fNWpWNwxMxEgWg +vjeXac2BqXtWw4jWqQ4xAQmkts/33BMrLjwsGsS3DVTWYnY3SsZQ+BiQdoUcXlw2f 8vpgr4MLky8fqThVluHEGcOU/y4jXg87BVHyjnfq7+2+E2vo/QkAfzO/cFUusiZG7L 7wtkbHMXN/fGpjPlcqYNtrgCwWQakE85ZsPw+JOGVHC9W8+5+7EIpk8KNRCtC5O5A3 rt5q1KGBc2wxw== Received: by pali.im (Postfix) id 2B3E1105A; Fri, 5 Mar 2021 22:37:18 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , Simon Glass , Maxim Sloyko , Konstantin Porotchkin Cc: u-boot@lists.denx.de, =?utf-8?q?Marek_Beh=C3=BAn?= , Andre Heider , Luka Kovacic Subject: [PATCH 2/4] watchdog: Show error message when initr_watchdog() cannot start watchdog Date: Fri, 5 Mar 2021 22:36:57 +0100 Message-Id: <20210305213659.31025-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210305213659.31025-1-pali@kernel.org> References: <20210305213659.31025-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 Function wdt_start() may fail. So in initr_watchdog() function check return value of wdt_start() call and print error message when watchdog starting failed. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- drivers/watchdog/wdt-uclass.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 3f707f61f74f..7500b3ed90e3 100644 --- a/drivers/watchdog/wdt-uclass.c +++ b/drivers/watchdog/wdt-uclass.c @@ -27,6 +27,7 @@ static ulong reset_period = 1000; int initr_watchdog(void) { u32 timeout = WATCHDOG_TIMEOUT_SECS; + int ret; /* * Init watchdog: This will call the probe function of the @@ -50,7 +51,12 @@ int initr_watchdog(void) 4 * reset_period) / 4; } - wdt_start(gd->watchdog_dev, timeout * 1000, 0); + ret = wdt_start(gd->watchdog_dev, timeout * 1000, 0); + if (ret != 0) { + printf("WDT: Failed to start\n"); + return 0; + } + printf("WDT: Started with%s servicing (%ds timeout)\n", IS_ENABLED(CONFIG_WATCHDOG) ? "" : "out", timeout); From patchwork Fri Mar 5 21:36:58 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: 1448266 X-Patchwork-Delegate: sr@denx.de 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=W3taVWIi; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dsh0y0pWZz9sW1 for ; Sat, 6 Mar 2021 08:37:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7F5EA826A5; Fri, 5 Mar 2021 22:37:32 +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="W3taVWIi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0B8A182652; Fri, 5 Mar 2021 22:37:27 +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.0 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 63CE480598 for ; Fri, 5 Mar 2021 22:37:23 +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 D6E31650A5; Fri, 5 Mar 2021 21:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614980242; bh=gz/c/OChrl95swv0P9T38DQ3ZK0WAgIvyd2062qfMsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W3taVWIisEOCxts8TFRzJnQaz30+Lb2cvqH4Tw7gdADhViw9I/coLvLVyujAowPXS +vmmBdNMYVE8Hp7dpt1nt/ZRHDq+I2FDgJDR+65FivU9txwH4dM4R/KcgLOEQRCk+F ckql/tGkeIJAN7yR/uYLmS2U9jF/ERNKRtcCbf8ivqzKW49JSZHwdOIiYnUtS35byb PrafGSPCoIorO0tYIFU0G8eW+nvV/csLZgwplRBNt3C24EzUJwbRvhezCABPVsCDwS OhEyOmG8LHP5mySAo9WUBPiHIJyn5kq0WSsC5fGzp6F9ITCqFQRrbO9Ui0vyGVA+1t yh/IVme8MawjA== Received: by pali.im (Postfix) id 36D3B105A; Fri, 5 Mar 2021 22:37:20 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , Simon Glass , Maxim Sloyko , Konstantin Porotchkin Cc: u-boot@lists.denx.de, =?utf-8?q?Marek_Beh=C3=BAn?= , Andre Heider , Luka Kovacic Subject: [PATCH 3/4] watchdog: Allow to use CONFIG_WDT without starting watchdog Date: Fri, 5 Mar 2021 22:36:58 +0100 Message-Id: <20210305213659.31025-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210305213659.31025-1-pali@kernel.org> References: <20210305213659.31025-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 In some cases it is useful to compile support for U-Boot command 'wdt' without starting HW watchdog in early U-Boot phase. For example when user want to start watchdog only on demand by some boot script. This change adds a new compile option WATCHDOG_AUTOSTART to control whether U-Boot should automatically start watchdog during init phase or not. This option is enabled by default as it was was default behavior prior introducing this new change. When compiling U-Boot users can decide to turn this option off. Signed-off-by: Pali Rohár --- drivers/watchdog/Kconfig | 13 +++++++++++++ drivers/watchdog/wdt-uclass.c | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 602ccbe41c00..aa76a8f2d239 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -9,6 +9,19 @@ config WATCHDOG this option if you want to service enabled watchdog by U-Boot. Disable this option if you want U-Boot to start watchdog but never service it. +config WATCHDOG_AUTOSTART + bool "Automatically start watchdog timer" + depends on WDT + default y + help + Automatically start watchdog timer and start servicing it during + init phase. Enabled by default. Disable this option if you want + to compile U-Boot with CONFIG_WDT support but do not want to + activate watchdog, like when CONFIG_WDT option is disabled. You + would be able to start watchdog manually by 'wdt' command. Useful + when you want to have support for 'wdt' command but do not want + to have watchdog enabled by default. + config WATCHDOG_TIMEOUT_MSECS int "Watchdog timeout in msec" default 128000 if ARCH_MX25 || ARCH_MX31 || ARCH_MX5 || ARCH_MX6 diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 7500b3ed90e3..00a408bf5cc5 100644 --- a/drivers/watchdog/wdt-uclass.c +++ b/drivers/watchdog/wdt-uclass.c @@ -27,7 +27,9 @@ static ulong reset_period = 1000; int initr_watchdog(void) { u32 timeout = WATCHDOG_TIMEOUT_SECS; +#ifdef CONFIG_WATCHDOG_AUTOSTART int ret; +#endif /* * Init watchdog: This will call the probe function of the @@ -51,6 +53,10 @@ int initr_watchdog(void) 4 * reset_period) / 4; } +#ifndef CONFIG_WATCHDOG_AUTOSTART + printf("WDT: Not starting\n"); + return 0; +#else ret = wdt_start(gd->watchdog_dev, timeout * 1000, 0); if (ret != 0) { printf("WDT: Failed to start\n"); @@ -61,6 +67,7 @@ int initr_watchdog(void) IS_ENABLED(CONFIG_WATCHDOG) ? "" : "out", timeout); return 0; +#endif } int wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags) From patchwork Fri Mar 5 21:36:59 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: 1448267 X-Patchwork-Delegate: sr@denx.de 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=kYOPJp21; dkim-atps=neutral Received: from phobos.denx.de (unknown [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4Dsh1M2KX5z9sW1 for ; Sat, 6 Mar 2021 08:38:14 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8964B8275B; Fri, 5 Mar 2021 22:37:36 +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="kYOPJp21"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ED38F8269D; Fri, 5 Mar 2021 22:37:29 +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.0 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 212178263A for ; Fri, 5 Mar 2021 22:37:26 +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 9EE86650AC; Fri, 5 Mar 2021 21:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614980243; bh=VdOkd/FG12eZr9Ol4H5zZO3szU/v85CIHVIFNXVc048=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kYOPJp21WG2vwzrGFl2iN9z52vhp70aCMDiGnTzANbbrqwzNWq/sTb9+TusLArcxd W+5KMfVo7uNWGiF5QZxxPUaPM+NFi8AqHZQDlkKfqaNzIDeoID4kr/ejs3uqIUPmMt p0QXzGd0pPxe9MhMhxCjiyoX3I/MyxyHc/3tbzZvxUOXEvaU/QRzGJ5cNjNvB9/BHY tyt6LHSHVbLjfoyi7YE+g17WpuyRvGgBFY7dW8HthMXGzQmvZOCSaNeH2D2ASKllwH c0QVYuUVIp0rA1ArM1zPQIokUys7JI3q+9Eg6EPHuI2UtszxiNqa2I+fXoum5je1Xc cIgxuWfV6TUvQ== Received: by pali.im (Postfix) id D6A85134E; Fri, 5 Mar 2021 22:37:21 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , Simon Glass , Maxim Sloyko , Konstantin Porotchkin Cc: u-boot@lists.denx.de, =?utf-8?q?Marek_Beh=C3=BAn?= , Andre Heider , Luka Kovacic Subject: [PATCH 4/4] arm: mvebu: Espressobin: Enable watchdog support but do not start it Date: Fri, 5 Mar 2021 22:36:59 +0100 Message-Id: <20210305213659.31025-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210305213659.31025-1-pali@kernel.org> References: <20210305213659.31025-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 Espressobin had disabled watchdog support (CONFIG_WDT) because older stable Linux kernel versions (which are used by current stable OpenWRT and Debian versions) do not have support for Armada 3700 watchdog driver. Therefore they are not able to periodically kick watchdog so Espressobin enter into boot loop. This change enable CONFIG_WDT, CONFIG_WDT_ARMADA_37XX and CONFIG_CMD_WDT options which add support for U-Boot 'wdt' command. And unset new CONFIG_WATCHDOG_AUTOSTART option which cause that watchdog is not automatically started by U-Boot during init phase, like when CONFIG_WDT option is not set at all. So with this change, U-Boot on Espressobin would have working 'wdt' command which can be used from boot scripts (e.g. for enabling watchdog prior new Linux booting kernel). But default behavior of watchdog status stays unchanged, U-Boot does not start watchdog on Espressobin during its init phase. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- configs/mvebu_espressobin-88f3720_defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig index c791f98dfea5..20aa21b06b3d 100644 --- a/configs/mvebu_espressobin-88f3720_defconfig +++ b/configs/mvebu_espressobin-88f3720_defconfig @@ -32,6 +32,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y CONFIG_CMD_TFTPPUT=y CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y @@ -88,5 +89,8 @@ CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_MCS7830=y CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_ETHER_SMSC95XX=y +# CONFIG_WATCHDOG_AUTOSTART is not set +CONFIG_WDT=y +CONFIG_WDT_ARMADA_37XX=y CONFIG_SHA1=y CONFIG_SHA256=y