Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E38EC4321E for ; Mon, 5 Dec 2022 12:28:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A556985591; Mon, 5 Dec 2022 13:28:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1670243282; bh=Ko9Ay+VQtj9PB1defW9r1kKKgAJqwZSpUhrebOBQ/Ks=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JKmBY+bLAp73fFCWj6sfC/9omU9ylfuUOFYVG/pEeDq/mBu26LvUuFhQdiGsoZN/L K/4izqrYEQn9+t1sGNLnZ1fjQ0F176g1lKfaCUHurt4JGdKjYoLDlWLLeLojArFHpn Cyi8PjQJJ4CWFsyqvH9bRX6tvU/qFOaWEw0VtCOpYRLpn34o/pEiy6QJkntv9sgIMi Fl+5GYOe60V3JolzvN1qzqC80y3vccYzZMJxMxgZXlL4Imb01f8CAsk0tRyCvKOPxH hGmSmFDO5+eeK2TtcfLhk3Tr5d6OCCMgEf3ycLipLTHKOw/SSh3nQPcDXLhOJ+0Vrj Y+YarUpPVKVQQ== Received: by phobos.denx.de (Postfix, from userid 109) id 5342985591; Mon, 5 Dec 2022 13:28:00 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 69F328535D for ; Mon, 5 Dec 2022 13:27:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4NQjVv1R5Dz9sST; Mon, 5 Dec 2022 13:27:51 +0100 (CET) Message-ID: <09be21fd-1882-1a6d-ff55-c86c9c653ce7@denx.de> Date: Mon, 5 Dec 2022 13:27:45 +0100 MIME-Version: 1.0 Subject: Re: [PATCH 1/2] drivers: watchdog: Enhance watchdog support in SPL for Stratix 10 and Agilex Content-Language: en-US To: Jit Loon Lim , u-boot@lists.denx.de Cc: Jagan Teki , Vignesh R , Marek , Simon , Tien Fong , Kok Kiang , Siew Chin , Sin Hui , Raaj , Dinesh , Boon Khai , Alif , Teik Heng , Hazim , Sieu Mun Tang References: <20221122141837.24055-1-jit.loon.lim@intel.com> From: Stefan Roese In-Reply-To: <20221122141837.24055-1-jit.loon.lim@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 11/22/22 15:18, Jit Loon Lim wrote: > From: Siew Chin Lim > > Change watchdog default timeout to 10 seconds and enable watchdog before > initializing other component (example: DDR). Thus, watchdog need to be > fully executed in onchip ram. Please find some comments below. > Signed-off-by: Siew Chin Lim > Signed-off-by: Jit Loon Lim > --- > arch/arm/mach-socfpga/spl_agilex.c | 17 +++++++++-------- > arch/arm/mach-socfpga/spl_s10.c | 14 +++++++------- > drivers/watchdog/Kconfig | 2 +- > 3 files changed, 17 insertions(+), 16 deletions(-) > > diff --git a/arch/arm/mach-socfpga/spl_agilex.c b/arch/arm/mach-socfpga/spl_agilex.c > index ee5a9dc1e2..c279f97cea 100644 > --- a/arch/arm/mach-socfpga/spl_agilex.c > +++ b/arch/arm/mach-socfpga/spl_agilex.c > @@ -20,7 +20,7 @@ > #include > #include > #include > -#include > +#include > #include > > DECLARE_GLOBAL_DATA_PTR; > @@ -40,13 +40,6 @@ void board_init_f(ulong dummy) > writel(SYSMGR_WDDBG_PAUSE_ALL_CPU, > socfpga_get_sysmgr_addr() + SYSMGR_SOC64_WDDBG); > > -#ifdef CONFIG_HW_WATCHDOG > - /* Enable watchdog before initializing the HW */ > - socfpga_per_reset(SOCFPGA_RESET(L4WD0), 1); > - socfpga_per_reset(SOCFPGA_RESET(L4WD0), 0); > - hw_watchdog_init(); > -#endif > - The patch also removes the CONFIG_HW_WATCHDOG stuff, which is probably unused right now. Could you please also mention this in the commit message? > /* ensure all processors are not released prior Linux boot */ > writeq(0, CPU_RELEASE_ADDR); > > @@ -60,6 +53,14 @@ void board_init_f(ulong dummy) > hang(); > } > > + /* > + * Enable watchdog as early as possible before initializing other > + * component. Watchdog need to be enabled after clock driver because > + * it will retrieve the clock frequency from clock driver. > + */ > + if (CONFIG_IS_ENABLED(WDT)) > + initr_watchdog(); > + initr_watchdog() will get called from spl/common/spl/spl.c: board_init_r(). Is this too late? How much time passes between these two code path's? Thanks, Stefan > preloader_console_init(); > print_reset_info(); > cm_print_clock_quick_summary(); > diff --git a/arch/arm/mach-socfpga/spl_s10.c b/arch/arm/mach-socfpga/spl_s10.c > index c20e87cdbe..4044dc335e 100644 > --- a/arch/arm/mach-socfpga/spl_s10.c > +++ b/arch/arm/mach-socfpga/spl_s10.c > @@ -21,7 +21,7 @@ > #include > #include > #include > -#include > +#include > #include > > DECLARE_GLOBAL_DATA_PTR; > @@ -41,12 +41,12 @@ void board_init_f(ulong dummy) > writel(SYSMGR_WDDBG_PAUSE_ALL_CPU, > socfpga_get_sysmgr_addr() + SYSMGR_SOC64_WDDBG); > > -#ifdef CONFIG_HW_WATCHDOG > - /* Enable watchdog before initializing the HW */ > - socfpga_per_reset(SOCFPGA_RESET(L4WD0), 1); > - socfpga_per_reset(SOCFPGA_RESET(L4WD0), 0); > - hw_watchdog_init(); > -#endif > + /* > + * Enable watchdog as early as possible before initializing other > + * component. > + */ > + if (CONFIG_IS_ENABLED(WDT)) > + initr_watchdog(); > > /* ensure all processors are not released prior Linux boot */ > writeq(0, CPU_RELEASE_ADDR); > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index 50e6a1efba..a6c242ac9d 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -27,7 +27,7 @@ config WATCHDOG_TIMEOUT_MSECS > int "Watchdog timeout in msec" > default 128000 if ARCH_MX31 || ARCH_MX5 || ARCH_MX6 > default 128000 if ARCH_MX7 || ARCH_VF610 > - default 30000 if ARCH_SOCFPGA > + default 10000 if ARCH_SOCFPGA > default 16000 if ARCH_SUNXI > default 60000 > help Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de