From patchwork Fri May 11 14:51:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 912035 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40jCqB5q7rz9s01 for ; Sat, 12 May 2018 00:56:54 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 69938C22357; Fri, 11 May 2018 14:55:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4F856C223C8; Fri, 11 May 2018 14:52:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3159BC223A8; Fri, 11 May 2018 14:52:20 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lists.denx.de (Postfix) with ESMTPS id D957DC223C7 for ; Fri, 11 May 2018 14:52:15 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 40jCjq58NCz1qtwq; Fri, 11 May 2018 16:52:15 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 40jCjq4t1gz1r97v; Fri, 11 May 2018 16:52:15 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 9n6AMw9H2FUh; Fri, 11 May 2018 16:52:14 +0200 (CEST) X-Auth-Info: vtyAYFvwBqeUWHKn4TBnLDiWDozzr4OH+h3DC9Q3VaM= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 11 May 2018 16:52:14 +0200 (CEST) From: Lukasz Majewski To: Stefano Babic , Fabio Estevam Date: Fri, 11 May 2018 16:51:09 +0200 Message-Id: <20180511145119.20942-12-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180511145119.20942-1-lukma@denx.de> References: <20180511145119.20942-1-lukma@denx.de> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v1 11/21] display5: wdt: Enable WDT support (both SPL and u-boot) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "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 --- board/liebherr/display5/spl.c | 5 +++++ configs/display5_defconfig | 1 + configs/display5_factory_defconfig | 1 + include/configs/display5.h | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c index 551a14347d..5c6b8bff38 100644 --- a/board/liebherr/display5/spl.c +++ b/board/liebherr/display5/spl.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "common.h" DECLARE_GLOBAL_DATA_PTR; @@ -197,6 +198,10 @@ void board_init_f(ulong dummy) displ5_set_iomux_misc_spl(); + /* Initialize and reset WDT in SPL */ + hw_watchdog_init(); + WATCHDOG_RESET(); + /* load/boot image from boot device */ board_init_r(NULL, 0); } diff --git a/configs/display5_defconfig b/configs/display5_defconfig index 81f329f259..03e56e9588 100644 --- a/configs/display5_defconfig +++ b/configs/display5_defconfig @@ -10,6 +10,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_SPL=y +CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_DEFAULT_DEVICE_TREE="imx6q-display5" CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y diff --git a/configs/display5_factory_defconfig b/configs/display5_factory_defconfig index d86e5f51e9..da736b2afa 100644 --- a/configs/display5_factory_defconfig +++ b/configs/display5_factory_defconfig @@ -9,6 +9,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_SPL=y +CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_FIT=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6Q" diff --git a/include/configs/display5.h b/include/configs/display5.h index 574e15eb1a..9e3c7f547b 100644 --- a/include/configs/display5.h +++ b/include/configs/display5.h @@ -389,6 +389,11 @@ #define CONFIG_MTD_PARTITIONS #define CONFIG_MTD_DEVICE +/* Watchdog */ +#define CONFIG_HW_WATCHDOG +#define CONFIG_IMX_WATCHDOG +#define CONFIG_WATCHDOG_TIMEOUT_MSECS 15000 + /* ENV config */ #ifdef CONFIG_ENV_IS_IN_SPI_FLASH #define CONFIG_ENV_SIZE (SZ_64K)