Commit 76d1d169f302b533249aa1fb84b765af0722a629
Committed by
Stefano Babic
1 parent
27aede24bc
Exists in
smarc_8mq_lf_v2020.04
and in
12 other branches
display5: wdt: Enable WDT support (both SPL and u-boot)
Test case: The fitImage gets corrupted: truncate -c -s 3M fitImage run tftp_mmc_fitImg setenv boot_os y reset [board shall hang in SPL with "Trying to boot from MMC1" information] Then after X seconds WDT is causing board to reset. After N boot attempts we enter recovery mode. Signed-off-by: Lukasz Majewski <lukma@denx.de>
Showing 4 changed files with 12 additions and 0 deletions Side-by-side Diff
board/liebherr/display5/spl.c
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 | #include <fsl_esdhc.h> |
22 | 22 | #include <netdev.h> |
23 | 23 | #include <bootcount.h> |
24 | +#include <watchdog.h> | |
24 | 25 | #include "common.h" |
25 | 26 | |
26 | 27 | DECLARE_GLOBAL_DATA_PTR; |
... | ... | @@ -196,6 +197,10 @@ |
196 | 197 | memset(__bss_start, 0, __bss_end - __bss_start); |
197 | 198 | |
198 | 199 | displ5_set_iomux_misc_spl(); |
200 | + | |
201 | + /* Initialize and reset WDT in SPL */ | |
202 | + hw_watchdog_init(); | |
203 | + WATCHDOG_RESET(); | |
199 | 204 | |
200 | 205 | /* load/boot image from boot device */ |
201 | 206 | board_init_r(NULL, 0); |
configs/display5_defconfig
configs/display5_factory_defconfig
include/configs/display5.h
... | ... | @@ -383,6 +383,11 @@ |
383 | 383 | #define CONFIG_MTD_PARTITIONS |
384 | 384 | #define CONFIG_MTD_DEVICE |
385 | 385 | |
386 | +/* Watchdog */ | |
387 | +#define CONFIG_HW_WATCHDOG | |
388 | +#define CONFIG_IMX_WATCHDOG | |
389 | +#define CONFIG_WATCHDOG_TIMEOUT_MSECS 15000 | |
390 | + | |
386 | 391 | /* ENV config */ |
387 | 392 | #ifdef CONFIG_ENV_IS_IN_SPI_FLASH |
388 | 393 | #define CONFIG_ENV_SIZE (SZ_64K) |