All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Subject: [PATCH V2 07/13] iot2050: Add watchdog start to bootcmd
Date: Wed,  5 Oct 2022 10:33:47 +0200	[thread overview]
Message-ID: <100e6d0826a577d53961a73a03eb7cd52c5d99a8.1664958832.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1664958832.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

Allows run-time control over watchdog auto-start and the timeout via
setting the environment variable watchdog_timeout_ms. A value of zero
means "do not start". Use CONFIG_WATCHDOG_TIMEOUT_MSECS as initial value
and this to zero by default. Users can then enable the watchdog once the
use and OS which picks it up during boot.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 configs/iot2050_pg1_defconfig | 2 ++
 configs/iot2050_pg2_defconfig | 2 ++
 include/configs/iot2050.h     | 9 +++++++++
 3 files changed, 13 insertions(+)

diff --git a/configs/iot2050_pg1_defconfig b/configs/iot2050_pg1_defconfig
index 934266c26ef..49f81109364 100644
--- a/configs/iot2050_pg1_defconfig
+++ b/configs/iot2050_pg1_defconfig
@@ -32,6 +32,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTSTAGE=y
 CONFIG_SHOW_BOOT_PROGRESS=y
 CONFIG_SPL_SHOW_BOOT_PROGRESS=y
+CONFIG_BOOTCOMMAND="run start_watchdog; run distro_bootcmd"
 CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0x58000
@@ -142,6 +143,7 @@ CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_KEYBOARD=y
 # CONFIG_WATCHDOG is not set
 # CONFIG_WATCHDOG_AUTOSTART is not set
+CONFIG_WATCHDOG_TIMEOUT_MSECS=0
 CONFIG_WDT=y
 CONFIG_WDT_K3_RTI=y
 CONFIG_WDT_K3_RTI_LOAD_FW=y
diff --git a/configs/iot2050_pg2_defconfig b/configs/iot2050_pg2_defconfig
index c76abcca672..43410160c8a 100644
--- a/configs/iot2050_pg2_defconfig
+++ b/configs/iot2050_pg2_defconfig
@@ -32,6 +32,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTSTAGE=y
 CONFIG_SHOW_BOOT_PROGRESS=y
 CONFIG_SPL_SHOW_BOOT_PROGRESS=y
+CONFIG_BOOTCOMMAND="run start_watchdog; run distro_bootcmd"
 CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0x58000
@@ -142,6 +143,7 @@ CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_KEYBOARD=y
 # CONFIG_WATCHDOG is not set
 # CONFIG_WATCHDOG_AUTOSTART is not set
+CONFIG_WATCHDOG_TIMEOUT_MSECS=0
 CONFIG_WDT=y
 CONFIG_WDT_K3_RTI=y
 CONFIG_WDT_K3_RTI_LOAD_FW=y
diff --git a/include/configs/iot2050.h b/include/configs/iot2050.h
index 0f6150fc9c7..dc4b5f90595 100644
--- a/include/configs/iot2050.h
+++ b/include/configs/iot2050.h
@@ -15,6 +15,14 @@
 
 /* SPL Loader Configuration */
 
+#define WATCHDOG_ENV							\
+	"watchdog_timeout_ms=" __stringify(CONFIG_WATCHDOG_TIMEOUT_MSECS) "\0" \
+	"start_watchdog=if test ${watchdog_timeout_ms} -gt 0; then "	\
+		"wdt dev watchdog@40610000; "				\
+		"wdt start ${watchdog_timeout_ms}; "			\
+		"echo Watchdog started, timeout ${watchdog_timeout_ms} ms; " \
+		"fi\0"
+
 /* U-Boot general configuration */
 #define EXTRA_ENV_IOT2050_BOARD_SETTINGS				\
 	"usb_pgood_delay=900\0"
@@ -43,6 +51,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS					\
 	DEFAULT_LINUX_BOOT_ENV						\
 	BOOTENV								\
+	WATCHDOG_ENV							\
 	EXTRA_ENV_IOT2050_BOARD_SETTINGS
 
 #include <configs/ti_armv7_common.h>
-- 
2.35.3


  parent reply	other threads:[~2022-10-05  8:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05  8:33 [PATCH V2 00/13] IOT2050-related enhancements Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 01/13] env: Complete generic support for writable list Jan Kiszka
2022-10-27  7:49   ` Stefan Herbrechtsmeier
2022-10-27 12:38     ` Jan Kiszka
2022-10-28  8:34       ` Stefan Herbrechtsmeier
2022-10-05  8:33 ` [PATCH V2 02/13] env: Couple networking-related variable flags to CONFIG_NET Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 03/13] tools: Add script for converting public key into device tree include Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 04/13] board: siemens: iot2050: Split the build for PG1 and PG2 Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 05/13] arm: dts: iot2050: Use the auto generator nodes for fdt Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 06/13] iot2050: Update firmware layout Jan Kiszka
2022-10-05  8:33 ` Jan Kiszka [this message]
2022-10-05  8:33 ` [PATCH V2 08/13] iot2050: Add CONFIG_ENV_FLAGS_LIST_STATIC Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 09/13] arm: dts: iot2050: Allow verifying U-Boot proper by SPL Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 10/13] iot2050: Add script for signing artifacts Jan Kiszka
2022-10-05 15:58   ` Simon Glass
2022-10-05 16:04     ` Jan Kiszka
2022-10-05 16:16       ` Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 11/13] arm: dts: iot2050: Optionally embed OTP programming data into image Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 12/13] doc: iot2050: Add a note about the watchdog firmware Jan Kiszka
2022-10-05  8:33 ` [PATCH V2 13/13] board: siemens: iot2050: use the named gpio to control the user-button Jan Kiszka
2022-10-26  7:28 ` [PATCH V2 00/13] IOT2050-related enhancements Jan Kiszka
2022-10-26 13:54   ` Tom Rini
2022-10-26 14:03     ` Marek Vasut
2022-10-26 15:55       ` Jan Kiszka
2022-10-26 21:02         ` Marek Vasut
2022-10-27  4:32           ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=100e6d0826a577d53961a73a03eb7cd52c5d99a8.1664958832.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.