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 9A9B7C433F5 for ; Thu, 17 Feb 2022 05:48:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7A5A882DB7; Thu, 17 Feb 2022 06:48:13 +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=1645076893; bh=o/Ap1IB3tBvhDgPq6Yirdk/Q1EVuphzqid9kyzgMxWw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ChBIdgin180VNJFa/p5Ql9MgWakTp9etK4SRSdzYuAzuFVpy6jOI1L+n4aQQoVRrW Xr9W0iGxEEGWpk6KgT6tjlm5aq3jR1TPtWd5JK2Uy+Ha1bEUg83HvyMX6LSYyLxEcr uglNMKA16c3YwiR8Mc/k+WdSJwgPH7nJlI0LfasKDDLsSNH09pcGWjHKojVpeYjBda afbqyg3jsgNMaaoUmS5+BlUlqlcwYXnrzcrLpzbM2nK791h/1GxiEiigW3/s9gAMpV yrBMg5D9SS79o4v/CVaWmgCAwSCvKhRNVO7ma5mALn50wRjwc5CfZQK4DJpCc9LAXo 6slt3wIs9gdrw== Received: by phobos.denx.de (Postfix, from userid 109) id 34DC083046; Thu, 17 Feb 2022 06:48:12 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (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 051D280317 for ; Thu, 17 Feb 2022 06:48:09 +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 smtp1.mailbox.org (unknown [91.198.250.123]) (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 4JzkQ06Nx0z9sTN; Thu, 17 Feb 2022 06:48:08 +0100 (CET) Message-ID: <8c48430b-32ff-710e-bee4-c4c96fe49413@denx.de> Date: Thu, 17 Feb 2022 06:48:04 +0100 MIME-Version: 1.0 Subject: Re: [PATCH u-boot-marvell 1/2] arm: mvebu: spl: Add option to reset the board on DDR training failure Content-Language: en-US To: =?UTF-8?Q?Marek_Beh=c3=ban?= , Chris Packham Cc: "u-boot@lists.denx.de" , =?UTF-8?Q?Marek_Beh=c3=ban?= References: <20220217000849.13028-1-kabel@kernel.org> From: Stefan Roese In-Reply-To: <20220217000849.13028-1-kabel@kernel.org> 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.5 at phobos.denx.de X-Virus-Status: Clean On 2/17/22 01:08, Marek Behún wrote: > From: Marek Behún > > Some boards may occacionally fail DDR training. Currently we hang() in > this case. Add an option that makes the board do an immediate reset in > such a case, so that a new training is tried as soon as possible, > instead of hanging and possibly waiting for watchdog to reset the board. > > Signed-off-by: Marek Behún > --- > arch/arm/mach-mvebu/Kconfig | 9 +++++++++ > arch/arm/mach-mvebu/spl.c | 6 +++++- > 2 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig > index d23cc0c760..ed957be6e1 100644 > --- a/arch/arm/mach-mvebu/Kconfig > +++ b/arch/arm/mach-mvebu/Kconfig > @@ -213,6 +213,15 @@ config DDR_LOG_LEVEL > At level 3, rovides the windows margin of each DQ as a results of > DQS centeralization. > > +config DDR_RESET_ON_TRAINING_FAILURE > + bool "Reset the board on DDR training failure instead of hanging" > + depends on ARMADA_38X || ARMADA_XP > + help > + If DDR training fails in SPL, reset the board instead of hanging. > + Some boards are known to fail DDR training occasionally and an > + immediate reset may be preferable to waiting until the board is > + reset by watchdog (if there even is one). > + I'm wondering a bit, if we could/should make this a global Kconfig symbol, so that other boards/platforms might use it as well. But we can always generalize this at a later point. Reviewed-by: Stefan Roese Thanks, Stefan > config SYS_BOARD > default "clearfog" if TARGET_CLEARFOG > default "helios4" if TARGET_HELIOS4 > diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c > index 273ecb8bd6..d3c3bdc74d 100644 > --- a/arch/arm/mach-mvebu/spl.c > +++ b/arch/arm/mach-mvebu/spl.c > @@ -4,6 +4,7 @@ > */ > > #include > +#include > #include > #include > #include > @@ -330,7 +331,10 @@ void board_init_f(ulong dummy) > ret = ddr3_init(); > if (ret) { > printf("ddr3_init() failed: %d\n", ret); > - hang(); > + if (IS_ENABLED(CONFIG_DDR_RESET_ON_TRAINING_FAILURE)) > + reset_cpu(); > + else > + hang(); > } > #endif > Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de