[PATCH V5 04/12] iot2050: Add watchdog start to bootcmd
Tom Rini
trini at konsulko.com
Fri Feb 3 19:51:25 CET 2023
On Fri, Feb 03, 2023 at 01:26:33PM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka at 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 at siemens.com>
[snip]
> diff --git a/include/configs/iot2050.h b/include/configs/iot2050.h
> index 7d087413362..5186dfd8ff8 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 at 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 CFG_EXTRA_ENV_SETTINGS \
> DEFAULT_LINUX_BOOT_ENV \
> BOOTENV \
> + WATCHDOG_ENV \
> EXTRA_ENV_IOT2050_BOARD_SETTINGS
As a follow-up I would like to see all of this migrated to the plain
text environment, see board/*/*/*.env for various more and less complex
examples of this kind of conversion.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230203/2479aac6/attachment.sig>
More information about the U-Boot
mailing list