Commit 76d1d169f302b533249aa1fb84b765af0722a629

Authored by Lukasz Majewski
Committed by Stefano Babic
1 parent 27aede24bc

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
... ... @@ -10,6 +10,7 @@
10 10 CONFIG_SPL=y
11 11 CONFIG_SPL_SPI_FLASH_SUPPORT=y
12 12 CONFIG_SPL_SPI_SUPPORT=y
  13 +CONFIG_SPL_WATCHDOG_SUPPORT=y
13 14 CONFIG_DEFAULT_DEVICE_TREE="imx6q-display5"
14 15 CONFIG_FIT=y
15 16 CONFIG_SPL_LOAD_FIT=y
configs/display5_factory_defconfig
... ... @@ -9,6 +9,7 @@
9 9 CONFIG_SPL=y
10 10 CONFIG_SPL_SPI_FLASH_SUPPORT=y
11 11 CONFIG_SPL_SPI_SUPPORT=y
  12 +CONFIG_SPL_WATCHDOG_SUPPORT=y
12 13 CONFIG_FIT=y
13 14 CONFIG_OF_BOARD_SETUP=y
14 15 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6Q"
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)